/* ============================================================
   JND28 Predict - Custom Stylesheet
   Modern SaaS design with indigo-600 primary
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --gradient-start: #4f46e5;
    --gradient-end: #7c3aed;
    --text-dark: #111827;
    --text-body: #374151;
    --text-muted: #6b7280;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --transition-fast: 200ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #818cf8, #6366f1, #4f46e5);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6366f1, #4f46e5, #4338ca);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #818cf8 #f1f5f9;
}

/* ---------- Selection ---------- */
::selection {
    background: rgba(79, 70, 229, 0.2);
    color: #4f46e5;
}

/* ==================== NAVIGATION ==================== */

/* Glass morphism on hero (initial state) */
#navbar.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Scrolled state - solid white */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06) !important;
}

/* Transition for all nav states */
#navbar {
    transition: background 0.4s ease,
                backdrop-filter 0.4s ease,
                -webkit-backdrop-filter 0.4s ease,
                border-color 0.4s ease,
                box-shadow 0.4s ease;
}

/* Logo text color transition */
#logo-text {
    transition: color 0.4s ease;
}

/* ==================== GRADIENT TEXT ANIMATION ==================== */
.text-gradient {
    background: linear-gradient(
        135deg,
        #4f46e5 0%,
        #7c3aed 25%,
        #a855f7 50%,
        #6366f1 75%,
        #4f46e5 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 5s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
}

/* ==================== FEATURE CARDS HOVER ==================== */
.feature-card {
    transform: translateY(0);
    transition: transform var(--transition-slow),
                box-shadow var(--transition-slow),
                border-color var(--transition-slow);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
    border-color: #e0e7ff;
}

/* ==================== BUTTON PULSE ==================== */
.btn-pulse {
    animation: pulseGlow 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    position: relative;
}

.btn-pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 9999px;
    background: transparent;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    animation: pulseRing 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 4px rgba(255, 255, 255, 0.25);
    }
}

@keyframes pulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* ==================== FAQ ACCORDION ==================== */
.faq-item {
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.faq-item:hover {
    border-color: #e0e7ff;
}

.faq-item.active {
    border-color: #c7d2fe;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.08);
}

.faq-toggle {
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.faq-item.active .faq-content {
    max-height: 300px;
    opacity: 1;
}

.faq-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    background: #eef2ff;
    color: #4f46e5;
}

/* ==================== FADE IN ANIMATION ==================== */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay variants */
.fade-in-delay-1 { transition-delay: 0.05s; }
.fade-in-delay-2 { transition-delay: 0.1s; }
.fade-in-delay-3 { transition-delay: 0.15s; }
.fade-in-delay-4 { transition-delay: 0.2s; }
.fade-in-delay-5 { transition-delay: 0.25s; }
.fade-in-delay-6 { transition-delay: 0.3s; }

/* ==================== COUNTER STYLING ==================== */
.counter {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ==================== MOBILE MENU ==================== */
#mobile-menu {
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.open {
    max-height: 500px;
    opacity: 1;
}

/* Hamburger animation */
#hamburger.open #bar1 {
    transform: translateY(7px) rotate(45deg);
}

#hamburger.open #bar2 {
    opacity: 0;
    transform: scaleX(0);
}

#hamburger.open #bar3 {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==================== NAV ACTIVE LINK ==================== */
.nav-link.active {
    position: relative;
    color: #fff !important;
}

#navbar.scrolled .nav-link.active {
    color: #4f46e5 !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: all 0.3s ease;
}

#navbar.scrolled .nav-link.active::after {
    background: #4f46e5;
}

/* ==================== HERO SHIMMER ==================== */
#hero .bg-clip-text {
    position: relative;
}

/* Hero image hover glow */
#hero img {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

#hero img:hover {
    transform: scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1023px) {
    #navbar .nav-link {
        display: none;
    }

    #logo-text {
        color: rgba(255, 255, 255, 0.95) !important;
    }

    #navbar.scrolled #logo-text {
        color: #111827 !important;
    }

    #hamburger .bg-white,
    #navbar:not(.scrolled) #bar1,
    #navbar:not(.scrolled) #bar2,
    #navbar:not(.scrolled) #bar3 {
        background-color: rgba(255, 255, 255, 0.95) !important;
    }
}

@media (max-width: 639px) {
    h1 {
        font-size: 2.25rem !important;
        line-height: 1.15 !important;
    }

    h2 {
        font-size: 1.75rem !important;
        line-height: 1.25 !important;
    }

    #hero {
        min-height: 100vh;
    }

    .feature-card:hover {
        transform: translateY(-5px) !important;
    }

    .btn-pulse::after {
        display: none;
    }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    #navbar,
    #mobile-menu,
    #cta,
    footer {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
    }
}
