/**
 * Referral Widget Styles
 * Premium Apple-inspired design with smooth animations
 */

.referral-widget {
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.05) 0%,
            rgba(147, 51, 234, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.referral-widget:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 24px rgba(59, 130, 246, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.04);
    border-color: rgba(59, 130, 246, 0.2);
}

/* Header */
.referral-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.referral-icon {
    font-size: 48px;
    line-height: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

.referral-title h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text-primary, #1a1a1a);
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
}

.referral-title p {
    font-size: 14px;
    color: var(--color-text-secondary, #666);
    margin: 0;
}

/* Link Section */
.referral-link-section {
    margin-bottom: 24px;
}

.referral-link-section label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, #666);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.link-input-group {
    display: flex;
    gap: 8px;
}

.referral-link-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 15px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: var(--color-primary, #3b82f6);
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
}

.referral-link-input:focus {
    border-color: var(--color-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 8px 16px rgba(59, 130, 246, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.copy-btn svg {
    width: 20px;
    height: 20px;
}

/* Stats Section */
.referral-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-item.highlight {
    background: linear-gradient(135deg,
            rgba(16, 185, 129, 0.1) 0%,
            rgba(5, 150, 105, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

.stat-item.highlight .stat-value {
    color: #10b981;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary, #3b82f6);
    line-height: 1;
    margin-bottom: 8px;
    font-feature-settings: 'tnum';
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Social Share */
.social-share {
    margin-bottom: 20px;
}

.social-share label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, #666);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn.whatsapp {
    color: #25d366;
}

.share-btn.whatsapp:hover {
    background: rgba(37, 211, 102, 0.1);
    border-color: #25d366;
}

.share-btn.sms {
    color: #3b82f6;
}

.share-btn.sms:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.share-btn.email {
    color: #8b5cf6;
}

.share-btn.email:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

/* Pending Notice */
.pending-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg,
            rgba(251, 191, 36, 0.1) 0%,
            rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    font-size: 14px;
    color: #92400e;
}

.pending-notice svg {
    flex-shrink: 0;
    color: #fbbf24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .referral-widget {
        padding: 20px;
    }

    .referral-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .link-input-group {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
        justify-content: center;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
    }

    .referral-title h3 {
        font-size: 20px;
    }

    .stat-value {
        font-size: 28px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .referral-widget {
        background: linear-gradient(135deg,
                rgba(59, 130, 246, 0.08) 0%,
                rgba(147, 51, 234, 0.08) 100%);
        border-color: rgba(59, 130, 246, 0.15);
    }

    .referral-title h3 {
        color: #f9fafb;
    }

    .referral-title p {
        color: #9ca3af;
    }

    .referral-link-section label,
    .social-share label,
    .stat-label {
        color: #9ca3af;
    }

    .referral-link-input {
        background: rgba(31, 41, 55, 0.8);
        border-color: rgba(59, 130, 246, 0.3);
        color: #60a5fa;
    }

    .stat-item {
        background: rgba(31, 41, 55, 0.6);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .stat-item:hover {
        background: rgba(31, 41, 55, 0.9);
    }

    .share-btn {
        background: rgba(31, 41, 55, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .pending-notice {
        background: linear-gradient(135deg,
                rgba(251, 191, 36, 0.15) 0%,
                rgba(245, 158, 11, 0.15) 100%);
        color: #fbbf24;
    }
}

/* Animation for widget entrance */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.referral-widget {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}