/* ============================================================
   HHPOKER联盟 - Custom Styles
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #1D4ED8;
    --primary-light: #3B82F6;
    --primary-dark: #1E3A8A;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-hover: rgba(255, 255, 255, 0.06);
}

/* ---------- Smooth Scroll ---------- */
html {
    scroll-behavior: smooth;
}

/* ---------- Selection ---------- */
::selection {
    background: var(--primary-light);
    color: #fff;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #020617;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============================================================
   GLASSMORPHISM
   ============================================================ */
.glass-nav {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   NAVBAR SCROLLED STATE
   ============================================================ */
#navbar.scrolled .glass-nav {
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   HERO GRID/DOT PATTERN BACKGROUND
   ============================================================ */
.hero-grid-bg {
    background-color: #020617;
    background-image:
        /* Grid lines - horizontal */
        linear-gradient(rgba(29, 78, 216, 0.04) 1px, transparent 1px),
        /* Grid lines - vertical */
        linear-gradient(90deg, rgba(29, 78, 216, 0.04) 1px, transparent 1px),
        /* Dot pattern */
        radial-gradient(circle, rgba(59, 130, 246, 0.12) 1px, transparent 1px);
    background-size:
        40px 40px,
        40px 40px,
        20px 20px;
    background-position:
        0 0,
        0 0,
        10px 10px;
}

/* ============================================================
   GRADIENT BORDER CARDS
   ============================================================ */
.gradient-border-card {
    position: relative;
    border-radius: 16px;
    padding: 1.5px;
    background: linear-gradient(
        135deg,
        rgba(29, 78, 216, 0.5) 0%,
        rgba(59, 130, 246, 0.3) 25%,
        rgba(99, 102, 241, 0.2) 50%,
        rgba(59, 130, 246, 0.3) 75%,
        rgba(29, 78, 216, 0.5) 100%
    );
    transition: all 0.3s ease;
}

.gradient-border-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1.5px;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.4) 0%,
        rgba(29, 78, 216, 0.5) 50%,
        rgba(59, 130, 246, 0.4) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.gradient-border-card:hover {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.7) 0%,
        rgba(99, 102, 241, 0.5) 25%,
        rgba(139, 92, 246, 0.4) 50%,
        rgba(99, 102, 241, 0.5) 75%,
        rgba(59, 130, 246, 0.7) 100%
    );
}

.card-inner {
    border-radius: 14px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.faq-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.faq-item.active {
    border-color: rgba(59, 130, 246, 0.3);
}

.faq-item.active .fa-chevron-down {
    transform: rotate(180deg);
    color: var(--primary-light);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* Floating animation for hero badge */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* Fade in up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Reveal on scroll base state */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Pulse ring */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ============================================================
   COUNTER STYLES
   ============================================================ */
.counter-wrapper {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ============================================================
   MOBILE MENU
   ============================================================ */
#mobileMenu {
    animation: fadeInUp 0.3s ease forwards;
}

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */
@media (max-width: 640px) {
    .hero-grid-bg {
        background-size:
            20px 20px,
            20px 20px,
            10px 10px;
        background-position:
            0 0,
            0 0,
            5px 5px;
    }

    .gradient-border-card {
        padding: 1px;
    }
}

/* ============================================================
   FOCUS & ACCESSIBILITY
   ============================================================ */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .animate-float,
    .animate-fade-in-up {
        animation: none;
    }

    .reveal {
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}
