* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --header-h: 4rem;
    --sidebar-w: 18rem;
    --text-dark: #1f2937;
    --text-muted: #64748b;
    --poker-teal: #06bbcc;
}

body {
    font-family: "Inter", system-ui, sans-serif;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}
button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.page-bg {
    min-height: 100vh;
    background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 50;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 0.75rem;
    gap: 0.75rem;
}
@media (min-width: 1024px) {
    .header-inner {
        padding: 0 1.5rem;
    }
}

.btn-mobile-menu {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    flex-shrink: 0;
    transition: background 0.2s;
}
.btn-mobile-menu:hover {
    background: #f1f5f9;
}
@media (min-width: 1024px) {
    .btn-mobile-menu {
        display: none;
    }
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.brand-logo {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: linear-gradient(to bottom right, #06bbcc, #0597a7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.brand-text-wrapper {
    display: none;
    flex-direction: column;
}
@media (min-width: 640px) {
    .brand-text-wrapper {
        display: flex;
    }
}
.brand-title {
    font-weight: 800;
    font-size: 1rem;
    color: #1f2937;
    letter-spacing: -0.025em;
    line-height: 1;
}
.brand-subtitle {
    font-size: 9px;
    font-weight: 600;
    color: var(--poker-teal);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1;
    margin-top: 2px;
}

.header-search {
    flex: 1;
    max-width: 42rem;
    margin: 0 auto;
    position: relative;
}
.search-input-wrapper {
    position: relative;
}
.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
    pointer-events: none;
}
.search-input {
    width: 100%;
    height: 2.25rem;
    padding: 0 2.25rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #334155;
    outline: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}
.search-input:focus {
    background: white;
    border-color: var(--poker-teal);
    box-shadow: 0 0 0 2px rgba(6, 187, 204, 0.2);
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 0.125rem;
    flex-shrink: 0;
}
@media (min-width: 1024px) {
    .desktop-nav {
        display: flex;
    }
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s;
}
.nav-link:hover,
.nav-link.active {
    color: var(--poker-teal);
    background: rgba(6, 187, 204, 0.05);
}

/* Sidebar */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 30;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none;
    }
}

.sidebar-wrapper {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}
.sidebar-wrapper.active {
    transform: translateX(0);
}
@media (min-width: 1024px) {
    .sidebar-wrapper {
        transform: translateX(0);
    }
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.sidebar-all-exams {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sidebar-all-exams:hover .all-exams-title {
    color: var(--poker-teal);
}
.all-exams-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: linear-gradient(to bottom right, #06bbcc, #0597a7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(6, 187, 204, 0.3);
    flex-shrink: 0;
}
.all-exams-title {
    font-size: 0.875rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    transition: color 0.2s;
}
.all-exams-subtitle {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 0.125rem;
}

.sidebar-menu-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    scrollbar-width: none;
}
.sidebar-menu-list::-webkit-scrollbar {
    display: none;
}
.sidebar-group {
    margin-bottom: 0.125rem;
}
.sidebar-menu-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    text-align: left;
    transition: all 0.15s;
    color: #475569;
}
.sidebar-menu-btn:hover {
    color: #0f172a;
    background: #f8fafc;
}
.sidebar-menu-btn.active {
    background: #f1f5f9;
    color: #0f172a;
}
.sb-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0.75;
    flex-shrink: 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.sidebar-menu-btn.active .sb-icon {
    opacity: 1;
}

.sb-indigo {
    background: #6366f1;
}
.sb-rose {
    background: #f43f5e;
}
.sb-emerald {
    background: #10b981;
}
.sb-violet {
    background: #8b5cf6;
}
.sb-amber {
    background: #f59e0b;
}
.sb-blue {
    background: #3b82f6;
}
.sb-orange {
    background: #f97316;
}
.sb-teal {
    background: #14b8a6;
}
.sb-cyan {
    background: #06b6d4;
}

.sb-text {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}
.sb-count {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.sb-arrow {
    width: 0.875rem;
    height: 0.875rem;
    color: #cbd5e1;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.sb-arrow.open {
    transform: rotate(90deg);
}

.sidebar-sublist {
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 1px solid #e2e8f0;
    margin-top: 0.125rem;
    margin-bottom: 0.25rem;
    display: none;
}
.sidebar-sublink {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    line-height: 1.375;
    transition: all 0.15s;
}
.sidebar-sublink:hover {
    color: #1e293b;
    background: #f8fafc;
}
.sidebar-sublink.active {
    background: rgba(6, 187, 204, 0.1);
    color: var(--poker-teal);
    font-weight: 600;
}

/* Main Content Area */
.main-content-wrapper {
    padding-top: var(--header-h);
    min-height: 100vh;
}
@media (min-width: 1024px) {
    .main-content-wrapper {
        padding-left: var(--sidebar-w);
    }
}

.main-content-inner {
    padding: 1rem;
    max-width: 80rem;
    margin: 0 auto;
}
@media (min-width: 640px) {
    .main-content-inner {
        padding: 1.5rem;
    }
}
@media (min-width: 1024px) {
    .main-content-inner {
        padding: 2rem;
    }
}

.content-spacing {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Breadcrumbs & Back Nav */
.top-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.course-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.crumb-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #94a3b8;
    font-size: 0.875rem;
    transition: color 0.2s;
}
.crumb-link:hover {
    color: var(--poker-teal);
}
.crumb-separator {
    width: 0.875rem;
    height: 0.875rem;
    color: #cbd5e1;
    flex-shrink: 0;
}
.crumb-current {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
@media (min-width: 640px) {
    .crumb-current {
        max-width: 320px;
    }
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.btn-back:hover {
    color: var(--poker-teal);
    background: rgba(6, 187, 204, 0.05);
    border-color: rgba(6, 187, 204, 0.3);
}

/* Course Hero Card */
.course-hero-card {
    background: linear-gradient(to bottom right, #ffffff, #f8fafc);
    border-radius: 1rem;
    border: 2px solid #e2e8f0;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 1024px) {
    .course-hero-card {
        padding: 2rem;
    }
}

.course-hero-inner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.course-hero-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: linear-gradient(to bottom right, #06bbcc, #0597a7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(6, 187, 204, 0.2);
    flex-shrink: 0;
}
.course-hero-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}
.course-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.25;
}
@media (min-width: 1024px) {
    .course-title {
        font-size: 1.875rem;
    }
}
.course-stats {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.course-desc {
    font-size: 0.875rem;
    color: #475569;
    margin-top: 0.5rem;
    max-width: 42rem;
    line-height: 1.5;
}

/* Subjects List */
.subject-group {
    border-radius: 1rem;
    border: 2px solid transparent;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}
.subject-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid transparent;
}
.subject-accent-line {
    width: 0.625rem;
    height: 2rem;
    border-radius: 9999px;
    flex-shrink: 0;
}
.subject-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}
.subject-title {
    font-size: 1rem;
    font-weight: 800;
    flex: 1;
}
.subject-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.subject-body {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
}

/* Quiz Grid */
.quiz-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .quiz-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .quiz-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.quiz-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: white;
    border-radius: 0.75rem;
    border: 2px solid rgba(226, 232, 240, 0.8);
    padding: 1rem;
    transition: all 0.2s;
}
.quiz-card:hover {
    border-color: rgba(6, 187, 204, 0.5);
    box-shadow: 0 10px 15px -3px rgba(6, 187, 204, 0.1);
    transform: translateY(-2px);
}
.quiz-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.quiz-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.375;
    transition: color 0.2s;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.quiz-card:hover .quiz-title {
    color: var(--poker-teal);
}

.hot-badge {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    color: #f97316;
    background: #fff7ed;
    border: 1px solid #ffedd5;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
}
.hot-badge svg {
    color: #f97316;
}

.quiz-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}
.quiz-metrics {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.metric-qcount {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}
.metric-qcount svg {
    color: #94a3b8;
}
.metric-diff {
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    font-size: 10px;
    font-weight: 600;
    text-transform: capitalize;
    border: 1px solid transparent;
}
.diff-easy {
    color: #059669;
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.diff-medium {
    color: #d97706;
    background: #fffbeb;
    border-color: #fef3c7;
}
.diff-hard {
    color: #e11d48;
    background: #fff1f2;
    border-color: #ffe4e6;
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    background: var(--poker-teal);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}
.quiz-card:hover .btn-start {
    background: #05a8b8;
    gap: 0.5rem;
}

/* Themes for Subjects */
.theme-blue {
    border-color: #bfdbfe;
}
.theme-blue .subject-header {
    background: linear-gradient(to right, #eff6ff, #eef2ff);
    border-bottom-color: #bfdbfe;
}
.theme-blue .subject-accent-line,
.theme-blue .subject-icon {
    background: #3b82f6;
}
.theme-blue .subject-title,
.theme-blue .subject-badge {
    color: #1d4ed8;
}
.theme-blue .subject-badge {
    background: #dbeafe;
}

.theme-rose {
    border-color: #fecdd3;
}
.theme-rose .subject-header {
    background: linear-gradient(to right, #fff1f2, #fdf2f8);
    border-bottom-color: #fecdd3;
}
.theme-rose .subject-accent-line,
.theme-rose .subject-icon {
    background: #f43f5e;
}
.theme-rose .subject-title,
.theme-rose .subject-badge {
    color: #be123c;
}
.theme-rose .subject-badge {
    background: #ffe4e6;
}

.theme-amber {
    border-color: #fde68a;
}
.theme-amber .subject-header {
    background: linear-gradient(to right, #fffbeb, #fff7ed);
    border-bottom-color: #fde68a;
}
.theme-amber .subject-accent-line,
.theme-amber .subject-icon {
    background: #f59e0b;
}
.theme-amber .subject-title,
.theme-amber .subject-badge {
    color: #b45309;
}
.theme-amber .subject-badge {
    background: #fef3c7;
}

.theme-violet {
    border-color: #c4b5fd;
}
.theme-violet .subject-header {
    background: linear-gradient(to right, #f3f4f6, #f8fafc);
    border-bottom-color: #c4b5fd;
}
.theme-violet .subject-accent-line,
.theme-violet .subject-icon {
    background: #8b5cf6;
}
.theme-violet .subject-title,
.theme-violet .subject-badge {
    color: #7c3aed;
}
.theme-violet .subject-badge {
    background: #e9d5ff;
}

.theme-teal {
    border-color: #5eead4;
}
.theme-teal .subject-header {
    background: linear-gradient(to right, #f0fdfa, #f8fafc);
    border-bottom-color: #5eead4;
}
.theme-teal .subject-accent-line,
.theme-teal .subject-icon {
    background: #14b8a6;
}
.theme-teal .subject-title,
.theme-teal .subject-badge {
    color: #0f766e;
}
.theme-teal .subject-badge {
    background: #ccfbf1;
}

/* Header nav mobile optimization */
@media (max-width: 860px) {
    .nav-link {
        font-size: 0; /* Hide the text nodes (Home, Categories, etc.) */
        padding: 0.5rem; /* Keep size consistent with icon buttons */
        gap: 0;
    }
    .nav-link svg {
        width: 20px;
        height: 20px;
    }
}
