﻿:root {
    /* --- BACKGROUND --- */
    --bg: #05030a;
    /* --- BRAND COLORS (Purple/Fuchsia) --- */
    --brand-primary: #a855f7;
    --brand-secondary: #d946ef;
    /* Text & Accents */
    --muted: #cbd5e1;
    --glass: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    scroll-behavior: smooth
}

body {
    background: var(--bg);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.45;
}

/* --- BACKGROUND PATTERN --- */
.bg-wrap {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background-image: linear-gradient(rgba(168, 85, 247, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(168, 85, 247, 0.07) 1px, transparent 1px);
    background-size: 40px 40px;
}

    .bg-wrap::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at center, transparent 20%, var(--bg) 90%);
        pointer-events: none;
    }

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    mix-blend-mode: screen;
}

.g1 {
    width: 60vmax;
    height: 60vmax;
    background: radial-gradient(circle at center, rgba(168, 85, 247, 0.25), transparent 60%);
    top: -20%;
    right: -20%;
    animation: mv1 20s linear infinite;
}

.g2 {
    width: 50vmax;
    height: 50vmax;
    background: radial-gradient(circle at center, rgba(217, 70, 239, 0.2), transparent 60%);
    bottom: -20%;
    left: -20%;
    animation: mv2 25s linear infinite;
}

@keyframes mv1 {
    0%, 100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-5%, -5%);
    }
}

@keyframes mv2 {
    0%, 100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(5%, 5%);
    }
}

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 18px 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(5, 3, 10, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 40;
    transition: all 0.3s ease;
}

    header.scrolled {
        background: rgba(5, 3, 10, 0.98);
        border-bottom: 1px solid var(--brand-primary);
        padding-top: 12px;
        padding-bottom: 12px;
    }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

    .logo .icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 24px;
        font-weight: 900;
        box-shadow: 0 5px 15px rgba(168, 85, 247, 0.4);
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

    /* Header Buttons/Links */
    .header-actions a {
        text-decoration: none;
        color: var(--muted);
        padding: 8px 16px;
        border: 1px solid var(--glass);
        border-radius: 10px;
        font-weight: 600;
        transition: 0.2s;
        font-size: 14px;
        white-space: nowrap; /* Prevent text wrapping */
    }

        .header-actions a:hover {
            color: #fff;
            border-color: var(--brand-primary);
            background: rgba(168, 85, 247, 0.15);
        }

/* Specific styling for the Create Account button in header to stand out */
#registerHeaderLink {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    border: none;
    box-shadow: 0 4px 10px rgba(168, 85, 247, 0.3);
}

/* --- HERO SECTION --- */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px 20px 20px; /* Top padding accounts for fixed header */
    position: relative;
    z-index: 1;
}

    .hero h1 {
        font-size: 56px;
        color: #fff;
        font-weight: 900;
        letter-spacing: -1px;
        margin-bottom: 16px;
        line-height: 1.1;
        text-shadow: 0 0 60px rgba(168, 85, 247, 0.5);
        opacity: 0;
        transform: translateY(8px);
        transition: opacity 1s ease, transform 1s ease;
    }

.title-pulse {
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.8), 0 0 40px rgba(217, 70, 239, 0.4);
}

.hero p {
    font-size: 18px;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto 32px auto;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease 0.15s, transform 1s ease 0.15s;
}

.hero .actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

/* --- MAIN BUTTONS (Matches your class) --- */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    padding: 0 32px;
    min-width: 160px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.4);
    transition: all 0.3s ease;
}

    .btn:hover {
        box-shadow: 0 15px 30px rgba(168, 85, 247, 0.6);
        transform: translateY(-2px);
    }

/* --- PLANS --- */
.plans-section {
    padding: 40px 20px 80px 20px;
    text-align: center;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1s ease, transform 1s ease;
}

    .plans-section.show {
        opacity: 1;
        transform: translateY(0);
    }

    .plans-section h2, section.std h2, .testimonials h2 {
        font-size: 32px;
        font-weight: 800;
        margin-bottom: 30px;
        background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

.plans {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.plan {
    flex: 1 1 200px; /* Grow, Shrink, Basis */
    min-width: 220px;
    border-radius: 20px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
}

    .plan:hover {
        border-color: var(--brand-primary);
        transform: translateY(-8px);
        box-shadow: 0 15px 40px rgba(168, 85, 247, 0.25);
        background: rgba(255, 255, 255, 0.05);
    }

    .plan h3 {
        font-weight: 800;
        margin-bottom: 10px;
        color: #fff;
        text-transform: uppercase;
        letter-spacing: 1px;
        font-size: 20px;
    }

    .plan p {
        color: var(--muted);
        font-size: 15px;
        margin-bottom: 8px;
    }

    .plan span {
        display: block;
        color: var(--brand-primary);
        font-weight: 700;
        margin-top: 12px;
        font-size: 16px;
    }

/* --- TESTIMONIALS --- */
.testimonials {
    padding: 60px 20px;
    text-align: center;
}

.testi-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.testi {
    flex: 1 1 280px;
    min-width: 260px;
    border-radius: 16px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    transition: 0.3s;
}

    .testi:hover {
        border-color: var(--brand-secondary);
    }

    .testi img {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        margin-bottom: 12px;
        border: 2px solid var(--brand-primary);
        object-fit: cover;
    }

    .testi p {
        color: var(--muted);
        font-style: italic;
        margin-bottom: 10px;
        font-size: 15px;
        line-height: 1.6;
    }

    .testi .name {
        font-weight: 700;
        color: var(--brand-secondary);
        margin-bottom: 4px;
    }

.stars {
    color: var(--brand-primary);
    font-size: 16px;
}

section.std {
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

    section.std p {
        color: var(--muted);
        font-size: 16px;
        line-height: 1.8;
    }

/* --- SCROLL TOP BUTTON --- */
#scrollTopBtn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 60;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.4);
    border: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .36s ease, transform .36s ease;
}

    #scrollTopBtn.show {
        opacity: 1;
        transform: translateY(0);
    }

    #scrollTopBtn svg {
        width: 24px;
        height: 24px;
        fill: #fff;
    }

/* --- POPUP STYLES --- */
#popupOverlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
    padding: 20px; /* Padding prevents popup touching edges on mobile */
}

    #popupOverlay.show {
        opacity: 1;
        pointer-events: all;
    }

#popupCard {
    width: 100%;
    max-width: 600px;
    background: #0f0a16;
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    padding: 30px;
    color: #fff;
    transform: translateY(20px) scale(0.95);
    transition: transform .4s cubic-bezier(.2, .9, .2, 1), opacity .4s ease;
    max-height: 80vh;
    overflow-y: auto; /* Allow scrolling inside popup */
}

#popupOverlay.show #popupCard {
    transform: translateY(0) scale(1);
}

#popupCloseBtn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--brand-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    cursor: pointer;
    z-index: 4;
}

    #popupCloseBtn:hover {
        background: rgba(168, 85, 247, 0.2);
    }

.popup-heading {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-top: 10px;
}

.popup-subtitle {
    color: var(--brand-primary);
    font-weight: 800;
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 16px;
}

.popup-body {
    color: var(--muted);
    line-height: 1.7;
    font-size: 15px;
}

.popup-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

/* --- SPLASH SCREEN --- */
#splash-screen {
    position: fixed;
    inset: 0;
    background: #05030a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9998;
    opacity: 1;
    transition: opacity 1s ease, transform 1s ease;
}

    #splash-screen.hidden {
        opacity: 0;
        transform: translateY(-30px);
    }

.splash-logo {
    font-size: 120px;
    font-weight: 900;
    color: var(--brand-primary);
    text-shadow: 0 0 50px var(--brand-primary);
    animation: glowPulse 2s infinite ease-in-out;
    opacity: 0;
    transform: translateY(30px);
    animation: logoIn 1s ease forwards, glowPulse 2s infinite ease-in-out 1s;
}

.splash-name {
    font-size: 36px;
    font-weight: 900;
    margin-top: 8px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.5s;
}

.splash-welcome {
    font-size: 20px;
    font-weight: 800;
    margin-top: 16px;
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s ease forwards;
    animation-delay: 2.2s;
}

/* =========================================
   RESPONSIVE MEDIA QUERIES (THE FIXES)
   ========================================= */

/* Tablet & Smaller Laptops */
@media(max-width: 1024px) {
    header {
        padding: 18px 25px;
    }

    .hero h1 {
        font-size: 48px;
    }
}

/* Mobile Devices */
@media(max-width: 768px) {
    /* Header Adjustment */
    header {
        padding: 12px 16px;
        flex-wrap: wrap; /* Allows wrapping if absolutely needed */
    }

    /* Make logo smaller */
    .logo {
        font-size: 18px;
    }

        .logo .icon {
            width: 36px;
            height: 36px;
            font-size: 20px;
        }

    /* Compact Header Actions */
    .header-actions {
        gap: 6px;
    }

        .header-actions a {
            padding: 6px 10px;
            font-size: 12px;
        }

            /* Hide the "Support" TEXT on mobile, keep icon if possible */
            .header-actions a[href*="t.me"] {
                font-size: 0; /* Hides text */
                display: flex;
                align-items: center;
                padding: 6px;
            }

                .header-actions a[href*="t.me"] img {
                    margin: 0; /* Remove gap since text is gone */
                    width: 22px !important;
                    height: 22px !important;
                }

    /* Hero Text Scaling */
    .hero {
        padding-top: 120px;
    }

        .hero h1 {
            font-size: 36px;
        }

        .hero p {
            font-size: 15px;
        }

        /* Stack Hero Buttons */
        .hero .actions {
            flex-direction: column;
            width: 100%;
            max-width: 300px;
        }

    .btn {
        width: 100%;
    }
    /* Full width buttons on mobile */

    /* Plans/Cards stack vertically */
    .plan {
        min-width: 100%;
    }
}

/* Very Small Screens */
@media(max-width: 400px) {
    /* Hide "Login" button, show only "Create Account" if crowded */
    /* Or make text smaller */
    .header-actions a {
        padding: 6px 8px;
        font-size: 11px;
    }

    .hero h1 {
        font-size: 32px;
    }
}

/* Animation Keyframes */
@keyframes logoIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 0 40px var(--brand-primary), 0 0 80px rgba(168, 85, 247, 0.4);
    }

    50% {
        text-shadow: 0 0 70px var(--brand-secondary), 0 0 120px rgba(217, 70, 239, 0.6);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
