/* ==========================================================================
   Kelas Dahsyat Calm Modern Design System — Frontend & Storefront
   Restrained Neutral Surfaces • Single Sapphire Accent • Airy Mobile-First UI
   ========================================================================== */

:root {
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --brand-accent: #2563eb;
    --brand-accent-hover: #1d4ed8;

    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.92);
    --border-subtle: #e2e8f0;
    --border-strong: rgba(37, 99, 235, 0.35);
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-subtle: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 4px 14px -4px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 12px 28px -8px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.04);
}

[data-bs-theme="dark"] {
    color-scheme: dark;
    --bg-canvas: #0b0f17;
    --bg-surface: #111827;
    --bg-subtle: #1e293b;
    --bg-glass: rgba(17, 24, 39, 0.92);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(96, 165, 250, 0.38);
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --bs-body-bg: #0b0f17;
    --bs-body-color: #f8fafc;
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: #94a3b8;
    --bs-tertiary-bg: #1e293b;
    --bs-border-color: rgba(255, 255, 255, 0.1);

    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 14px 30px rgba(0, 0, 0, 0.5);
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.62;
    overflow-x: clip;
}

:where(h1, h2, h3, h4, h5, h6), .navbar-brand {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.015em;
}

/* Dark & Light Contrast Safeguards */
.bg-dark, .modal-content.bg-dark {
    color: #f8fafc;
}
.bg-dark :where(h1, h2, h3, h4, h5, h6, .modal-title),
.modal-content.bg-dark .modal-title,
.bg-dark .text-dark,
.text-white {
    color: #ffffff !important;
}
.bg-dark .text-muted,
.bg-dark .text-secondary {
    color: rgba(226, 232, 240, 0.78) !important;
}
.btn-warning,
.btn-warning.text-dark,
.bg-warning:not(.bg-opacity-10):not(.bg-warning-subtle),
.bg-warning.text-dark:not(.bg-opacity-10):not(.bg-warning-subtle) {
    color: #111827 !important;
}
[data-bs-theme="dark"] .btn-outline-dark {
    color: var(--text-main) !important;
    border-color: var(--border-subtle) !important;
}
[data-bs-theme="dark"] .btn-outline-dark:hover {
    background-color: var(--bg-subtle) !important;
    color: #ffffff !important;
}
[data-bs-theme="dark"] select.form-select,
[data-bs-theme="dark"] select.form-select option {
    background-color: var(--bg-surface);
    color: var(--text-main);
}

.font-mono {
    font-family: 'JetBrains Mono', monospace !important;
}

.tabular-nums,
.course-price,
.price-display,
.xp-counter,
.rating-num {
    font-variant-numeric: tabular-nums;
}

.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-dark:not(.btn-warning):not(.bg-warning) { color: var(--text-main) !important; }
.btn-warning.text-dark,
.bg-warning.text-dark { color: #111827 !important; }

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

/* Adaptive Brand Logo Helpers */
.brand-logo-dark { display: none !important; }
.brand-logo-light { display: inline-block !important; }
[data-bs-theme="dark"] .brand-logo-light { display: none !important; }
[data-bs-theme="dark"] .brand-logo-dark { display: inline-block !important; }

/* ==========================================================================
   Clean Sticky Top Navigation
   ========================================================================== */
.navbar-arch {
    min-height: 68px;
    background: var(--bg-glass) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.navbar-brand {
    font-weight: 800;
    color: var(--text-main) !important;
    letter-spacing: -0.03em;
    font-size: 1.1rem;
    gap: 10px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bs-primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.navbar-arch .nav-link {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.855rem;
    padding: 0.44rem 0.72rem !important;
    border-radius: 9px;
    transition: color 0.16s ease, background-color 0.16s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.navbar-arch .nav-link:hover {
    color: var(--text-main);
    background-color: var(--bg-subtle);
}

.navbar-arch .nav-link.active {
    color: var(--bs-primary) !important;
    background: transparent;
    font-weight: 700;
}

@media (min-width: 992px) {
    .navbar-arch .nav-link.active::after {
        content: "";
        position: absolute;
        left: 0.72rem;
        right: 0.72rem;
        bottom: 2px;
        height: 2px;
        border-radius: 999px;
        background: var(--bs-primary);
    }
    .navbar-arch .nav-link.nav-vip-link.active::after,
    .navbar-arch .nav-link.dropdown-toggle::after {
        content: none;
    }
}

[data-bs-theme="dark"] .navbar-arch .nav-link.active {
    color: #93c5fd !important;
}

@media (min-width: 992px) {
    [data-bs-theme="dark"] .navbar-arch .nav-link.active::after {
        background: #93c5fd;
    }
}

.nav-explore-btn {
    padding: 0.42rem 0.82rem !important;
    border-radius: 999px !important;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-main) !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
}

.nav-explore-btn:hover,
.nav-explore-btn[aria-expanded="true"] {
    background: rgba(var(--bs-primary-rgb), 0.08) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.28) !important;
    color: var(--bs-primary) !important;
}

.nav-v-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
    margin: 0 4px;
    flex-shrink: 0;
}

.nav-kbd-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 5px;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.navbar-arch .nav-link.nav-vip-link {
    background: linear-gradient(135deg, #18181b 0%, #27272a 100%) !important;
    color: #fef3c7 !important;
    border: 1px solid rgba(245, 158, 11, 0.5) !important;
    border-radius: 999px !important;
    padding: 0.36rem 0.9rem !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 10px -2px rgba(217, 119, 6, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.navbar-arch .nav-link.nav-vip-link:hover {
    transform: translateY(-1px);
    border-color: rgba(251, 191, 36, 0.85) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px -4px rgba(245, 158, 11, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.navbar-arch .nav-link.nav-vip-link.active {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.24), 0 4px 12px -2px rgba(217, 119, 6, 0.32);
}

[data-bs-theme="dark"] .navbar-arch .nav-link.nav-vip-link {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(180, 83, 9, 0.12) 100%) !important;
    color: #fde68a !important;
    border-color: rgba(251, 191, 36, 0.5) !important;
}

.nav-vip-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-vip-gem {
    color: #fbbf24;
    font-size: 0.84rem;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.45));
}

.nav-vip-mob-cta {
    font-size: 0.74rem;
    font-weight: 700;
    color: #18181b;
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
    padding: 3px 10px;
    border-radius: 999px;
}

@media (max-width: 991.98px) {
    .navbar-arch .nav-link.nav-vip-link {
        width: 100%;
        justify-content: space-between;
        border-radius: 12px !important;
        padding: 11px 14px !important;
        font-size: 0.9rem !important;
        letter-spacing: 0.01em;
    }
}

.nav-cta-btn {
    border-radius: 999px !important;
    padding: 0.44rem 1.08rem !important;
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    min-height: 36px !important;
}

.theme-toggle-btn,
.nav-circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
    padding: 0;
    position: relative;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
}

.theme-toggle-btn:hover,
.nav-circle-btn:hover {
    border-color: var(--border-strong);
    color: var(--bs-primary);
    background: var(--bg-surface);
}

.nav-hamburger-btn {
    width: 38px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.nav-hamburger-btn:focus {
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.14);
}

/* Mobile Clean Minimal Menu (< 992px) */
@media (max-width: 991.98px) {
    .navbar-arch .navbar-collapse {
        border-top: 1px solid var(--border-subtle);
        margin-top: 10px;
        padding: 10px 0 8px;
        max-height: calc(100vh - 76px);
        overflow-y: auto;
    }
    .navbar-arch .navbar-nav {
        gap: 2px !important;
        margin-top: 0 !important;
    }
    .navbar-arch .nav-link.mobile-nav-row {
        display: flex !important;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px !important;
        border-radius: 10px !important;
        font-size: 0.92rem !important;
        font-weight: 600 !important;
        color: var(--text-main) !important;
        background: transparent !important;
        border: none !important;
    }
    .navbar-arch .nav-link.mobile-nav-row:hover {
        background: var(--bg-subtle) !important;
    }
    .navbar-arch .nav-link.mobile-nav-row.active {
        background: rgba(var(--bs-primary-rgb), 0.08) !important;
        color: var(--bs-primary) !important;
    }
    [data-bs-theme="dark"] .navbar-arch .nav-link.mobile-nav-row.active {
        background: rgba(59, 130, 246, 0.14) !important;
        color: #93c5fd !important;
    }
    .mobile-row-left {
        display: inline-flex;
        align-items: center;
        gap: 11px;
        min-width: 0;
    }
    .mobile-row-pin {
        font-size: 1rem;
        width: 18px;
        text-align: center;
        color: var(--text-muted);
        flex-shrink: 0;
    }
    .nav-link.mobile-nav-row.active .mobile-row-pin {
        color: var(--bs-primary);
    }
}

.nav-cart-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--bs-primary);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
    line-height: 1;
}

.user-menu-trigger {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 999px !important;
    padding: 4px 12px 4px 4px !important;
    transition: border-color 0.16s ease;
}

@media (max-width: 991.98px) {
    .user-menu-trigger {
        width: 100%;
        justify-content: space-between;
        border-radius: 12px !important;
        padding: 8px 12px !important;
        margin-top: 6px;
    }
}

.user-menu-trigger:hover {
    border-color: var(--border-strong) !important;
}

/* ==========================================================================
   Clean Tactile Buttons & Inputs
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.86rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    transition: all 0.16s ease;
    border-radius: 10px;
    padding: 0.52rem 1.05rem;
    min-height: 38px;
}

.btn-sm {
    font-size: 0.79rem;
    padding: 0.36rem 0.85rem;
    min-height: 34px;
    border-radius: 8px;
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: var(--bs-primary-color-text, #ffffff);
    box-shadow: var(--shadow-subtle);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--brand-accent-hover);
    border-color: var(--brand-accent-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(var(--bs-primary-rgb), 0.32);
}

.btn-outline-primary {
    border: 1.5px solid var(--border-strong);
    color: var(--bs-primary);
    background: var(--bg-surface);
}

.btn-outline-primary:hover {
    background: rgba(var(--bs-primary-rgb), 0.06);
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #93c5fd;
}

.btn-light {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    box-shadow: var(--shadow-subtle);
}

.btn-light:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    color: var(--text-main);
}

.btn-outline-secondary {
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    background: var(--bg-surface);
}

.btn-outline-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    color: var(--text-main);
}

.alert {
    border-radius: 14px;
    border-width: 1px;
    font-size: 0.9rem;
}

/* Forms */
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.45rem;
}

.form-control, .form-select {
    border-radius: 10px;
    padding: 0.52rem 0.9rem;
    min-height: 38px;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-size: 0.875rem;
    line-height: 1.35;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.form-select {
    padding-right: 2.1rem;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus, .form-select:focus {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.14);
    outline: 0;
}

/* ==========================================================================
   Horizontal Swipeable Category Filter Pills
   ========================================================================== */
.category-segment-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-segment-wrap::-webkit-scrollbar { display: none; }

.filter-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 999px !important;
    height: 36px;
    min-height: 36px !important;
    padding: 0 14px !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
    line-height: 1 !important;
    white-space: nowrap;
    transition: all 0.15s ease;
    border: 1px solid var(--border-subtle) !important;
    text-decoration: none;
    flex-shrink: 0;
}

.filter-btn.btn-primary {
    background: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.filter-btn.btn-light {
    background: var(--bg-surface) !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
}

.filter-btn.btn-light:hover {
    color: var(--text-main) !important;
    background: var(--bg-subtle) !important;
}

/* ==========================================================================
   Clean Course Cards
   ========================================================================== */
.course-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px !important;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    position: relative;
}

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

.course-img-wrap {
    position: relative;
    padding-top: 56.25%;
    background: var(--bg-subtle);
    overflow: hidden;
}

.course-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.course-card:hover .course-img-wrap img {
    transform: scale(1.03);
}

.course-cat-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.08);
    padding: 3px 10px;
    border-radius: 999px;
}

[data-bs-theme="dark"] .course-cat-label {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.14);
}

.course-title-clamp {
    font-weight: 700;
    font-size: clamp(0.92rem, 2.4vw, 0.98rem);
    line-height: 1.42;
    letter-spacing: -0.015em;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    min-height: 2.8em;
}

.course-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.course-detail-arrow {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.course-card:hover .course-detail-arrow {
    background: var(--bs-primary);
    color: #ffffff;
}

/* General Cards & Surfaces */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    color: var(--text-main);
}

.auth-card {
    border-radius: 18px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-hover);
    background: var(--bg-surface);
}

/* Status Pill System */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-pill-success { background: rgba(16, 185, 129, 0.1); color: #059669; border-color: rgba(16, 185, 129, 0.22); }
.status-pill-warning { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.24); }
.status-pill-danger { background: rgba(239, 68, 68, 0.1); color: #dc2626; border-color: rgba(239, 68, 68, 0.22); }

[data-bs-theme="dark"] .status-pill-success { color: #34d399; }
[data-bs-theme="dark"] .status-pill-warning { color: #fbbf24; }
[data-bs-theme="dark"] .status-pill-danger { color: #f87171; }

.status-dot-online {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

/* Clean Editorial Footer */
.footer-modern {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle) !important;
    color: var(--text-secondary);
}

.footer-micro {
    background: transparent;
    color: var(--text-muted);
}

.footer-micro .footer-link {
    font-size: 0.79rem;
    padding: 2px 0;
}

.footer-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-main);
    margin-bottom: 0.85rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    transition: color 0.15s ease;
    display: inline-block;
    padding: 3px 0;
}

.footer-link:hover {
    color: var(--bs-primary);
}

/* Dropdowns & Pagination */
.dropdown-menu {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle) !important;
    border-radius: 14px !important;
    box-shadow: var(--shadow-hover) !important;
    padding: 0.45rem;
}

.dropdown-item {
    color: var(--text-main);
    font-size: 0.87rem;
    font-weight: 500;
    border-radius: 9px;
    padding: 0.52rem 0.8rem;
}

.dropdown-item:hover {
    background-color: var(--bg-subtle);
    color: var(--text-main);
}

.dropdown-divider { border-top-color: var(--border-subtle); }

.pagination .page-link {
    border-radius: 999px !important;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    margin: 0 3px;
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.pagination .page-item.active .page-link {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #ffffff;
}

/* Skeleton Box */
.skeleton-box {
    background: linear-gradient(90deg, var(--bg-subtle) 25%, rgba(148, 163, 184, 0.12) 50%, var(--bg-subtle) 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s infinite;
    border-radius: 10px;
}

@keyframes skeletonPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dark Mode Utility Overrides */
[data-bs-theme="dark"] .text-dark:not(.btn-warning):not(.bg-warning) { color: var(--text-main) !important; }
[data-bs-theme="dark"] .btn-warning.text-dark,
[data-bs-theme="dark"] .bg-warning.text-dark { color: #111827 !important; }
[data-bs-theme="dark"] .bg-white { background-color: var(--bg-surface) !important; color: var(--text-main); }
[data-bs-theme="dark"] .bg-light { background-color: var(--bg-subtle) !important; border-color: var(--border-subtle) !important; color: var(--text-main) !important; }
[data-bs-theme="dark"] .card { background-color: var(--bg-surface); border-color: var(--border-subtle); color: var(--text-main); }
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end { border-color: var(--border-subtle) !important; }
[data-bs-theme="dark"] .bottom-nav {
    background-color: rgba(17, 24, 39, 0.94) !important;
    backdrop-filter: blur(14px);
    border-top-color: var(--border-subtle) !important;
}

/* Laptop 992px-1199px compact navbar fit */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .navbar-arch .nav-link { padding: 0.45rem 0.58rem; font-size: 0.85rem; }
    .nav-search-wrap { flex: 1 1 135px; max-width: 195px; }
}

/* Mobile Touch Targets & Floating CTA Coordination */
@media (max-width: 767.98px) {
    body.has-floating-cta { padding-bottom: calc(144px + env(safe-area-inset-bottom)) !important; }
    body.has-floating-cta .floating-cta { bottom: calc(62px + env(safe-area-inset-bottom)) !important; }
    .nav-circle-btn, .theme-toggle-btn {
        width: 40px;
        height: 40px;
    }
    .navbar-arch .nav-link {
        min-height: 42px;
        padding: 0.55rem 0.9rem !important;
    }
    input.form-control, select.form-select, textarea.form-control {
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   Global Command Search Omnibox, Explore Dropdown & Resume Card
   ========================================================================== */
.nav-search-wrap {
    position: relative;
    flex: 1 1 180px;
    max-width: 300px;
}

.nav-search-pill {
    display: flex;
    align-items: center;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 4px 12px 4px 14px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.nav-search-pill:focus-within {
    background: var(--bg-surface);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.12);
}

.nav-search-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    color: var(--text-main) !important;
    width: 100%;
    outline: none !important;
}

.nav-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    z-index: 1080;
    overflow: hidden;
}

.nav-search-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.15s ease;
}

.nav-search-item:last-child { border-bottom: none; }
.nav-search-item:hover { background: var(--bg-subtle); color: var(--text-main); }

.nav-search-thumb {
    width: 50px;
    height: 34px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}

.explore-dropdown-menu {
    width: min(310px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    min-width: 0;
    padding: 0.7rem !important;
}

.explore-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 11px;
    border-radius: 9px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.explore-cat-link:hover {
    background: var(--bg-subtle);
    color: var(--bs-primary);
}

.resume-learning-banner {
    background: var(--bg-surface);
    color: var(--text-main);
    border-radius: 16px;
    padding: 18px 22px;
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--bs-primary);
    box-shadow: var(--shadow-card);
}

.catalog-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.catalog-sort-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.catalog-select-pill {
    border-radius: 999px !important;
    padding: 0 28px 0 13px !important;
    font-size: 0.8125rem !important;
    font-weight: 600;
    line-height: 1.25 !important;
    height: 36px;
    min-height: 36px !important;
    min-width: 146px;
    width: auto;
    border-color: var(--border-subtle) !important;
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
}

@media (max-width: 767.98px) {
    .catalog-filter-toolbar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }
    .catalog-sort-group {
        display: contents;
    }
    #filterPrice { order: 1; }
    #filterLevel { order: 2; }
    #filterSort { order: 3; }
    .catalog-reset-btn {
        order: 4;
        grid-column: 1 / -1;
        width: 100%;
        height: 34px;
        min-height: 34px !important;
    }
    .catalog-filter-toolbar .catalog-select-pill {
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 24px 0 11px !important;
        font-size: 0.78rem !important;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }
    .resume-learning-banner { padding: 16px; }
}

/* Global spacing & dropdown overflow safeguards */
.card:has(.dropdown-menu.show) { overflow: visible !important; }
.dropdown-menu { z-index: 1080; }
.py-1\.5 { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.py-2\.5 { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.px-2\.5 { padding-left: 0.625rem !important; padding-right: 0.625rem !important; }
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2\.5 { gap: 0.625rem !important; }

/* Course & Instructor Verification / Trust Badges */
.lms-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.35;
    border: 1px solid transparent;
    white-space: nowrap;
}
.lms-trust-badge--official { background: rgba(79, 70, 229, 0.1); color: #4338ca; border-color: rgba(79, 70, 229, 0.22); }
.lms-trust-badge--verified { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; border-color: rgba(37, 99, 235, 0.22); }
.lms-trust-badge--gold { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.lms-trust-badge--emerald { background: rgba(16, 185, 129, 0.12); color: #047857; border-color: rgba(16, 185, 129, 0.24); }
.lms-trust-badge--crimson { background: rgba(239, 68, 68, 0.1); color: #b91c1c; border-color: rgba(239, 68, 68, 0.22); }
.lms-trust-badge--slate { background: rgba(15, 23, 42, 0.07); color: #334155; border-color: rgba(15, 23, 42, 0.14); }

.lms-trust-badge.overlay-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.lms-trust-badge.overlay-badge.lms-trust-badge--official { background: rgba(67, 56, 202, 0.92); color: #ffffff; }
.lms-trust-badge.overlay-badge.lms-trust-badge--verified { background: rgba(29, 78, 216, 0.92); color: #ffffff; }
.lms-trust-badge.overlay-badge.lms-trust-badge--gold { background: rgba(180, 83, 9, 0.94); color: #ffffff; }
.lms-trust-badge.overlay-badge.lms-trust-badge--emerald { background: rgba(4, 120, 87, 0.92); color: #ffffff; }
.lms-trust-badge.overlay-badge.lms-trust-badge--crimson { background: rgba(185, 28, 28, 0.92); color: #ffffff; }

[data-bs-theme="dark"] .lms-trust-badge--official { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; border-color: rgba(129, 140, 248, 0.28); }
[data-bs-theme="dark"] .lms-trust-badge--verified { background: rgba(59, 130, 246, 0.18); color: #bfdbfe; border-color: rgba(96, 165, 250, 0.28); }
[data-bs-theme="dark"] .lms-trust-badge--gold { background: rgba(245, 158, 11, 0.18); color: #fde68a; border-color: rgba(251, 191, 36, 0.28); }
[data-bs-theme="dark"] .lms-trust-badge--emerald { background: rgba(16, 185, 129, 0.18); color: #a7f3d0; border-color: rgba(52, 211, 153, 0.28); }
[data-bs-theme="dark"] .lms-trust-badge--crimson { background: rgba(239, 68, 68, 0.18); color: #fecaca; border-color: rgba(248, 113, 113, 0.28); }
[data-bs-theme="dark"] .lms-trust-badge--slate { background: rgba(148, 163, 184, 0.16); color: #e2e8f0; border-color: rgba(148, 163, 184, 0.24); }

.lms-inst-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: middle;
}
.lms-inst-badge--compact {
    padding: 0 3px;
    background: transparent !important;
    border: none !important;
    font-size: 0.82rem;
}
.lms-inst-badge--verified { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; }
.lms-inst-badge--official { background: rgba(79, 70, 229, 0.1); color: #4338ca; }
.lms-inst-badge--gold { background: rgba(245, 158, 11, 0.13); color: #b45309; }
.lms-inst-badge--emerald { background: rgba(16, 185, 129, 0.12); color: #047857; }
.lms-inst-badge--slate { background: rgba(15, 23, 42, 0.08); color: #334155; }
.lms-inst-badge--compact.lms-inst-badge--verified { color: #2563eb; }
.lms-inst-badge--compact.lms-inst-badge--official { color: #4f46e5; }
.lms-inst-badge--compact.lms-inst-badge--gold { color: #d97706; }
.lms-inst-badge--compact.lms-inst-badge--emerald { color: #10b981; }
[data-bs-theme="dark"] .lms-inst-badge--verified { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
[data-bs-theme="dark"] .lms-inst-badge--official { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
[data-bs-theme="dark"] .lms-inst-badge--gold { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
[data-bs-theme="dark"] .lms-inst-badge--emerald { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
[data-bs-theme="dark"] .lms-inst-badge--slate { background: rgba(148, 163, 184, 0.16); color: #e2e8f0; }

/* Dark Header Context Override for Course Detail */
.course-header-arch .lms-trust-badge,
.course-header-arch .lms-inst-badge {
    border-color: rgba(255, 255, 255, 0.22);
}
.course-header-arch .lms-inst-badge:not(.lms-inst-badge--compact) {
    background: rgba(59, 130, 246, 0.22);
    color: #dbeafe;
}

/* Utility: allow flex children to truncate/clamp text instead of overflowing */
.min-w-0 { min-width: 0 !important; }

