/* ============================================
   Shared Premium Design System
   Compatible with both Light & Dark Modes
   ============================================ */

/* Import premium font (Ensure available in Light Mode) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    /* Light Slate theme background with blueprint grid (matches jdcelearn-lightbackground-reference) */
    background-color: #f8fafc;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Dark mode override for body background */
html.dark-mode body {
    background-color: var(--bg-primary, #0D0D0D);
}

:root {
    /* Gold Accents - Always available */
    --gold: #C9A55C;
    --gold-light: #E2C17C;
    --gold-dark: #A68942;
    --gold-glow: rgba(201, 165, 92, 0.15);

    /* Shared Shadows */
    --shadow-gold: 0 8px 32px rgba(201, 165, 92, 0.2);
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* Use fallback colors for light mode if global vars like --bg-elevated are not defined */
    background: var(--bg-elevated, #f4f4f5);
    border: 1px solid var(--border-default, #e4e4e7);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #71717a);
    margin-bottom: 32px;
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Hero Typography */
.hero-title {
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    /* Default color inherits (Black in light mode, overrides to white in dark mode if scoped) */
}

.hero-title .gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--gold);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary, #71717a);
    /* Fallback to gray-500 for light mode */
    max-width: 560px;
    margin: 0 auto 48px;
    line-height: 1.7;
}

/* Premium Buttons */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: #000;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-gold);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(201, 165, 92, 0.35);
    color: #000;
}

/* Animation utilities if needed */
.animate-slide-up {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Section Titles & Subtitles
   ============================================ */
.section-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.2;
    color: #1f2937;
    /* Default Light Mode */
}

html.dark-mode .section-title {
    color: var(--gold) !important;
}

.section-subtitle {
    font-size: 16px;
    color: #4b5563;
    /* Default Light Mode */
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

html.dark-mode .section-subtitle {
    color: var(--text-secondary, #B3B3B3) !important;
}

/* ============================================
   Sample Lectures
   ============================================ */
.sample-lecture-title {
    color: #201d1c;
    /* Default Light Mode */
}

html.dark-mode .sample-lecture-title {
    color: var(--gold) !important;
}

.sample-lecture-desc {
    color: #666666;
    /* Default Light Mode */
}

html.dark-mode .sample-lecture-desc {
    color: #B3B3B3 !important;
}

/* Sample Lecture Cards - Auto Theme Support */
.sample-lecture-card {
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    flex: 0 0 320px;
    min-width: 320px;
    max-width: 320px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    height: 380px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html.dark-mode .sample-lecture-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sample-lecture-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: rgba(201, 165, 92, 0.5);
}

html.dark-mode .sample-lecture-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.sample-lecture-img-placeholder {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

html.dark-mode .sample-lecture-img-placeholder {
    background: linear-gradient(135deg, #201d1c 0%, #3d3a39 100%);
}

/* ============================================
   Global Notifications Panel
   ============================================ */
.notification-panel {
    background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%);
    border-color: rgba(62, 39, 35, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.notification-header,
.notification-tabs {
    border-color: rgba(62, 39, 35, 0.1) !important;
}

.notification-title {
    color: #1f2937;
}

.notification-icon,
.notification-action {
    color: #3E2723;
}

.notification-tab {
    color: #6b7280;
    border-color: transparent;
}

.notification-tab.active {
    color: #3E2723 !important;
    border-color: #3E2723 !important;
}

.notification-tab:hover {
    color: #374151;
}

.notification-item {
    border-bottom: 1px solid rgba(62, 39, 35, 0.05);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-unread {
    background: linear-gradient(to right, #fff8e1, #fff3e0);
}

.notification-text-primary {
    color: #111827;
}

.notification-text-secondary {
    color: #374151;
}

.notification-time {
    color: #3E2723;
}

.notification-dot {
    background: #3E2723;
}

/* Dark Mode Overrides for Notifications */
html.dark-mode .notification-panel {
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

html.dark-mode .notification-header,
html.dark-mode .notification-tabs {
    border-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-mode .notification-title {
    color: #FFFFFF !important;
}

html.dark-mode .notification-icon,
html.dark-mode .notification-action {
    color: var(--gold) !important;
}

html.dark-mode .notification-icon-border {
    border-color: #1a1a1a !important;
}

html.dark-mode .notification-tab.active {
    color: var(--gold) !important;
    border-color: var(--gold) !important;
}

html.dark-mode .notification-tab:not(.active) {
    color: #888 !important;
}

html.dark-mode .notification-tab:not(.active):hover {
    color: #ccc !important;
}

html.dark-mode .notification-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html.dark-mode .notification-item:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

html.dark-mode .notification-unread {
    background: linear-gradient(to right, rgba(201, 165, 92, 0.1), rgba(201, 165, 92, 0.05)) !important;
    border-left: 2px solid var(--gold);
}

html.dark-mode .notification-text-primary {
    color: #fff !important;
}

html.dark-mode .notification-text-secondary {
    color: #b3b3b3 !important;
}

html.dark-mode .notification-time {
    color: var(--gold) !important;
}

/* ============================================
   Sample Lecture Cards
   ============================================ */
.sample-lecture-card {
    background: #ffffff;
    /* Default Light Mode */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sample-lecture-card:hover {
    border-color: rgba(201, 165, 92, 0.5);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

html.dark-mode .sample-lecture-card {
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
}


/* ============================================
   Course Status Badges
   ============================================ */
.course-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.course-badge.in-progress {
    background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%);
    color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   Course Grid Layout (Global)
   ============================================ */
/* 3-Column Course Grid */
.courses-grid-pro {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
}

@media (max-width: 1024px) {
    .courses-grid-pro {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .courses-grid-pro {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Hero Section Mobile Responsive (Ported from Dark Theme)
   ============================================ */
@media (max-width: 768px) {

    /* Override parent container padding - must be very specific to override inline styles */
    .mobile-hero-content,
    .mobile-hero-content[style],
    .hero-content-wrapper,
    .hero-content-wrapper[style],
    #dashboard-hero-bg>div,
    #dashboard-hero-bg>.relative,
    #dashboard-hero-bg>.relative.z-10,
    #dashboard-hero-bg div.relative.z-10.flex.flex-col,
    div.mobile-hero-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Hero content wrapper - minimal left padding */
    .mobile-hero-content .animate-fade-in,
    .mobile-hero-content>.animate-fade-in,
    .mobile-hero-content div.animate-fade-in,
    .hero-animate-wrapper,
    .hero-animate-wrapper[style],
    #dashboard-hero-bg .animate-fade-in,
    div.animate-fade-in[style*="max-width"] {
        padding-left: 12px !important;
        padding-right: 12px !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }

    .hero-title {
        font-size: clamp(24px, 7vw, 36px) !important;
        margin-bottom: 16px !important;
        line-height: 1.15 !important;
        letter-spacing: -0.02em !important;
        text-align: left !important;
        padding-left: 0 !important;
    }

    .hero-subtitle,
    .hero-subtitle-text {
        font-size: 14px !important;
        margin-bottom: 32px !important;
        line-height: 1.6 !important;
        padding: 0 !important;
        letter-spacing: 1px !important;
        text-align: left !important;
        margin-left: 0 !important;
    }

    /* Hero container left alignment */
    .hero-content,
    #hero-text-content {
        text-align: left !important;
        align-items: flex-start !important;
        padding-left: 0 !important;
    }

    /* Hero badge left alignment */
    .hero-badge {
        margin-left: 0 !important;
    }

    /* Hero buttons left alignment */
    .hero-content .flex,
    #hero-text-content .flex,
    .mobile-hero-content .flex {
        padding-left: 0 !important;
        justify-content: flex-start !important;
    }
}

@media (max-width: 480px) {

    /* Even smaller padding on small phones */
    .mobile-hero-content .animate-fade-in,
    #dashboard-hero-bg .animate-fade-in {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .hero-title {
        font-size: clamp(18px, 6vw, 24px) !important;
        margin-bottom: 12px !important;
        text-align: left !important;
        padding-left: 0 !important;
    }

    .hero-subtitle,
    .hero-subtitle-text {
        font-size: 12px !important;
        margin-bottom: 20px !important;
        letter-spacing: 0.5px !important;
        text-align: left !important;
        padding-left: 0 !important;
    }
}

/* ============================================
   Mobile Header Responsive Styles
   Applied to both Light & Dark modes
   ============================================ */
@media (max-width: 768px) {

    /* Make header logo bigger on mobile */
    header img {
        height: 56px !important;
        max-height: 56px !important;
        min-height: 56px !important;
        width: auto !important;
    }

    /* Make header container shorter on mobile */
    header .px-4 {
        height: 60px !important;
        min-height: 60px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Make Login/Register buttons smaller on mobile */
    #ios-auth-buttons .btn-primary,
    #ios-register-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }

    #ios-auth-buttons #ios-login-btn {
        font-size: 12px !important;
        padding: 8px !important;
    }

    /* Make ios-auth-container more compact */
    #ios-auth-container {
        gap: 6px !important;
    }

    #ios-auth-buttons {
        gap: 6px !important;
    }

    /* Hide user name on mobile to prevent logo crowding */
    #ios-user-name-display,
    #mobile-user-name-display {
        display: none !important;
    }
}

/* Tablet screen adjustments (up to 1200px) */
@media (max-width: 1200px) {

    /* Hide user names on tablet screens */
    #ios-user-name-display,
    #mobile-user-name-display {
        display: none !important;
    }

    /* Align premium badge to the left like mobile */
    .hero-badge {
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    /* Hero section left alignment for tablet */
    #dashboard-hero .hero-badge,
    [id*="hero"] .hero-badge {
        text-align: left !important;
        align-self: flex-start !important;
    }

    /* Align Hero Title and Subtitle to left on tablet */
    #dashboard-hero h1,
    [id*="hero"] h1,
    [id*="hero"] p,
    [id*="hero"] .flex-col {
        text-align: left !important;
        align-items: flex-start !important;
        margin-left: 0 !important;
    }

    /* Ensure the container itself allows left alignment */
    [id*="hero"]>div {
        align-items: flex-start !important;
        text-align: left !important;
    }

    /* Override the large left padding from Tailwind 'md:pl-[calc(5%+96px)]' */
    .hero-content-wrapper,
    .mobile-hero-content,
    [class*="hero-content"] {
        padding-left: 24px !important;
    }

    /* 1. Header Alignment: Match Hero Text (24px padding) */
    header>div[style*="padding-left"],
    header .px-4.md\:px-16 {
        padding-left: 24px !important;
    }

    /* 2. Sample Lectures Responsiveness: Flexible cards */
    .sample-lecture-card {
        flex: 0 0 calc(50% - 12px) !important;
        /* 2 cards per row */
        min-width: 0 !important;
        /* Allow shrinking if needed */
        max-width: none !important;
        width: auto !important;
    }

    /* Adjust card content */
    .sample-lecture-card img {
        height: 180px !important;
        /* Slightly smaller image */
    }

    /* 
       3. Match Mobile Hero Styles on Tablet 
       User request: "copy the code of my mobile display hero section"
    */
    .hero-title {
        font-size: clamp(24px, 5vw, 32px) !important;
        margin-bottom: 16px !important;
        text-align: left !important;
        padding-left: 0 !important;
        line-height: 1.2 !important;
    }

    .hero-subtitle,
    .hero-subtitle-text {
        display: block !important;
        font-size: 14px !important;
        margin-bottom: 24px !important;
        letter-spacing: 1px !important;
        text-align: left !important;
        padding-left: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        color: inherit !important;
    }

    /* Ensure hero content wrapper doesn't have restrictive height */
    .hero-content-wrapper,
    .mobile-hero-content {
        height: auto !important;
        min-height: auto !important;
        justify-content: flex-start !important;
        padding-top: 40px !important;
        /* Move it down a bit from header */
    }
}