/* ==========================================================================
   Webcross Academy Theme & Style for CloudLearn LXP
   Matched directly from C:\inetpub\wwwroot\webcross.co.uk\academy
   ========================================================================== */

:root, html.light, body.light, body.light-theme {
    /* Webcross Academy Color Tokens - Light Mode Default */
    --bg-base: #f7f9fb;
    --bg-surface: #ffffff;
    --bg-surface-low: #f1f5f9;
    --bg-surface-container: #eceef0;
    --bg-surface-high: #e6e8ea;
    --border-color: #cbd5e1;
    --border-highlight: #94a3b8;
    
    --text-primary: #0f172a;
    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    /* Webcross Brand Colors */
    --brand-primary: #0f172a;
    --brand-primary-container: #1e293b;
    --brand-secondary: #00687a;
    --brand-tertiary: #7c3aed;
    --brand-tertiary-container: #23005c;
    
    --accent-cyan: #00687a;
    --accent-cyan-light: #57dffe;
    --accent-purple: #7c3aed;
    --accent-purple-light: #e9ddff;
    --accent-success: #059669;
    --accent-warning: #d97706;
    --accent-danger: #ba1a1a;
    --accent-xp: #d97706;
    --accent-paid: #7c3aed;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --shadow-subtle: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 12px 30px rgba(15, 23, 42, 0.15);
    --shadow-glow: 0 8px 30px rgba(124, 58, 237, 0.2);

    --header-height: 72px;
    --footer-height: 72px;
    --sidebar-width: 320px;
    
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html.dark, body.dark, body.dark-theme {
    /* Webcross Academy Color Tokens - Dark Mode Override */
    --bg-base: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-low: #1f2937;
    --bg-surface-container: #1f2937;
    --bg-surface-high: #374151;
    --border-color: #374151;
    --border-highlight: #4b5563;
    
    --text-primary: #f8fafc;
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --brand-primary: #ffffff;
    --brand-primary-container: #1e293b;
    --brand-secondary: #38bdf8;
    --brand-tertiary: #a78bfa;
    --brand-tertiary-container: #4c1d95;

    --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 8px 30px rgba(167, 139, 250, 0.35);
}

/* Base Resets & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    height: auto;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
}

.view-container.hidden {
    display: none !important;
}

/* Webcross Utility Classes */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-subtle);
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.ai-gradient-border {
    position: relative;
}

.ai-gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(87, 223, 254, 0.5), rgba(148, 102, 255, 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.ai-tint {
    background-color: rgba(148, 102, 255, 0.03);
}

.ai-card-bg {
    background-color: rgba(233, 221, 255, 0.15);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-highlight);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   Header Bar - Webcross Academy Style
   ========================================================================== */
.top-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 50;
    position: sticky;
    top: 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
}

.logo-badge {
    background: var(--brand-primary);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
}

.logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.logo-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--brand-primary);
    letter-spacing: -0.02em;
}

.logo-sub {
    font-size: 12px;
    font-weight: 500;
    color: var(--brand-secondary);
    background: rgba(0, 104, 122, 0.08);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: 4px;
}

/* Navigation Switcher */
.header-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.view-nav-switcher {
    display: flex;
    align-items: center;
    background: var(--bg-surface-low);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.view-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.6);
}

.view-nav-btn.active {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.view-nav-btn svg, .view-nav-btn .material-symbols-outlined {
    font-size: 16px;
}

/* User Stats & Badges */
.user-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #b45309;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.stat-item.streak-item {
    background: rgba(148, 102, 255, 0.1);
    border-color: rgba(148, 102, 255, 0.2);
    color: var(--brand-tertiary);
}

.stat-icon {
    font-size: 16px;
}

.user-tier-badge {
    background: var(--brand-primary-container);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
}

/* Profile Dropdown */
.profile-dropdown-container {
    position: relative;
}

.profile-avatar-btn {
    background: var(--bg-surface-low);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-avatar-btn:hover {
    background: var(--border-color);
}

.profile-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 220px;
    background: #ffffff;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    padding: 8px 0;
    display: none;
    z-index: 99999;
}

html.dark .profile-dropdown-menu {
    background: #111827 !important;
    border-color: #374151 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.profile-dropdown-container:hover .profile-dropdown-menu,
.profile-dropdown-container:focus-within .profile-dropdown-menu,
.profile-dropdown-menu.show {
    display: block !important;
}

.profile-dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.profile-dropdown-menu a:hover {
    background: var(--bg-surface-low);
    color: var(--brand-secondary);
}

.profile-dropdown-menu .dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.profile-dropdown-menu .danger-link {
    color: var(--accent-danger);
}

/* ==========================================================================
   Hero Section - Webcross Academy Style
   ========================================================================== */
.hero-banner {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 48px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(148, 102, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.hero-banner-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-secondary);
    background: rgba(0, 104, 122, 0.08);
    border: 1px solid rgba(0, 104, 122, 0.2);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-heading {
    font-size: 42px;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.hero-subtext {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 28px auto;
    line-height: 1.6;
}

.hero-search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 8px 6px 20px;
    max-width: 640px;
    margin: 0 auto 24px auto;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-search-bar:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.hero-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-primary);
    padding-right: 12px;
}

.search-btn {
    background: var(--brand-primary);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.search-btn:hover {
    transform: translateY(-1px);
    background: #1e293b;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.cat-pill {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-pill:hover, .cat-pill.active {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Section Layout & Course Grids
   ========================================================================== */
.section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
    width: 100%;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--brand-primary);
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Course Status Tabs */
.course-status-tabs {
    display: flex;
    background: var(--bg-surface-low);
    padding: 3px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.status-tab-btn {
    border: none;
    background: transparent;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.status-tab-btn.active {
    background: #ffffff;
    color: var(--brand-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Card Styling - Webcross Glass Card */
.path-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.path-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-highlight);
}

.path-card-image {
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 12px;
}

.card-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.card-badge.paid {
    background: var(--brand-tertiary);
    color: #ffffff;
}

.card-badge.free {
    background: var(--brand-secondary);
    color: #ffffff;
}

.path-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-category {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.3;
    margin-bottom: 8px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
    flex: 1;
}

.card-footer-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    border-top: 1px solid var(--bg-surface-low);
    padding-top: 12px;
}

/* Completed Actions */
.completed-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.completed-actions button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-surface-low);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.completed-actions button:hover {
    background: var(--border-color);
}

/* ==========================================================================
   Page Stages (Learning Path Detail, Course Detail, Module Overview)
   ========================================================================== */
.page-stage-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
    width: 100%;
}

.path-hero-header, .module-intro-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-card);
    margin-bottom: 32px;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

.course-header-banner {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-card);
    margin-bottom: 32px;
    position: relative;
}

.hero-type-pill {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-tertiary);
    background: rgba(148, 102, 255, 0.1);
    border: 1px solid rgba(148, 102, 255, 0.2);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.path-main-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--brand-primary);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.path-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.path-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.path-meta-item {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-surface-low);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.path-action-btns {
    display: flex;
    gap: 12px;
}

/* Primary CTA Buttons */
.primary-cta-btn {
    background: var(--brand-primary);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.primary-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.secondary-cta-btn {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-cta-btn:hover {
    background: var(--bg-surface-low);
}

/* Course Rows & Modules List */
.path-courses-list h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 16px;
}

.path-course-row {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.path-course-row:hover {
    border-color: var(--brand-secondary);
    box-shadow: var(--shadow-card);
    transform: translateX(4px);
}

.row-number {
    width: 40px;
    height: 40px;
    background: var(--brand-primary-container);
    color: #ffffff;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
}

.row-details {
    flex: 1;
}

.row-details h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.row-details p {
    font-size: 13px;
    color: var(--text-secondary);
}

.row-meta {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--brand-secondary);
    font-weight: 600;
}

.row-cta-btn {
    background: var(--bg-surface-low);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* Info Grid Tiles (Pre-learning) */
.info-grid-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.info-tile {
    background: var(--bg-surface-low);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
}

.info-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.info-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-primary);
}

/* Objectives Box */
.objectives-box {
    background: rgba(148, 102, 255, 0.05);
    border: 1px solid rgba(148, 102, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.objectives-box h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-tertiary);
    margin-bottom: 12px;
}

.bullet-list {
    list-style: none;
    space-y: 8px;
}

.bullet-list li {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bullet-icon {
    color: var(--brand-secondary);
    font-weight: 800;
}

/* ==========================================================================
   Interactive Player View - Full Layout
   ========================================================================== */
.player-layout {
    display: flex;
    height: calc(100vh - var(--header-height));
    width: 100vw;
    overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    height: auto;
    min-height: 100%;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-low);
}

.course-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    color: var(--brand-secondary);
    letter-spacing: 0.05em;
}

.course-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--brand-primary);
    margin-top: 4px;
}

.progress-bar-wrapper {
    margin-top: 14px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.progress-bar-track {
    height: 6px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-secondary) 0%, var(--brand-tertiary) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s;
}

.sidebar-search {
    margin-top: 12px;
}

.sidebar-search input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    outline: none;
}

.sidebar-nav {
    flex: 1;
    overflow: visible;
    padding: 12px;
}

/* Sidebar Topic Items */
.mod-tree-group {
    margin-bottom: 16px;
}

.mod-tree-header {
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 8px;
    letter-spacing: 0.05em;
}

.topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.15s;
}

.topic-item:hover {
    background: var(--bg-surface-low);
}

.topic-item.active {
    background: var(--brand-primary-container);
    color: #ffffff;
    font-weight: 700;
}

.topic-item.completed .topic-status-icon {
    color: var(--accent-success);
}

/* Stage Wrapper */
.stage-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-base);
    overflow: hidden;
}

.content-stage {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.stage-container {
    max-width: 900px;
    margin: 0 auto;
}

/* ==========================================================================
   Web Parts Styling (Rendered dynamically by app.js)
   ========================================================================== */
.webpart-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.webpart-hero {
    background: linear-gradient(135deg, var(--brand-primary-container) 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 24px;
}

.webpart-hero h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
}

.webpart-hero p {
    font-size: 15px;
    color: #cbd5e1;
}

.webpart-split-container {
    display: flex;
    gap: 24px;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
}

.split-text-side { flex: 1; }
.split-image-side {
    width: 280px;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-md);
}

/* Flip Cards Webpart */
.flipcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.flip-card {
    height: 140px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--border-color);
}

.flip-card-front {
    background: #ffffff;
    font-weight: 700;
    font-size: 14px;
    color: var(--brand-primary);
}

.flip-card-back {
    background: var(--brand-primary-container);
    color: #ffffff;
    transform: rotateY(180deg);
    font-size: 12px;
}

/* Checklist Items */
.checklist-container {
    margin-top: 16px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface-low);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checklist-item.checked {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Flow Footer */
.flow-footer {
    height: var(--footer-height);
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: relative;
}

.completion-toast {
    position: absolute;
    top: -48px;
    left: 32px;
    background: #10b981;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-hover);
}

.footer-flow-controls {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.nav-flow-btn {
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border-color, #cbd5e1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.nav-flow-btn.secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a !important;
}

.nav-flow-btn.secondary:hover {
    background-color: #f1f5f9 !important;
    border-color: #6366f1 !important;
    color: #4338ca !important;
}

.nav-flow-btn.large-continue {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    border: 1px solid #4338ca !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

.nav-flow-btn.large-continue * {
    color: #ffffff !important;
}

.nav-flow-btn.large-continue:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(67, 56, 202, 0.45) !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   Modals & Overlays - Webcross Glass Style
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none !important;
}

.notification-card, .modal-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-hover);
    position: relative;
    animation: modalPop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-modal-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-secondary);
    margin-bottom: 8px;
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.modal-subtitle, .notification-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
}

/* Pricing Options in Paywall Modal */
.pricing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.price-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--bg-surface-low);
}

.price-card.featured {
    border-color: var(--brand-tertiary);
    background: rgba(148, 102, 255, 0.05);
}

.price {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand-primary);
    margin: 8px 0;
}

.upgrade-cta-btn {
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    margin-top: 12px;
}

.upgrade-cta-btn.primary {
    background: var(--brand-primary);
    color: #ffffff;
}

.upgrade-cta-btn.secondary {
    background: #ffffff;
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   High Contrast & Readability Overrides (Light vs Dark Theme)
   ========================================================================== */
html.light, body.light {
    background-color: #f7f9fb !important;
    color: #0f172a !important;
}

html.light .glass-card,
html.light .path-card,
html.light .path-hero-header,
html.light .course-header-banner,
html.light .module-intro-card,
html.light .path-course-row,
html.light .webpart-card,
html.light .webpart-split-container,
html.light .sidebar,
html.light .modal-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08) !important;
}

html.light .card-title,
html.light .path-main-title,
html.light .section-title,
html.light .hero-heading,
html.light .course-title,
html.light h1, html.light h2, html.light h3, html.light h4 {
    color: #0f172a !important;
}

html.light .card-desc,
html.light .path-description,
html.light .section-subtitle,
html.light .hero-subtext,
html.light p {
    color: #334155 !important;
}

html.light .hero-search-bar {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
}

html.light .hero-search-bar input {
    color: #0f172a !important;
}

html.light .cat-pill {
    background: #ffffff !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

html.light .cat-pill.active {
    background: #0f172a !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
}

html.light .top-header {
    background: #ffffff !important;
    border-bottom-color: #cbd5e1 !important;
}

html.dark, body.dark {
    background-color: #0b0f19 !important;
    color: #f8fafc !important;
}

html.dark .glass-card,
html.dark .path-card,
html.dark .path-hero-header,
html.dark .course-header-banner,
html.dark .module-intro-card,
html.dark .path-course-row,
html.dark .webpart-card,
html.dark .webpart-split-container,
html.dark .sidebar,
html.dark .modal-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

html.dark .card-title,
html.dark .path-main-title,
html.dark .section-title,
html.dark .hero-heading,
html.dark .course-title,
html.dark h1, html.dark h2, html.dark h3, html.dark h4 {
    color: #f8fafc !important;
}

html.dark .card-desc,
html.dark .path-description,
html.dark .section-subtitle,
html.dark .hero-subtext,
html.dark p {
    color: #cbd5e1 !important;
}

html.dark .hero-search-bar {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

html.dark .hero-search-bar input {
    color: #f8fafc !important;
}

html.dark .top-header {
    background: #111827 !important;
    border-bottom-color: #374151 !important;
}

/* ==========================================================================
   COMPREHENSIVE LIGHT & DARK THEME CONTRAST FIXES
   ========================================================================== */

/* WebPart Hero - Light Theme Contrast */
html.light .webpart-hero, body.light .webpart-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%) !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05) !important;
}

html.light .webpart-hero h1,
html.light .webpart-hero h2,
html.light .webpart-hero h3,
html.light .webpart-hero .hero-title {
    color: #0f172a !important;
}

html.light .webpart-hero p,
html.light .webpart-hero .hero-summary {
    color: #334155 !important;
}

/* WebPart Hero - Dark Theme Contrast */
html.dark .webpart-hero, body.dark .webpart-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #111827 100%) !important;
    border: 1px solid #374151 !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

html.dark .webpart-hero h1,
html.dark .webpart-hero h2,
html.dark .webpart-hero h3,
html.dark .webpart-hero .hero-title {
    color: #f8fafc !important;
}

html.dark .webpart-hero p,
html.dark .webpart-hero .hero-summary {
    color: #cbd5e1 !important;
}

/* Glass Cards & Containers - Light Mode */
html.light .glass-card,
html.light .webpart-split-container,
html.light .webpart-video-container,
html.light .webpart-image-container,
html.light .webpart-checklist,
html.light .course-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

html.light .glass-card h1, html.light .glass-card h2, html.light .glass-card h3, html.light .glass-card h4, html.light .glass-card strong {
    color: #0f172a !important;
}

html.light .glass-card p, html.light .glass-card label, html.light .glass-card td {
    color: #334155 !important;
}

/* Glass Cards & Containers - Dark Mode */
html.dark .glass-card,
html.dark .webpart-split-container,
html.dark .webpart-video-container,
html.dark .webpart-image-container,
html.dark .webpart-checklist,
html.dark .course-card {
    background: #111827 !important;
    border-color: #374151 !important;
    color: #f8fafc !important;
}

html.dark .glass-card h1, html.dark .glass-card h2, html.dark .glass-card h3, html.dark .glass-card h4, html.dark .glass-card strong {
    color: #f8fafc !important;
}

html.dark .glass-card p, html.dark .glass-card label, html.dark .glass-card td {
    color: #cbd5e1 !important;
}

/* Input & Form Elements - Light & Dark Modes */
html.light input:not([type="checkbox"]):not([type="radio"]),
html.light select,
html.light textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html.dark input:not([type="checkbox"]):not([type="radio"]),
html.dark select,
html.dark textarea {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #374151 !important;
}

/* Interactive Player Sidebar - Light & Dark Modes */
html.light .sidebar,
html.light .player-sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #cbd5e1 !important;
}

html.light .sidebar-header {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html.light .course-title,
html.light .sidebar-course-title {
    color: #0f172a !important;
}

html.light .module-section-header {
    color: #4338ca !important;
}

html.light .topic-item,
html.light .sidebar-topic-item {
    color: #1e293b !important;
    font-weight: 600 !important;
}

html.light .topic-item:hover,
html.light .sidebar-topic-item:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

html.light .topic-item.active,
html.light .sidebar-topic-item.active {
    background-color: #e0e7ff !important;
    color: #4338ca !important;
    border-color: #c7d2fe !important;
    font-weight: 800 !important;
}

html.dark .sidebar,
html.dark .player-sidebar {
    background-color: #111827 !important;
    border-right: 1px solid #374151 !important;
}

html.dark .sidebar-header {
    background-color: rgba(15, 23, 42, 0.6) !important;
}

html.dark .course-title,
html.dark .sidebar-course-title {
    color: #f8fafc !important;
}

html.dark .module-section-header {
    color: #a5b4fc !important;
}

html.dark .topic-item,
html.dark .sidebar-topic-item {
    color: #cbd5e1 !important;
}

html.dark .topic-item:hover,
html.dark .sidebar-topic-item:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #f8fafc !important;
}

html.dark .topic-item.active,
html.dark .sidebar-topic-item.active {
    background-color: rgba(99, 102, 241, 0.25) !important;
    color: #818cf8 !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

/* Flipcards Contrast */
html.light .flip-card-front {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html.light .flip-card-back {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #7c3aed !important;
}

html.dark .flip-card-front {
    background: #1f2937 !important;
    color: #f8fafc !important;
    border-color: #374151 !important;
}

html.dark .flip-card-back {
    background: #312e81 !important;
    color: #f8fafc !important;
    border-color: #7c3aed !important;
}

/* ==========================================================================
   IMAGE LIGHTBOX MODAL & SPLIT IMAGE UNCROPPED VIEW & BUTTON TEXT WRAPPING
   ========================================================================== */
#image-lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#image-lightbox-modal.hidden {
    display: none !important;
}

.lightbox-content-card {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
    animation: lightboxPop 0.25s ease-out;
}

@keyframes lightboxPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-close-btn {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 10;
}

.lightbox-close-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

#lightbox-img {
    max-width: 88vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-caption-bar {
    margin-top: 12px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* Split Image Side Uncropped & Interactive */
.split-image-side {
    position: relative;
    min-height: 280px;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-color: var(--bg-surface-low, #f8fafc);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

html.dark .split-image-side {
    background-color: rgba(15, 23, 42, 0.6);
}

.split-image-side:hover {
    transform: scale(1.015);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.split-image-side::after {
    content: "🔍 Click to Enlarge";
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    opacity: 0.9;
    transition: opacity 0.2s, background 0.2s;
}

.split-image-side:hover::after {
    opacity: 1;
    background: #4338ca;
}

/* Flow Footer Container & Controls */
.flow-footer {
    min-height: 80px !important;
    height: auto !important;
    padding: 12px 24px !important;
    overflow: visible !important;
}

.footer-flow-controls {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
    max-width: 80% !important;
}

/* Button Text Group Wrapping */
.nav-flow-btn.large-continue {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    border: 1px solid #4338ca !important;
    color: #ffffff !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
    height: auto !important;
    min-height: 48px !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.nav-btn-text-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    line-height: 1.25 !important;
    width: 100% !important;
    pointer-events: none !important;
}

.nav-btn-label {
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    opacity: 0.9 !important;
    color: #ffffff !important;
    display: block !important;
    margin-bottom: 2px !important;
    line-height: 1.1 !important;
}

.nav-btn-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    display: block !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
}


