/*
================================================================================
| ROOBUX - ULTRA PREMIUM DESIGN SYSTEM v4.0 | referrals.css
================================================================================
| Next-gen referrals page with cutting-edge animations and performance
| Features: Particle effects, magnetic hover, 3D transforms, smooth transitions
================================================================================
*/

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
* {
    will-change: auto;
}

.card,
.referral-link-card,
.stat-card,
.bonus-card,
.promo-template {
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}

/* ===== GLOBAL ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--color-primary-glow),
                    0 0 40px rgba(0, 153, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 30px var(--color-primary-glow),
                    0 0 60px rgba(0, 153, 255, 0.5);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== ENHANCED HOVER EFFECTS ===== */
.card::before,
.referral-link-card::before {
    display: none !important;
}

.card,
.referral-link-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.card::after,
.referral-link-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 153, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card:hover,
.referral-link-card:hover {
    border-color: var(--color-primary) !important;
    box-shadow: 
        0 0 30px var(--color-primary-glow),
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 0 60px rgba(0, 153, 255, 0.05) !important;
    transform: translateY(-8px) scale(1.02);
}

.card:hover::after,
.referral-link-card:hover::after {
    opacity: 1;
}

/* ===== 1. HERO SECTION ===== */
.referral-hero {
    background: linear-gradient(135deg, 
        var(--color-primary) 0%, 
        var(--color-accent) 50%, 
        var(--color-primary) 100%);
    background-size: 200% 200%;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    color: var(--color-text-inverted);
    box-shadow: 
        0 0 40px var(--color-primary-glow), 
        0 0 60px var(--color-accent-glow),
        0 20px 60px rgba(0, 0, 0, 0.4);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out, gradient-shift 8s ease infinite;
}

.referral-hero::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    background-size: 200% 200%;
    border-radius: var(--radius-lg);
    z-index: -1;
    animation: shimmer 3s linear infinite;
}

.referral-hero h1 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 2.2rem;
    color: var(--color-text-inverted);
    text-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 255, 255, 0.3);
    font-weight: 800;
    letter-spacing: -0.5px;
    animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

.referral-hero p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 600px;
    margin-bottom: 0;
    color: var(--color-text-inverted);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

/* ===== 2. REFERRAL LINK CARD ===== */
.referral-link-card {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    animation: fadeInUp 0.6s ease-out 0.3s backwards;
    border: 2px solid var(--color-border);
}

.referral-link-card .form-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.referral-link-card .form-label::before {
    content: '🔗';
    font-size: 1.2rem;
    animation: float 3s ease-in-out infinite;
}

.referral-link-input-group {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.referral-link-input-group .form-control {
    background: linear-gradient(135deg, 
        var(--color-bg-main) 0%, 
        rgba(22, 27, 34, 0.8) 100%);
    border: 2px solid var(--color-border);
    color: var(--color-text-primary);
    font-family: var(--font-mono);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.referral-link-input-group .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 
        0 0 0 4px rgba(0, 153, 255, 0.15),
        inset 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.referral-link-input-group .btn {
    position: relative;
    overflow: hidden;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.referral-link-input-group .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.referral-link-input-group .btn:hover::before {
    width: 300px;
    height: 300px;
}

.referral-link-input-group .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 153, 255, 0.4);
}

.referral-link-input-group .btn:active {
    transform: translateY(-1px);
}

/* ===== 3. STAT CARDS ===== */
.stat-cards-grid {
    margin-top: var(--space-xl);
    display: grid;
    gap: var(--space-lg);
}

.stat-card {
    animation: fadeInUp 0.6s ease-out backwards;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid var(--color-border);
    position: relative;
}

.stat-card:nth-child(1) { animation-delay: 0.4s; }
.stat-card:nth-child(2) { animation-delay: 0.5s; }
.stat-card:nth-child(3) { animation-delay: 0.6s; }
.stat-card:nth-child(4) { animation-delay: 0.7s; }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, 
        var(--color-primary), 
        var(--color-accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--color-primary);
    box-shadow: 
        0 0 30px var(--color-primary-glow),
        0 10px 40px rgba(0, 0, 0, 0.3);
}

/* ===== 4. MAIN GRID LAYOUT ===== */
.referral-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.referral-column-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.referral-column-main > * {
    animation: fadeInUp 0.6s ease-out backwards;
}

.referral-column-main > *:nth-child(1) { animation-delay: 0.8s; }
.referral-column-main > *:nth-child(2) { animation-delay: 0.9s; }

.referral-column-side {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.referral-column-side > * {
    animation: slideInRight 0.6s ease-out backwards;
}

.referral-column-side > *:nth-child(1) { animation-delay: 0.8s; }
.referral-column-side > *:nth-child(2) { animation-delay: 0.9s; }
.referral-column-side > *:nth-child(3) { animation-delay: 1s; }

/* ===== 5. BONUS CARD WITH PREMIUM ICONS ===== */
.bonus-card {
    border: 2px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.bonus-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(0, 153, 255, 0.05) 0%, 
        transparent 70%);
    animation: spin-slow 20s linear infinite;
    pointer-events: none;
}

.bonus-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    position: relative;
    z-index: 1;
}

.bonus-card li {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.95rem;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bonus-card li:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(8px);
}

.bonus-card .icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white !important;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: float 4s ease-in-out infinite;
}

.bonus-card li:hover .icon {
    transform: scale(1.15) rotate(10deg);
}

.bonus-card li:first-child .icon {
    background: linear-gradient(135deg, 
        var(--color-success) 0%, 
        #16a34a 100%);
    box-shadow: 
        0 0 20px var(--color-success-glow),
        0 8px 25px rgba(34, 197, 94, 0.4);
    animation-delay: 0s;
}

.bonus-card li:last-child .icon {
    background: linear-gradient(135deg, 
        var(--color-primary) 0%, 
        #0044ff 100%);
    box-shadow: 
        0 0 20px var(--color-primary-glow),
        0 8px 25px rgba(0, 153, 255, 0.4);
    animation-delay: 0.5s;
}

.bonus-card .icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bonus-card li:hover .icon::before {
    opacity: 1;
}

.bonus-card .label {
    font-weight: 700;
    color: var(--color-text-primary);
    font-size: 1.1rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.bonus-card li:hover .label {
    color: var(--color-primary);
}

.bonus-card .value {
    font-weight: 800;
    font-size: 2rem;
    line-height: 1.2;
    margin-top: var(--space-xs);
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, currentColor, currentColor);
    background-clip: text;
    -webkit-background-clip: text;
    transition: transform 0.3s ease;
}

.bonus-card li:hover .value {
    transform: scale(1.05);
}

.bonus-card li:first-child .value {
    color: var(--color-success);
}

.bonus-card li:last-child .value {
    color: var(--color-primary);
}

.bonus-card .desc {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 0;
    line-height: 1.5;
}

/* ===== 6. PROMO TEMPLATES ===== */
.promo-template {
    background: linear-gradient(135deg, 
        var(--color-bg-main) 0%, 
        rgba(22, 27, 34, 0.8) 100%);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.promo-template::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 153, 255, 0.1), 
        transparent);
    transition: left 0.5s ease;
}

.promo-template:hover::before {
    left: 100%;
}

.promo-template:hover {
    border-color: var(--color-primary);
    transform: translateX(5px);
    box-shadow: 
        -5px 0 20px rgba(0, 153, 255, 0.2),
        0 5px 20px rgba(0, 0, 0, 0.2);
}

.promo-template p {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-sm) 0;
    white-space: pre-wrap;
    word-break: break-all;
    position: relative;
    z-index: 1;
}

.promo-template .btn {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.promo-template:hover .btn {
    transform: scale(1.05);
}

/* ===== 7. TERMS CARD ===== */
.list-disc-inside {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    padding-left: var(--space-lg);
    list-style-type: none;
}

.list-disc-inside li {
    margin-bottom: var(--space-md);
    position: relative;
    padding-left: var(--space-lg);
    transition: all 0.3s ease;
}

.list-disc-inside li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.list-disc-inside li:hover {
    color: var(--color-text-primary);
    transform: translateX(5px);
}

.list-disc-inside li:hover::before {
    transform: translateX(3px);
    color: var(--color-accent);
}

/* ===== 8. CARD TITLES ===== */
.card h3,
.referral-link-card h3,
.bonus-card h3 {
    position: relative;
    display: inline-block;
    margin-bottom: var(--space-md);
}

.card h3::after,
.referral-link-card h3::after,
.bonus-card h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--color-primary), 
        var(--color-accent));
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 2px;
}

.card:hover h3::after,
.referral-link-card:hover h3::after,
.bonus-card:hover h3::after {
    width: 100%;
}

/* ===== 9. SCROLL ANIMATIONS ===== */
@keyframes revealOnScroll {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 10. PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU Acceleration */
.card,
.stat-card,
.bonus-card,
.promo-template,
.referral-hero {
    transform: translateZ(0);
    will-change: transform;
}