/* premium-theme.css */

/* Animated Mesh Gradient Background */
body {
    background: linear-gradient(-45deg, #f8fafc, #edf2f7, #e2e8f0, #f1f5f9) !important;
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite !important;
    color: #0f172a !important;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Decorative Background Glows */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.2) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(196, 181, 253, 0.2) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* Sidebar Styling */
.sidebar {
    background: rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02) !important;
    z-index: 20;
}

/* The Main Content Area */
.main, .main-content {
    background: transparent !important;
}

/* Glassmorphism Cards */
.card, .glass-card {
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.08), 
                0 8px 15px -10px rgba(15, 23, 42, 0.04) !important;
    border-radius: 28px !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
}

.card-footer {
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(12px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
}

/* Hover States for Cards */
.card:hover, .glass-card:hover {
    transform: translateY(-8px) scale(1.01) !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15), 
                0 15px 30px -15px rgba(15, 23, 42, 0.1) !important;
    border-color: rgba(255, 255, 255, 1) !important;
    background: rgba(255, 255, 255, 0.8) !important;
}

/* Buttons */
.btn-primary, .cta-btn-large {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.3) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary:hover, .cta-btn-large:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 15px 30px -5px rgba(15, 23, 42, 0.4) !important;
    background: linear-gradient(135deg, #000000 0%, #1e293b 100%) !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
    color: #475569 !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-secondary:not([disabled]):hover {
    background: #ffffff !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08) !important;
    transform: translateY(-2px) !important;
    color: #0f172a !important;
}

/* Gradient Texts for better aesthetics */
.gradient-text {
    background: linear-gradient(135deg, #2563eb, #8b5cf6, #14b8a6) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-size: 200% auto !important;
    animation: shine 6s linear infinite !important;
}

@keyframes shine {
    to { background-position: 200% center; }
}

/* Sidebar Module Items */
.module-item {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative;
    border: 1px solid transparent !important;
}

.module-item:hover {
    background: rgba(255, 255, 255, 0.6) !important;
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02) !important;
}

.module-item.active {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 1) !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08) !important;
    color: #2563eb !important;
    font-weight: 600 !important;
}

.module-item.active i {
    color: #2563eb !important;
}

/* Header & Typography Tweaks */
h1, h2, h3 {
    letter-spacing: -0.02em;
}

/* Progress bar styling */
#progress {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #14b8a6) !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4) !important;
}

/* Icons styling in glass cards */
.glass-card > div:first-child {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease !important;
}

.glass-card:hover > div:first-child {
    transform: scale(1.1) rotate(5deg) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
}

/* Dashboard header tweaks */
header .badge {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
}

/* =========================================================
   MOBILE "NATIVE APP" HOOK EXPERIENCE
   ========================================================= */
@media (max-width: 768px) {
    /* 1. Lock the body to prevent bouncy overscroll */
    body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .layout {
        height: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* 2. Top App Bar (TikTok/Insta Story Style) */
    .sidebar {
        padding: 16px 20px !important;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        z-index: 100 !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        min-height: 80px !important;
        border: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.8) !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.03) !important;
    }

    /* Move progress bar to the absolute top edge */
    .sidebar .mt-auto {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }
    
    .sidebar .mt-auto .text-xs {
        display: none !important; /* Hide "PROGRESS" text */
    }

    .sidebar .mt-auto .h-1\.5 {
        height: 5px !important;
        border-radius: 0 !important;
        background: rgba(0,0,0,0.05) !important;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    }

    /* Fix header spacing */
    .sidebar .mb-8 {
        margin-top: 10px !important;
        margin-bottom: 0 !important;
    }

    /* 3. Main content fills screen and scrolls natively */
    .main {
        padding: 0 !important;
        margin-top: 80px !important;
        height: calc(100vh - 80px) !important;
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important; /* Smooth scrolling */
        align-items: flex-start !important;
        background: transparent !important;
    }

    #cardContainer {
        height: auto !important;
        min-height: 100% !important;
        padding-bottom: 110px !important; /* Space for the thumb-dock */
        align-items: flex-start !important;
    }

    /* 4. Full-Bleed immersive cards */
    .card {
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        transform: none !important;
    }

    .card:hover {
        transform: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .card-body {
        padding: 32px 24px !important;
        overflow: visible !important;
    }

    /* 5. Sticky "Thumb-Zone" Bottom Dock */
    .card-footer {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding: 16px 20px 28px 20px !important; /* Extra bottom padding for iOS home indicator */
        background: rgba(255, 255, 255, 0.9) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        border: none !important;
        border-top: 1px solid rgba(255,255,255,1) !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.08) !important;
        z-index: 100 !important;
        border-radius: 32px 32px 0 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Big thumb-friendly buttons */
    .btn {
        padding: 16px 28px !important;
        border-radius: 100px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px;
    }

    /* Completion Hook: Pulse the NEXT button to drive clicks */
    .btn-primary:not([disabled]) {
        animation: thumbPulse 2s infinite !important;
    }
    
    /* Typography optimizations for scan-ability */
    h2 {
        font-size: 32px !important;
        line-height: 1.2 !important;
        margin-bottom: 24px !important;
    }
    
    p {
        font-size: 18px !important;
        line-height: 1.6 !important;
        color: #334155 !important;
    }
}

/* Subtle guiding pulse for the primary action button */
@keyframes thumbPulse {
    0% { box-shadow: 0 0 0 0 rgba(15, 23, 42, 0.4); }
    70% { box-shadow: 0 0 0 14px rgba(15, 23, 42, 0); }
    100% { box-shadow: 0 0 0 0 rgba(15, 23, 42, 0); }
}

/* =========================================================
   MOBILE "NATIVE APP" HOOK EXPERIENCE
   ========================================================= */
@media (max-width: 768px) {
    /* 1. Lock the body to prevent bouncy overscroll */
    body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .layout {
        height: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* 2. Top App Bar (TikTok/Insta Story Style) */
    .sidebar {
        padding: 16px 20px !important;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        z-index: 100 !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        min-height: 80px !important;
        border: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.8) !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.03) !important;
    }

    /* Move progress bar to the absolute top edge */
    .sidebar .mt-auto {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }
    
    .sidebar .mt-auto .text-xs {
        display: none !important; /* Hide "PROGRESS" text */
    }

    .sidebar .mt-auto .h-1\.5 {
        height: 5px !important;
        border-radius: 0 !important;
        background: rgba(0,0,0,0.05) !important;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    }

    /* Fix header spacing */
    .sidebar .mb-8 {
        margin-top: 10px !important;
        margin-bottom: 0 !important;
    }

    /* 3. Main content fills screen and scrolls natively */
    .main {
        padding: 0 !important;
        margin-top: 80px !important;
        height: calc(100vh - 80px) !important;
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important; /* Smooth scrolling */
        align-items: flex-start !important;
        background: transparent !important;
    }

    #cardContainer {
        height: auto !important;
        min-height: 100% !important;
        padding-bottom: 110px !important; /* Space for the thumb-dock */
        align-items: flex-start !important;
    }

    /* 4. Full-Bleed immersive cards */
    .card {
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        transform: none !important;
    }

    .card:hover {
        transform: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .card-body {
        padding: 32px 24px !important;
        overflow: visible !important;
    }

    /* 5. Sticky "Thumb-Zone" Bottom Dock */
    .card-footer {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding: 16px 20px 28px 20px !important; /* Extra bottom padding for iOS home indicator */
        background: rgba(255, 255, 255, 0.9) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        border: none !important;
        border-top: 1px solid rgba(255,255,255,1) !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.08) !important;
        z-index: 100 !important;
        border-radius: 32px 32px 0 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Big thumb-friendly buttons */
    .btn {
        padding: 16px 28px !important;
        border-radius: 100px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px;
    }

    /* Completion Hook: Pulse the NEXT button to drive clicks */
    .btn-primary:not([disabled]) {
        animation: thumbPulse 2s infinite !important;
    }
    
    /* Typography optimizations for scan-ability */
    h2 {
        font-size: 32px !important;
        line-height: 1.2 !important;
        margin-bottom: 24px !important;
    }
    
    p {
        font-size: 18px !important;
        line-height: 1.6 !important;
        color: #334155 !important;
    }
}

/* Subtle guiding pulse for the primary action button */
@keyframes thumbPulse {
    0% { box-shadow: 0 0 0 0 rgba(15, 23, 42, 0.4); }
    70% { box-shadow: 0 0 0 14px rgba(15, 23, 42, 0); }
    100% { box-shadow: 0 0 0 0 rgba(15, 23, 42, 0); }
}
