:root {
    --primary-color: #020617;
    --secondary-color: #0b1020;
    --accent-color: #111827;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --bs-primary: #020617;
    --bs-primary-rgb: 2, 6, 23;
    --bs-link-color: #020617;
    --bs-link-color-rgb: 2, 6, 23;
    --bs-link-hover-color: #111827;
    --bs-link-hover-color-rgb: 17, 24, 39;

    /* Centralized color tokens */
    --color-primary: var(--primary-color);
    --color-primary-dark: var(--secondary-color);
    --color-primary-accent: var(--accent-color);
    --color-primary-bootstrap: #111827;
    --color-primary-bootstrap-dark: #020617;
    --color-success: #198754;
    --color-success-bright: #20c997;
    --color-warning: #ffc107;
    --color-warning-bg: #fff3cd;
    --color-warning-hover: #ffca2c;
    --color-danger: #dc3545;
    --color-info: #334155;
    --color-primary-soft: #e5e7eb;
    --color-primary-soft-strong: #d1d5db;
    --color-primary-text: #020617;
    --color-purple: #6f42c1;
    --color-pink: #e83e8c;
    --color-orange: #fd7e14;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-ink: #1a1a1a;
    --color-text-dark: #212529;
    --color-text-muted: #6c757d;
    --color-text-secondary: #495057;
    --color-border: #dee2e6;
    --color-border-muted: #e9ecef;
    --color-border-light: #e2e8f0;
    --color-surface: #ffffff;
    --color-surface-subtle: #f8f9fa;
    --color-surface-soft: #f8fafc;
    --color-dark-navy: #020617;
    --color-dark-blue: #0b1020;
    --color-deep-blue: #111827;
    --color-slate: #64748b;
    --color-slate-light: #f1f5f9;
    --color-gold: #C8922A;
    --color-gold-mid: #B8821A;
    --color-gold-dark: #9A6A10;
    --color-gold-light: #D8A63A;
    --color-gold-hover-mid: #C89830;
    --color-gold-hover-dark: #B88820;
    --color-purple-start: #111827;
    --color-purple-end: #020617;
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-moon-horizontal: linear-gradient(90deg, #020617 0%, #0b1020 100%);
    --gradient-moon-diagonal: linear-gradient(135deg, #020617 0%, #0b1020 100%);
    --gradient-purple: linear-gradient(135deg, var(--color-purple-start) 0%, var(--color-purple-end) 100%);
    --gradient-purple-reverse: linear-gradient(135deg, var(--color-purple-end) 0%, var(--color-purple-start) 100%);
    --gradient-gold: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-mid) 50%, var(--color-gold-dark) 100%);
    --gradient-gold-hover: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold-hover-mid) 50%, var(--color-gold-hover-dark) 100%);
    --gradient-admin-login-bg: linear-gradient(135deg, var(--color-dark-navy) 0%, var(--color-dark-blue) 50%, var(--color-deep-blue) 100%);
    --gradient-admin-sidebar: linear-gradient(180deg, var(--color-surface-subtle) 0%, var(--color-surface) 100%);
    --gradient-admin-active: linear-gradient(135deg, var(--color-primary-bootstrap) 0%, var(--color-primary-bootstrap-dark) 100%);
    --gradient-back-to-top-dark: linear-gradient(135deg, #020617 0%, #111827 100%);
    --gradient-back-to-top-dark-hover: linear-gradient(135deg, #111827 0%, #020617 100%);
    --shadow-soft: rgba(0, 0, 0, 0.1);
    --shadow-subtle: rgba(0, 0, 0, 0.05);
    --shadow-button: rgba(0, 0, 0, 0.2);
    --shadow-checkmark: rgba(0, 0, 0, 0.15);
    --shadow-medium: rgba(0, 0, 0, 0.3);
    --shadow-purple: rgba(2, 6, 23, 0.35);
    --shadow-purple-strong: rgba(2, 6, 23, 0.5);
    --shadow-primary: rgba(2, 6, 23, 0.3);
    --shadow-warning: rgba(255, 193, 7, 0.4);
    --shadow-blue: rgba(2, 6, 23, 0.4);
    --shadow-blue-strong: rgba(2, 6, 23, 0.5);
    --shadow-gold: rgba(184, 130, 26, 0.4);
    --shadow-gold-strong: rgba(184, 130, 26, 0.5);
    --overlay-white-light: rgba(255, 255, 255, 0.1);
    --overlay-white-card: rgba(255, 255, 255, 0.95);
    --overlay-white-muted: rgba(255, 255, 255, 0.6);
    --overlay-primary-soft: rgba(2, 6, 23, 0.08);
    --overlay-primary-line: rgba(2, 6, 23, 0.18);
    --overlay-primary-focus: rgba(2, 6, 23, 0.25);
    --overlay-primary-active: rgba(2, 6, 23, 0.35);
    --overlay-purple-soft: rgba(2, 6, 23, 0.08);
    --overlay-danger-soft: rgba(220, 53, 69, 0.1);
    --message-active-bg: #e5e7eb;
    --message-active-border: #111827;
    --message-area-bg: #f5f5f5;
    --message-sent-bg: #111827;
    --message-original-bg: var(--color-border-muted);
    --livestream-border: #fecdd3;
    --livestream-bg: #fff5f6;
    --livestream-text: #be123c;
    --livestream-badge: #e11d48;
    --livestream-title: #1f2937;
    --livestream-muted: #64748b;
    --livestream-shadow: rgba(190, 18, 60, 0.08);
    --livestream-badge-shadow: rgba(225, 29, 72, 0.18);
    --livestream-badge-shadow-strong: rgba(225, 29, 72, 0.24);
    --livestream-dark-border: #7f1d1d;
    --livestream-dark-bg: #1f1518;
    --livestream-dark-text: #fca5a5;
    --livestream-dark-title: #f9fafb;
    --livestream-dark-muted: #cbd5e1;
    --livestream-dark-countdown: #fecaca;
    --livestream-dark-countdown-bg: #111827;
    --livestream-dark-shadow: rgba(0, 0, 0, 0.32);
    --livestream-dark-strong-shadow: rgba(0, 0, 0, 0.34);

    /* Educational Typography System (Phase 3) */
    --font-base: clamp(16px, 1.2vw, 18px);

    --h1: clamp(26px, 3.2vw, 46px);
    --h2: clamp(22px, 2.6vw, 34px);
    --h3: clamp(19px, 2.1vw, 26px);
    --h4: clamp(17px, 1.7vw, 21px);
    --h5: clamp(16px, 1.4vw, 19px);
    --h6: clamp(14px, 1.2vw, 16px);

    --ui: clamp(13px, 1vw, 14px);
    --small: clamp(12px, 0.9vw, 13px);
}

body {
    font-family: 'Alexandria', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    font-size: var(--font-base);
    line-height: 1.8;
}

h1 {
    font-size: var(--h1);
    line-height: 1.15;
}

h2 {
    font-size: var(--h2);
    line-height: 1.2;
}

h3 {
    font-size: var(--h3);
    line-height: 1.25;
}

h4 {
    font-size: var(--h4);
    line-height: 1.3;
}

h5 {
    font-size: var(--h5);
    line-height: 1.35;
}

h6 {
    font-size: var(--h6);
    line-height: 1.4;
}

.navbar,
.sidebar,
.breadcrumb,
.meta,
.badge,
.form-text {
    font-size: var(--ui);
}

small,
.small,
.text-muted {
    font-size: var(--small);
}

.navbar-dark.bg-primary {
    background-color: var(--primary-color) !important;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

footer.bg-dark {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.btn-primary {
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-bg: var(--secondary-color);
    --bs-btn-hover-border-color: var(--secondary-color);
    --bs-btn-active-bg: var(--secondary-color);
    --bs-btn-active-border-color: var(--secondary-color);
    --bs-btn-disabled-bg: var(--primary-color);
    --bs-btn-disabled-border-color: var(--primary-color);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary {
    --bs-btn-color: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-bg: var(--primary-color);
    --bs-btn-hover-border-color: var(--primary-color);
    --bs-btn-active-bg: var(--primary-color);
    --bs-btn-active-border-color: var(--primary-color);
    --bs-btn-disabled-color: var(--primary-color);
    --bs-btn-disabled-border-color: var(--primary-color);
}

.list-group-item.active,
.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--color-white) !important;
}

.nav-pills .nav-link {
    color: var(--primary-color);
}

.nav-pills .nav-link:hover,
.nav-pills .nav-link:focus {
    color: var(--secondary-color);
    background-color: var(--overlay-primary-soft);
}

.navbar {
    position: relative;
    z-index: 2050;
}

/* Navbar Text Enhancement */
.navbar-dark .navbar-brand {
    color: var(--color-white) !important;
    font-weight: 500;
    font-size: 1.3rem;
}

.navbar-dark .nav-link {
    color: var(--color-white) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px var(--shadow-soft);
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus {
    color: var(--color-white) !important;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

.navbar-dark .nav-link.active {
    color: var(--color-white) !important;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.navbar-dark .dropdown-toggle::after {
    opacity: 0.8;
}

.navbar .dropdown-menu {
    z-index: 2060;
    margin-top: 0.6rem;
}

/* ===================================
   UNIFIED CARD STYLES
   =================================== */
.card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.card:hover {
    /* Hover effect disabled */
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.card-footer {
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

.card-title {
    font-weight: 500;
    color: var(--color-dark-navy);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.card-text {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Course Card Specific Styles */
.course-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.course-thumbnail-link,
.course-detail-thumbnail {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--color-primary-soft) 0%, var(--color-primary-soft-strong) 100%);
}

.course-thumbnail-img,
.course-detail-thumbnail img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.course-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 2.5rem;
}

.course-thumbnail-preview {
    width: 240px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.admin-course-thumbnail {
    width: 96px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.admin-course-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-soft);
    color: var(--primary-color);
}

.course-badges {
    padding: 6px 4px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.course-body {
    padding: 14px 4px 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.course-title {
    font-weight: 500;
    color: var(--color-dark-navy);
    margin-bottom: 14px;
    font-size: 1.15rem;
    line-height: 1.4;
}

.course-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    margin-top: auto;
}

.meta-item {
    color: #868e96;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item i {
    color: var(--primary-color);
}

.course-card .meta-item {
    padding: 0;
    border-radius: 7px;
    background: transparent !important;
    font-size: 0.78rem;
    font-weight: 500;
}

.course-card .meta-item i {
    color: inherit;
}

.badge-level-beginner,
.meta-level-beginner {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.course-card .meta-level-beginner {
    color: #047857;
}

.badge-level-intermediate,
.meta-level-intermediate {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.course-card .meta-level-intermediate {
    color: #b45309;
}

.badge-level-intermediate {
    color: #111827 !important;
}

.badge-level-advanced,
.meta-level-advanced {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.course-card .meta-level-advanced {
    color: #dc2626;
}

.badge-category,
.meta-category {
    background: var(--gradient-primary);
}

.course-card .meta-category {
    color: var(--primary-color);
}

.badge-free,
.badge-access-free,
.badge-membership-free {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.badge-premium,
.badge-access-paid,
.badge-membership-paid {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000 !important;
}

.badge-status-active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.badge-status-inactive {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.badge-count {
    background: linear-gradient(135deg, var(--color-primary-soft) 0%, var(--color-primary-soft-strong) 100%);
    color: var(--color-primary-text) !important;
    border: 1px solid var(--color-primary-soft-strong);
}

.membership-expiry {
    font-size: 0.75rem;
    margin-top: 2px;
}

.badge-category,
.badge-free,
.badge-premium,
.badge-access-free,
.badge-access-paid,
.badge-membership-free,
.badge-membership-paid,
.badge-level-beginner,
.badge-level-intermediate,
.badge-level-advanced,
.badge-count,
.badge-status-active,
.badge-status-inactive {
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.course-detail-badge {
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.course-detail-title {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.25;
}

.course-stats {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.course-stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    min-height: 80px;
    gap: 3px;
}

.course-stat-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--color-primary-soft);
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.course-stat-item:hover .course-stat-icon {
    background: var(--primary-color);
    color: var(--color-white);
}

.course-stat-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    text-align: center;
    line-height: 1.3;
}

.course-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
}

.course-stat-divider {
    width: 1px;
    min-height: 50px;
    align-self: center;
    background: rgba(15, 23, 42, 0.07);
}

@media (max-width: 576px) {
    .course-detail-title {
        font-size: 1.45rem;
        line-height: 1.35;
    }

    .course-stats {
        flex-wrap: wrap;
        border-radius: 14px;
    }

    .course-stat-item {
        flex-basis: calc(50% - 1px);
        min-height: 70px;
        padding: 12px 8px;
    }

    .course-stat-divider:nth-child(2) {
        display: none;
    }

    .course-stat-divider:nth-child(4) {
        display: none;
    }
}

.course-footer {
    padding: 8px 4px 0;
    margin-top: auto;
}

.course-footer .btn {
    border-radius: 10px;
    padding: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lesson-list-row {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) max-content;
    align-items: center !important;
    gap: 14px;
    min-height: 44px;
}

.lesson-title-wrap {
    align-self: center;
    min-width: 0;
    text-align: right;
}

.lesson-list-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    line-height: 1.45;
    font-size: 1rem;
    font-weight: 500;
}

.lesson-list-title span:last-child {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.lesson-title-link {
    min-width: 0;
    max-width: 100%;
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.lesson-title-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.lesson-number {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    align-self: center;
    padding: 0;
    border-radius: 8px;
    font-weight: 800;
}

.lesson-actions {
    align-self: center;
    justify-self: center;
    margin-inline-start: 0 !important;
}

.lesson-complete-toggle {
    cursor: pointer;
    white-space: nowrap;
}

.lesson-action-btn {
    min-width: 80px;
    white-space: nowrap;
}

.lesson-no-video-btn {
    white-space: nowrap;
}

.lesson-lock-btn {
    min-width: 36px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

@media (max-width: 576px) {
    .lesson-list-row {
        grid-template-columns: 34px minmax(0, 1fr) max-content;
        gap: 8px !important;
    }

    .lesson-list-title {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .lesson-number {
        width: 26px;
        height: 26px;
        border-radius: 7px;
    }

    .lesson-actions {
        justify-content: center;
    }
}

.course-footer .btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px var(--shadow-primary);
}

/* Stats Cards */
.stats-badge {
    padding: 15px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    min-width: 200px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.stats-badge:hover {
    transform: scale(1.05);
}

.stats-total {
    background: var(--overlay-primary-soft);
    color: var(--primary-color);
    border: 1px solid var(--shadow-primary);
}

.stats-free {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.stats-premium {
    background: rgba(255, 193, 7, 0.9);
    color: #000;
}

/* Form Controls Enhancement */
.form-control-lg,
.form-select-lg {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control-lg:focus,
.form-select-lg:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--overlay-primary-soft);
}

/* Filters Section */
.filters-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

/* No Results */
.no-results-icon {
    opacity: 0.5;
}

.btn.filter-action-btn {
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 1rem;
    line-height: 1.5;
}

/* ===================================
   UNIFIED HERO SECTIONS
   =================================== */
.hero-section,
.courses-hero-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    padding: 80px 0;
    color: var(--dark-text);
    position: relative;
    overflow: hidden;
}

.hero-section::before,
.courses-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-section h1,
.courses-hero-section h1 {
    color: var(--primary-color);
    text-shadow: none;
    position: relative;
    font-weight: 500;
}

.hero-section .lead,
.courses-hero-section .lead {
    color: #6c757d !important;
    position: relative;
}

.hero-section .btn-light,
.hero-section .btn-primary {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    border: none;
    transition: all 0.3s ease;
}

.hero-section .btn-light:hover,
.hero-section .btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-primary);
}

.hero-section .btn-outline-light,
.hero-section .btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    font-weight: 500;
    transition: all 0.3s ease;
}

.hero-section .btn-outline-light:hover,
.hero-section .btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.hero-buttons {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-thumbnail {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 4px solid rgba(255, 255, 255, 0.8);
}

/* Responsive Hero */
@media (max-width: 768px) {

    .hero-section,
    .courses-hero-section {
        padding: 50px 0;
    }

    .hero-section h1,
    .courses-hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-buttons .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .hero-thumbnail {
        width: 160px;
        height: 160px;
    }
}

.section-title {
    font-weight: 500;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.suggested-courses-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 0 14px;
    position: relative;
    text-align: right;
}

.suggested-courses-heading::after {
    content: '';
    position: absolute;
    inset-inline-end: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--overlay-primary-line), var(--primary-color));
}

.suggested-courses-heading__icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: #ffffff;
    background: var(--gradient-primary);
    flex: 0 0 46px;
    font-size: 1.2rem;
}

.suggested-courses-heading h2 {
    color: var(--primary-color);
}

.suggested-courses-heading span {
    display: block;
    color: #64748b;
    font-size: 0.85rem;
}

.login-card {
    max-width: 450px;
    margin: 50px auto;
    padding: 2rem;
}

.dashboard-stats .card {
    border-right: 5px solid var(--primary-color);
    border-left: none;
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
}

@media (max-width: 576px) {
    .dashboard-stats {
        margin-bottom: 2rem !important;
    }

    .dashboard-stats .card {
        min-height: 120px;
    }

    .dashboard-stats h5 {
        font-size: 0.78rem;
        line-height: 1.35;
        margin-bottom: 0.5rem;
    }

    .dashboard-stats h2 {
        font-size: 1.45rem;
        margin-bottom: 0;
    }

    .dashboard-stats .card i {
        font-size: 2rem;
        margin: 0.75rem !important;
    }
}

/* Lesson Accordion */
.accordion-item {
    border: none !important;
    margin-bottom: 1rem;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.accordion-button {
    border-radius: 12px !important;
    font-weight: 500;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background-color: #f8f9fa;
    color: var(--primary-color);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, .125);
}

.accordion-body {
    padding: 1.5rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Note Item Styles */
.note-item {
    transition: all 0.3s ease;
    border-right: 3px solid #ffc107;
}

.note-item:hover {
    background-color: #fff3cd !important;
}

/* ===================================
   LESSON SIDEBAR ICONS ENHANCEMENT
   =================================== */
/* Default lesson icon (not started) */
.list-group-item .fa-circle {
    color: #cbd5e1 !important;
    font-size: 0.65rem;
    transition: all 0.3s ease;
}

.list-group-item:hover .fa-circle {
    color: var(--primary-color) !important;
    transform: scale(1.2);
}

/* Playing lesson icon */
.list-group-item.active .fa-play-circle {
    color: #fbbf24 !important;
    animation: pulse-play 2s ease-in-out infinite;
    font-size: 0.85rem;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

@keyframes pulse-play {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* Completed lesson icon */
.list-group-item .fa-check-circle.text-success {
    color: #10b981 !important;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
}

.list-group-item:hover .fa-check-circle.text-success {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 3px 8px rgba(16, 185, 129, 0.5));
}

/* Mobile offcanvas icons */
.offcanvas .fa-circle {
    color: #cbd5e1 !important;
    font-size: 0.65rem;
    transition: all 0.3s ease;
}

.offcanvas .list-group-item:hover .fa-circle {
    color: var(--primary-color) !important;
    transform: scale(1.2);
}

.offcanvas .list-group-item.active .fa-play-circle {
    color: #fbbf24 !important;
    animation: pulse-play 2s ease-in-out infinite;
    font-size: 0.85rem;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

.offcanvas .fa-check-circle.text-success {
    color: #10b981 !important;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
}

.offcanvas .list-group-item:hover .fa-check-circle.text-success {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 3px 8px rgba(16, 185, 129, 0.5));
}

@media (max-width: 768px) {
    .container.py-4 {
        padding-top: 0.5rem !important;
    }
}

/* Admin Sidebar Responsive Height */
.admin-sidebar {
    min-height: auto;
}

@media (min-width: 768px) {
    .admin-sidebar {
        min-height: calc(100vh - 56px);
    }
}

/* ===================================
   COURSE PROGRESS BAR STYLES
   =================================== */
.course-progress .progress {
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.course-progress .progress-bar.bg-warning {
    background: #fb912b !important;
}

.course-progress .progress-bar.bg-success {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%) !important;
}

.course-progress .text-warning {
    color: #fb912b !important;
}

/* ===================================
   PAGINATION STYLES - LIGHT MODE
   =================================== */
.pagination {
    gap: 4px;
}

.pagination .page-item .page-link {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    color: var(--primary-color);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.pagination .page-item .page-link:hover {
    background-color: var(--primary-color, #020617);
    border-color: var(--primary-color, #020617);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-primary);
}

.pagination .page-item .page-link:focus {
    box-shadow: 0 0 0 0.25rem var(--overlay-primary-focus);
    outline: none;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color, #020617);
    border-color: var(--primary-color, #020617);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--overlay-primary-active);
}

.pagination .page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Responsive pagination */
@media (max-width: 576px) {
    .pagination .page-link {
        padding: 0.4rem 0.65rem;
        font-size: 0.85rem;
        min-width: 36px;
    }

    .pagination-lg {
        font-size: 1rem;
    }
}

/* ===================================
   LESSON PAGE RESPONSIVE TABS
   =================================== */
@media (max-width: 767.98px) {

    /* Grid Layout for stacking */
    .lesson-tabs-section .nav-tabs {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        border-bottom: 0 !important;
        padding: 0.25rem;
    }

    /* Reset individual items */
    .lesson-tabs-section .nav-tabs .nav-item {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Card-like styling for links */
    .lesson-tabs-section .nav-tabs .nav-link {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 0.75rem 1rem;
        background-color: #fff;
        border: 1px solid #e9ecef !important;
        border-radius: 0.5rem !important;
        color: #495057;
        font-weight: 500;
        text-align: right;
        /* Adjust based on direction (RTL) */
        transition: all 0.2s ease-in-out;
    }

    /* Active styling */
    .lesson-tabs-section .nav-tabs .nav-link.active {
        background-color: #f8f9fa !important;
        border: 1px solid var(--primary-color) !important;
        border-right: 5px solid var(--primary-color) !important;
        color: var(--primary-color) !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        font-weight: 500;
    }

    /* Badge alignment (Push to left) */
    .lesson-tabs-section .nav-tabs .nav-link .badge {
        margin-right: auto !important;
        margin-left: 0 !important;
    }

    /* Icon spacing */
    .lesson-tabs-section .nav-tabs .nav-link i {
        margin-left: 0.75rem !important;
        width: 1.25rem;
        text-align: center;
    }
}

/* Phase 5: Mobile Spacing (Mandatory) */
@media (max-width: 576px) {

    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .row {
        --bs-gutter-x: 0.75rem;
    }

    .card {
        padding: 0.75rem !important;
    }

    section {
        margin-bottom: 1.25rem;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive > .table {
        min-width: 720px;
        margin-bottom: 0;
    }

    .table-responsive > .table th,
    .table-responsive > .table td {
        white-space: nowrap;
    }
}

/* ===================================
   DESKTOP TYPOGRAPHY ENHANCEMENTS
   For larger screens (desktop and tablets)
   =================================== */
@media (min-width: 769px) {

    /* Better line heights for desktop reading */
    body {
        line-height: 1.7;
    }

    h1,
    .h1 {
        line-height: 1.25;
    }

    h2,
    .h2 {
        line-height: 1.3;
    }

    h3,
    .h3 {
        line-height: 1.35;
    }

    p {
        line-height: 1.75;
        margin-bottom: 1.25rem;
    }

    .lead {
        font-size: 1.2rem;
        line-height: 1.8;
    }
}

/* ===================================
   LARGE DESKTOP TYPOGRAPHY
   For screens 1200px and above
   =================================== */
@media (min-width: 1200px) {

    /* Slightly larger base font for large screens */
    body {
        font-size: 17px;
    }

    h1,
    .h1 {
        font-size: 2.75rem;
    }

    h2,
    .h2 {
        font-size: 2.25rem;
    }

    h3,
    .h3 {
        font-size: 1.85rem;
    }

    .card-title,
    .course-title {
        font-size: 1.2rem;
    }

    .card-text,
    .course-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .lead {
        font-size: 1.3rem;
    }
}

/* ============================================
   PRICING PAGE STYLES
   ============================================ */

/* Pricing Description Color */
.text-pricing-desc {
    color: var(--primary-color);
}

[data-bs-theme="dark"] .text-pricing-desc {
    color: #fd7e14;
    /* Bootstrap orange */
}

/* Best Value Badge - Keep same yellow color in both light and dark modes */
.bg-warning.text-dark {
    background-color: #ffc107 !important;
    color: #000 !important;
}

[data-bs-theme="dark"] .bg-warning.text-dark,
[data-bs-theme="dark"] .position-absolute.bg-warning.text-dark {
    background-color: #ffc107 !important;
    color: #000 !important;
    --bs-bg-opacity: 1;
}

/* ============================================
   STICKY NAVBAR STYLES
   ============================================ */

/* Make top bar sticky along with navbar */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 2060;
    transition: all 0.3s ease;
}

/* Gold Warning Button */
.btn-warning {
    background-color: #C8922A !important;
    border-color: #C8922A !important;
    color: #000 !important;
}
.btn-warning:hover,
.btn-warning:focus {
    background-color: #B8821A !important;
    border-color: #B8821A !important;
    color: #000 !important;
}

/* Sticky navbar enhancements */
.navbar.sticky-top {
    position: sticky;
    top: 40px;
    z-index: 2050;
    transition: all 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Enhanced shadow when scrolling */
.navbar.sticky-top.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Dark mode sticky navbar */
[data-bs-theme="dark"] .navbar.sticky-top {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .navbar.sticky-top.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Mobile adjustments */
@media (max-width: 991.98px) {
    .navbar.sticky-top {
        top: 40px;
        /* Adjust for mobile top bar height */
    }

    /* Fixed: Added spacing between logo row and collapsible menu */
    .navbar-collapse {
        margin-top: 15px;
        padding-bottom: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 15px;
    }

    .nav-item .nav-link {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}

@media (max-width: 768px) {
    .navbar.sticky-top {
        top: 40px;
    }
}
