/* ===== Root Variables - Fluent 2 Design System ===== */
:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f3f3f3;
    --bg-tertiary: #fafafa;
    --bg-card: #ffffff;
    --bg-hover: #f3f3f3;
    --bg-active: #ebebeb;

    --text-primary: #242424;
    --text-secondary: #605e5c;
    --text-tertiary: #8a8886;

    --accent-primary: #0078d4;
    --accent-hover: #106ebe;
    --accent-active: #005a9e;

    --border-light: #edebe9;
    --border-medium: #d1d1d1;
    --border-strong: #8a8886;

    --shadow-sm: 0 1.6px 3.6px rgba(0, 0, 0, 0.13), 0 0.3px 0.9px rgba(0, 0, 0, 0.11);
    --shadow-md: 0 3.2px 7.2px rgba(0, 0, 0, 0.13), 0 0.6px 1.8px rgba(0, 0, 0, 0.11);
    --shadow-lg: 0 6.4px 14.4px rgba(0, 0, 0, 0.13), 0 1.2px 3.6px rgba(0, 0, 0, 0.11);

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    --sidebar-width: 280px;
    --sidebar-collapsed: 48px;

    --success-color: #107c10;
    --warning-color: #ffaa44;
    --error-color: #d13438;

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #1f1f1f;
    --bg-secondary: #2b2b2b;
    --bg-tertiary: #252525;
    --bg-card: #2b2b2b;
    --bg-hover: #363636;
    --bg-active: #404040;

    --text-primary: #ffffff;
    --text-secondary: #d1d1d1;
    --text-tertiary: #a19f9d;

    --accent-primary: #60cdff;
    --accent-hover: #4db8e8;
    --accent-active: #3aa3d2;

    --border-light: #3b3b3b;
    --border-medium: #484644;
    --border-strong: #605e5c;

    --shadow-sm: 0 1.6px 3.6px rgba(0, 0, 0, 0.3), 0 0.3px 0.9px rgba(0, 0, 0, 0.26);
    --shadow-md: 0 3.2px 7.2px rgba(0, 0, 0, 0.3), 0 0.6px 1.8px rgba(0, 0, 0, 0.26);
    --shadow-lg: 0 6.4px 14.4px rgba(0, 0, 0, 0.3), 0 1.2px 3.6px rgba(0, 0, 0, 0.26);

    --success-color: #6ccb5f;
    --warning-color: #ffc83d;
    --error-color: #ff8b83;
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background var(--transition-normal), color var(--transition-normal);
    overflow: hidden;
}

/* ===== Fluent Icon Styles ===== */
[class^="ms-Icon"],
[class*=" ms-Icon"] {
    display: inline-block;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: 200px;
    max-width: 400px;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    z-index: 100;
    position: relative;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 8px;
}

.sidebar.collapsed .app-title {
    justify-content: center;
}

.sidebar.collapsed .app-title i {
    margin: 0;
}

.sidebar.collapsed .sidebar-toggle {
    display: none;
}

.sidebar.collapsed .nav-menu {
    padding: 8px 4px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 8px;
    margin: 6px 0;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
    font-size: 20px;
}

.sidebar.collapsed .nav-item.active::after {
    width: 3px;
    height: 32px;
}

.sidebar.collapsed .current-subject {
    padding: 10px 8px;
    justify-content: center;
}

.sidebar.collapsed .current-subject>div {
    display: none;
}

.sidebar.collapsed .nav-section-header {
    justify-content: center;
}

.sidebar.collapsed .nav-section-header .btn-icon {
    display: none;
}

.sidebar.collapsed .sidebar-footer {
    padding: 8px 4px;
}

.sidebar.collapsed .theme-toggle {
    justify-content: center;
    padding: 12px 8px;
}

.sidebar.collapsed .theme-toggle i {
    margin: 0;
}

.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: -2px;
    width: 4px;
    height: 100%;
    cursor: ew-resize;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.sidebar-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: var(--accent-primary);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-resize-handle:hover {
    background: linear-gradient(90deg, transparent 0%, var(--bg-hover) 50%, transparent 100%);
    width: 8px;
    right: -4px;
}

.sidebar-resize-handle:hover::after {
    opacity: 0.5;
}

.sidebar-resize-handle:active {
    background: linear-gradient(90deg, transparent 0%, var(--bg-active) 50%, transparent 100%);
}

.sidebar-resize-handle:active::after {
    background: var(--accent-primary);
    opacity: 1;
}

.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    min-height: 60px;
    background: var(--bg-tertiary);
    position: relative;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
}

.app-title i {
    font-size: 22px;
    color: var(--accent-primary);
}

.sidebar.collapsed .app-title span {
    display: none;
}

.sidebar-toggle {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    color: var(--accent-primary);
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.sidebar-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--bg-active);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.sidebar-toggle:hover::before {
    opacity: 0.1;
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle i {
    position: relative;
    z-index: 1;
    font-size: 16px;
}

/* Expand button that appears outside sidebar when collapsed */
.sidebar.collapsed .sidebar-header {
    position: relative;
}

\n\n.sidebar.collapsed .sidebar-header::after {
    content: '\\E76C';
    font-family: 'FabricMDL2Icons';
    position: absolute;
    top: 50%;
    right: -48px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
    transition: all 0.3s ease;
    z-index: 1002;
}

.sidebar.collapsed .sidebar-header:hover::after {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

/* ===== Navigation Menu ===== */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.nav-section {
    margin-bottom: 24px;
}

.current-subject {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin: 8px 0;
    transition: all 0.3s ease;
}

.current-subject:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.current-subject i {
    font-size: 20px;
    color: var(--accent-primary);
}

.subject-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.subject-code {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 8px 12px;
    letter-spacing: 0.5px;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin: 4px 0;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-hover);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item i {
    font-size: 18px;
    min-width: 18px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.nav-item span {
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    transform: translateX(4px);
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item.active {
    background: var(--bg-active);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--accent-primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px var(--accent-primary);
}

.nav-item.active i {
    color: var(--accent-primary);
}

/* ===== Sidebar Footer ===== */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-light);
}

.theme-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-active);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover::before {
    opacity: 0.05;
}

.theme-toggle i {
    font-size: 18px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
    color: var(--accent-primary);
}

.theme-toggle:hover i {
    transform: rotate(20deg) scale(1.1);
}

.theme-toggle span {
    position: relative;
    z-index: 1;
}

.sidebar.collapsed .theme-toggle span {
    display: none;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    padding: 24px 32px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mobile-menu-btn i {
    font-size: 20px;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}

.content-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== Content Body ===== */
.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    background: var(--bg-tertiary);
}

.page {
    display: none !important;
}

.page.active {
    display: block !important;
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-active) 100%);
    padding: 64px 48px;
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.hero-content h1 {
    font-size: 42px;
    margin-bottom: 12px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 32px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-actions .btn-primary,
.hero-actions .btn-secondary {
    min-width: 180px;
}

.hero-section h2 {
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 600;
}

.hero-section p {
    font-size: 16px;
    opacity: 0.95;
}

/* ===== Home Sections ===== */
.home-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.home-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.read-questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
    padding: 4px;
}

.read-question-item {
    display: flex;
    gap: 12px;
    align-items: start;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.read-question-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.read-question-check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    border-radius: 50%;
    margin-top: 2px;
}

.read-question-content {
    flex: 1;
    min-width: 0;
}

.read-question-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.read-question-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.read-question-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.read-questions-footer {
    padding-top: 8px;
    text-align: center;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.quick-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.quick-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.quick-card i {
    font-size: 32px;
    color: var(--accent-primary);
    margin-bottom: 12px;
    display: block;
}

.quick-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.quick-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.module-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.overview-module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.overview-module-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.overview-module-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.overview-module-number {
    width: 36px;
    height: 36px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.overview-module-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.overview-module-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.overview-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* ===== Card Grid ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card-icon i {
    font-size: 24px;
    color: white;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ===== Buttons ===== */
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    background: var(--accent-active);
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-active);
}

/* ===== Recent Section ===== */
.recent-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.recent-section h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.list-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.list-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.list-item i {
    font-size: 20px;
    color: var(--accent-primary);
}

.list-item-content h4 {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.list-item-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Home Page - Modern Design ===== */
.page-hero {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
    padding: 60px 40px;
    border-radius: 24px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.hero-content p {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 32px;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: white;
    color: var(--accent-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.home-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.home-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.home-section:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.home-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.home-section h2 i {
    color: var(--accent-primary);
    font-size: 26px;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.quick-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 28px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quick-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-card:hover::before {
    opacity: 0.05;
}

.quick-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-primary);
}

.quick-card i {
    font-size: 48px;
    color: var(--accent-primary);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.quick-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

.quick-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.quick-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    position: relative;
    z-index: 1;
}

.module-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.read-questions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.read-question-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: start;
    gap: 12px;
}

.read-question-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.read-question-item i {
    color: var(--success-color);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.read-question-item .question-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.read-question-item .question-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ===== Topics Page - Modern Design ===== */
.page-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 32px;
    border-radius: 20px;
    margin-bottom: 28px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.page-header h2 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.page-header h2 i {
    color: var(--accent-primary);
    font-size: 36px;
}

.page-header p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.topics-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 16px;
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.filter-sort-group {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: var(--accent-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.topics-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-hover));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.module-card:hover::before {
    transform: scaleY(1);
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-primary);
}

.module-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.module-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
    flex-shrink: 0;
}

.module-info {
    flex: 1;
    margin-left: 16px;
}

.module-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.module-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.meta-badge i {
    font-size: 12px;
}

.meta-badge.weightage {
    background: linear-gradient(135deg, rgba(16, 124, 16, 0.1), rgba(16, 124, 16, 0.05));
    color: var(--success-color);
}

.meta-badge.hours {
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 120, 212, 0.05));
    color: var(--accent-primary);
}

.meta-badge.marks {
    background: linear-gradient(135deg, rgba(255, 170, 68, 0.1), rgba(255, 170, 68, 0.05));
    color: var(--warning-color);
}

.module-topics {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.module-topics h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topics-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.topic-item::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.loading-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-message i {
    font-size: 48px;
    color: var(--accent-primary);
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-message p {
    font-size: 16px;
    font-weight: 500;
}
.topics-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.topic-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic-card h3 i {
    color: var(--accent-primary);
}

/* Module card specific styles */
.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.module-card:hover::before {
    opacity: 1;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.module-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.module-number {
    background: var(--accent-primary);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.module-title {
    flex: 1;
    margin-left: 16px;
}

.module-title h3 {
    font-size: 18px;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.module-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-tertiary);
}

.module-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.module-meta-item i {
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-weightage {
    background: #f3f4f6;
    color: #374151;
}

[data-theme="dark"] .badge-weightage {
    background: #374151;
    color: #f3f4f6;
}

.module-topics-preview {
    margin-top: 12px;
}

.module-topics-preview ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.module-topics-preview li {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 6px 0 6px 20px;
    position: relative;
}

.module-topics-preview li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--accent-primary);
}

.module-detail-content {
    display: grid;
    gap: 24px;
}

.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.detail-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h3 i {
    color: var(--accent-primary);
}

.keypoints-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 12px;
}

.keypoints-list li {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    position: relative;
    padding-left: 36px;
}

.keypoints-list li::before {
    content: '✓';
    position: absolute;
    left: 12px;
    color: var(--accent-primary);
    font-weight: 600;
}

.back-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    transition: all var(--transition-fast);
}

.back-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.loading-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.loading-message i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--accent-primary);
}

.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.topic-list {
    list-style: none;
}

.topic-list li {
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    padding-left: 20px;
}

.topic-list li:last-child {
    border-bottom: none;
}

.topic-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

/* ===== Practice Page ===== */
.practice-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.problem-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.problem-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.problem-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.difficulty {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty.easy {
    background: rgba(16, 124, 16, 0.1);
    color: var(--success-color);
}

.difficulty.medium {
    background: rgba(255, 170, 68, 0.1);
    color: var(--warning-color);
}

.difficulty.hard {
    background: rgba(209, 52, 56, 0.1);
    color: var(--error-color);
}

.problem-content {
    margin-bottom: 20px;
}

.problem-content pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-top: 12px;
}

.problem-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

/* ===== Chatbot Page ===== */
/* Modern Chatbot Styles */
.chatbot-container-modern {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 128px);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Modern Chat Header */
.chat-header-modern {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.chat-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

[data-theme="dark"] .chat-avatar-large {
    box-shadow: 0 4px 12px rgba(96, 205, 255, 0.3);
}

.avatar-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #10B981;
    border: 3px solid var(--bg-card);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-header-info h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.chat-status-modern {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10B981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Model Selector Dropdown */
.model-selector-modern {
    position: relative;
}

.model-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-medium);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.model-dropdown-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.model-dropdown-btn i:first-child {
    color: var(--accent-primary);
    font-size: 16px;
}

.model-dropdown-btn i:last-child {
    color: var(--text-tertiary);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.model-selector-modern.active .model-dropdown-btn i:last-child {
    transform: rotate(180deg);
}

.model-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
}

.model-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.model-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.model-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.model-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.model-selector-modern.active .model-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.model-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 120, 212, 0.05));
    border-bottom: 1px solid var(--border-light);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

[data-theme="dark"] .model-dropdown-header {
    background: linear-gradient(135deg, rgba(96, 205, 255, 0.15), rgba(96, 205, 255, 0.05));
}

.model-dropdown-header i {
    color: var(--accent-primary);
    font-size: 18px;
}

.model-dropdown-group {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.model-dropdown-group:last-child {
    border-bottom: none;
}

.model-group-label {
    padding: 8px 12px;
    margin-bottom: 4px;
}

.provider-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.provider-badge.gemini-badge {
    background: linear-gradient(135deg, #4285F4, #34A853);
}

.provider-badge.claude-badge {
    background: linear-gradient(135deg, #7C3AED, #A855F7);
}

.provider-badge.openai-badge {
    background: linear-gradient(135deg, #10A37F, #059669);
}

.provider-badge.perplexity-badge {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.model-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.model-option:hover {
    background: var(--bg-hover);
}

.model-option.selected {
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 120, 212, 0.05));
}

[data-theme="dark"] .model-option.selected {
    background: linear-gradient(135deg, rgba(96, 205, 255, 0.15), rgba(96, 205, 255, 0.05));
}

.model-option>i:first-child {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--accent-primary);
    font-size: 16px;
    flex-shrink: 0;
}

.model-option>div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.model-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.model-desc {
    font-size: 11px;
    color: var(--text-tertiary);
}

.model-check {
    color: var(--accent-primary);
    font-size: 16px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.model-option.selected .model-check {
    opacity: 1;
    transform: scale(1);
}

.icon-btn-modern {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-medium);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.icon-btn-modern:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.05);
}

/* Modern Messages Area */
.chat-messages-modern {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg-primary);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-messages-modern::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.chat-welcome-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    margin: auto 0;
}

.welcome-icon-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 24px;
}

.welcome-icon-pulse {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 24px;
    opacity: 0.2;
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.2;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

.welcome-icon-container i {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 24px;
    color: white;
    font-size: 48px;
    box-shadow: 0 8px 24px rgba(0, 120, 212, 0.3);
}

[data-theme="dark"] .welcome-icon-container i {
    box-shadow: 0 8px 24px rgba(96, 205, 255, 0.3);
}

.chat-welcome-modern h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.chat-welcome-modern p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    max-width: 500px;
}

.suggestion-chips-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    max-width: 700px;
    width: 100%;
}

.chip-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.chip-modern:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.chip-modern i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 120, 212, 0.05));
    border-radius: 8px;
    color: var(--accent-primary);
    font-size: 16px;
    flex-shrink: 0;
}

[data-theme="dark"] .chip-modern i {
    background: linear-gradient(135deg, rgba(96, 205, 255, 0.15), rgba(96, 205, 255, 0.05));
}

/* Modern Input Area */
.chat-input-modern {
    padding: 20px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
}

.chat-input-wrapper-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    border: 2px solid var(--border-medium);
    border-radius: 14px;
    padding: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-input-wrapper-modern:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 16px rgba(0, 120, 212, 0.15);
}

[data-theme="dark"] .chat-input-wrapper-modern:focus-within {
    box-shadow: 0 4px 16px rgba(96, 205, 255, 0.15);
}

.input-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.input-action-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.chat-input-wrapper-modern #chatInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 4px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.chat-input-wrapper-modern #chatInput::placeholder {
    color: var(--text-tertiary);
}

.send-btn-modern {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

.send-btn-modern:hover {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

.send-btn-modern:active {
    transform: scale(0.95);
}

.send-btn-modern:disabled {
    background: var(--bg-hover);
    color: var(--text-tertiary);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.input-footer {
    margin-top: 12px;
    padding: 0 4px;
}

.input-footer p {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 0;
}

.input-footer i {
    font-size: 12px;
}

/* Legacy Chatbot Styles */
.chatbot-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 128px);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-left i {
    font-size: 24px;
    color: var(--accent-primary);
}

.chat-header h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

.chat-status {
    font-size: 12px;
    color: var(--text-tertiary);
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.model-selector {
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.model-selector:hover {
    border-color: var(--accent-primary);
}

.model-selector:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ===== Chat Messages ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-welcome {
    text-align: center;
    padding: 60px 20px;
}

.chat-welcome i {
    font-size: 48px;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.chat-welcome h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.chat-welcome p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.chip {
    padding: 10px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip:hover {
    background: var(--bg-active);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

/* ===== Chat Message Bubbles ===== */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--accent-primary);
    color: white;
}

.message.assistant .message-avatar {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.message-content {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    line-height: 1.6;
    font-size: 14px;
}

.message.user .message-content {
    background: var(--accent-primary);
    color: white;
}

.message.assistant .message-content {
    background: var(--bg-hover);
}

.message-loading {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.message-loading span {
    width: 8px;
    height: 8px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.message-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.message-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ===== Markdown Content Styling ===== */
.markdown-content {
    line-height: 1.7;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 600;
}

.markdown-content h1 {
    font-size: 24px;
}

.markdown-content h2 {
    font-size: 20px;
}

.markdown-content h3 {
    font-size: 18px;
}

.markdown-content h4 {
    font-size: 16px;
}

.markdown-content p {
    margin-bottom: 12px;
}

.markdown-content ul,
.markdown-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.markdown-content li {
    margin-bottom: 6px;
}

.markdown-content pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 12px 0;
}

.markdown-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-secondary);
}

.markdown-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid var(--border-light);
    padding: 8px 12px;
    text-align: left;
}

.markdown-content th {
    background: var(--bg-hover);
    font-weight: 600;
}

/* ===== Chat Input ===== */
.chat-input-container {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 4px;
    transition: border-color var(--transition-fast);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-primary);
}

#chatInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

#chatInput::placeholder {
    color: var(--text-tertiary);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.send-btn:disabled {
    background: var(--bg-hover);
    color: var(--text-tertiary);
    cursor: not-allowed;
    transform: scale(1);
}

/* ===== Settings Page ===== */
/* ===== Settings Styles ===== */
.settings-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Quick Settings Grid */
.settings-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.settings-quick-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.settings-quick-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-quick-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-primary);
}

.settings-quick-card:hover::before {
    opacity: 1;
}

.settings-quick-card.clickable {
    cursor: pointer;
}

.quick-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.2);
}

[data-theme="dark"] .quick-card-icon {
    box-shadow: 0 4px 12px rgba(96, 205, 255, 0.2);
}

.quick-card-content {
    flex: 1;
    min-width: 0;
}

.quick-card-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.quick-card-content p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.quick-card-arrow {
    color: var(--text-tertiary);
    font-size: 16px;
    transition: transform 0.2s ease;
}

.settings-quick-card.clickable:hover .quick-card-arrow {
    transform: translateX(4px);
}

.setting-control-inline {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.setting-control-inline:hover {
    border-color: var(--accent-primary);
}

.setting-control-inline:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* Modern Settings Sections */
.settings-section-modern {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}

.section-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 120, 212, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 20px;
    flex-shrink: 0;
}

[data-theme="dark"] .section-header-icon {
    background: linear-gradient(135deg, rgba(96, 205, 255, 0.15), rgba(96, 205, 255, 0.05));
}

.section-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.section-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Settings Group */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.setting-label>i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 18px;
    flex-shrink: 0;
}

.setting-label h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.setting-label p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.setting-value {
    flex-shrink: 0;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    gap: 8px;
    background: var(--bg-primary);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-medium);
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.toggle-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

[data-theme="dark"] .toggle-btn.active {
    box-shadow: 0 2px 8px rgba(96, 205, 255, 0.3);
}

/* Expandable Settings */
.setting-expandable {
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* API Keys Grid */
.api-keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.api-key-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.api-key-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.api-key-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.api-provider-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.api-provider-badge.gemini {
    background: linear-gradient(135deg, #4285F4, #34A853);
}

.api-provider-badge.claude {
    background: linear-gradient(135deg, #7C3AED, #A855F7);
}

.api-provider-badge.openai {
    background: linear-gradient(135deg, #10A37F, #059669);
}

.api-provider-badge.perplexity {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.api-link {
    color: var(--accent-primary);
    font-size: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.api-link:hover {
    opacity: 0.7;
}

.api-key-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    transition: all 0.2s ease;
}

.api-key-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.api-key-input::placeholder {
    color: var(--text-tertiary);
    font-family: system-ui, -apple-system, sans-serif;
}

.btn-save-keys {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.2);
}

.btn-save-keys:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 120, 212, 0.3);
}

.btn-save-keys:active {
    transform: translateY(0);
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.about-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.about-item:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.about-item>i {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 120, 212, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 20px;
    flex-shrink: 0;
}

.about-item h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.about-item p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Legacy styles removed */
.settings-section {
    display: none;
}

.setting-item {
    display: none;
}

.setting-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.setting-control {
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 200px;
}

.api-key-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.api-key-container input {
    flex: 1;
    min-width: 250px;
}

.about-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-content p {
    margin-bottom: 8px;
}

.mt-2 {
    margin-top: 16px;
}

/* ===== PIN Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header i {
    font-size: 24px;
    color: var(--accent-primary);
}

.modal-header h2 {
    font-size: 20px;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

#pinInput {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 16px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 600;
    margin-bottom: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

#pinInput:focus {
    outline: none;
    border-color: var(--accent-primary);
}

#unlockBtn {
    width: 100%;
}

.error-message {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

/* ===== Subject Selector ===== */
.subject-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

.subject-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.subject-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.subject-card i {
    font-size: 48px;
    color: var(--accent-primary);
    margin-bottom: 12px;
}

.subject-card h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.subject-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.current-subject {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin: 8px 16px;
}

.current-subject i {
    font-size: 24px;
    color: var(--accent-primary);
}

.subject-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.subject-code {
    font-size: 12px;
    color: var(--text-secondary);
}

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* ===== Notifications ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    opacity: 0;
    transform: translateX(400px);
    transition: all var(--transition-normal);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification i {
    font-size: 20px;
}

.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-success i {
    color: var(--success-color);
}

.notification-error {
    border-left: 4px solid var(--error-color);
}

.notification-error i {
    color: var(--error-color);
}

.notification-info {
    border-left: 4px solid var(--accent-primary);
}

.notification-info i {
    color: var(--accent-primary);
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        z-index: 200;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .content-header {
        padding: 10px 12px;
    }

    .content-header h1 {
        font-size: 24px;
    }

    .content-body {
        padding: 10px 12px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .hero-section {
        padding: 20px 14px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-stats {
        gap: 16px;
    }

    .stat-number {
        font-size: 28px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
    }

    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .module-overview-grid {
        grid-template-columns: 1fr;
    }

    .topics-controls {
        gap: 8px;
    }

    .filter-sort-group {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    .topics-container {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 95%;
    }

    .chat-input-container {
        padding: 8px;
    }

    .questions-container {
        padding: 0;
    }

    .question-card {
        padding: 12px;
    }

    .ai-actions {
        flex-direction: column;
    }

    .ai-action-btn {
        width: 100%;
        justify-content: center;
    }

    .qbank-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select {
        width: 100%;
    }

    .modal-content {
        width: 90%;
        margin: 20px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        padding: 12px;
    }

    .sidebar-toggle {
        display: flex !important;
    }

    /* Question Bank Mobile */
    .qbank-layout {
        flex-direction: column;
        height: auto;
    }

    .qbank-sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .qbank-modules {
        max-height: 150px;
    }

    .qbank-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .qbank-controls {
        flex-direction: column;
    }

    .search-box-inline {
        max-width: 100%;
    }

    .qbank-main {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .content-header h1 {
        font-size: 20px;
    }

    .hero-section {
        padding: 16px 12px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }

    .quick-access-grid {
        grid-template-columns: 1fr;
    }

    .hero-section h2 {
        font-size: 24px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .page-header h2 {
        font-size: 22px;
    }

    .module-number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .question-text {
        font-size: 14px;
    }

    .overview-module-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .overview-module-title {
        font-size: 14px;
    }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

@media (max-width: 768px) {
    .sidebar.mobile-open+.sidebar-overlay {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
}

/* ===== Markdown Content Styling ===== */
.markdown-content {
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.markdown-content h1 {
    font-size: 24px;
}

.markdown-content h2 {
    font-size: 20px;
}

.markdown-content h3 {
    font-size: 18px;
}

.markdown-content h4 {
    font-size: 16px;
}

.markdown-content p {
    margin-bottom: 12px;
}

.markdown-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.markdown-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px;
    overflow-x: auto;
    margin: 12px 0;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin-left: 24px;
    margin-bottom: 12px;
}

.markdown-content li {
    margin-bottom: 4px;
}

.markdown-content blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-secondary);
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    overflow-x: auto;
    display: block;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid var(--border-light);
    padding: 8px 12px;
    text-align: left;
}

.markdown-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.markdown-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== Modern Question Bank Styles ===== */

/* Modern Header */
.qbank-header-modern {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: 0;
}

.qbank-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    gap: 20px;
}

.qbank-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.qbank-icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

[data-theme="dark"] .qbank-icon-badge {
    box-shadow: 0 4px 12px rgba(96, 205, 255, 0.3);
}

.qbank-title-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.qbank-title-section p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.qbank-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.qbank-stats-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 120, 212, 0.05));
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

[data-theme="dark"] .qbank-stats-card {
    background: linear-gradient(135deg, rgba(96, 205, 255, 0.15), rgba(96, 205, 255, 0.05));
}

.qbank-stats-card i {
    font-size: 18px;
    color: var(--accent-primary);
}

/* Filter Bar */
.qbank-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

/* Search Container */
.qbank-search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border-medium);
    border-radius: 10px;
    transition: all 0.2s ease;
    gap: 12px;
    padding-right: 8px;
}

.qbank-search-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.qbank-search-container > i {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 16px;
    pointer-events: none;
}

.qbank-search-input {
    flex: 1;
    padding: 12px 44px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    outline: none;
}

.qbank-search-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Inline Filters */
.search-inline-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 4px;
    border-left: 1px solid var(--border-light);
    padding-left: 12px;
}

.module-selector-compact {
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.module-selector-compact:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.module-selector-compact:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chip-filter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-filter-icon:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: scale(1.05);
}

.chip-filter-icon.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 2px 6px rgba(0, 120, 212, 0.3);
}

.chip-filter-icon i {
    font-size: 14px;
}

.qbank-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-hover);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.qbank-search-clear:hover {
    background: var(--bg-active);
    color: var(--text-primary);
}

.qbank-search-clear i {
    font-size: 12px;
}

/* Search Highlight */
.search-highlight {
    background-color: rgba(255, 215, 0, 0.5);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1px 2px;
    border-radius: 2px;
}

[data-theme="dark"] .search-highlight {
    background-color: rgba(255, 215, 0, 0.3);
    color: var(--text-primary);
}

/* Filter Row */
.qbank-filter-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group>i {
    color: var(--text-secondary);
    font-size: 16px;
}

.module-selector-modern {
    padding: 10px 16px;
    border: 2px solid var(--border-medium);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 220px;
}

.module-selector-modern:hover {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

.module-selector-modern:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.filter-chips-modern {
    display: flex;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.chip-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chip-filter:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.chip-filter.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

.chip-filter i {
    font-size: 14px;
}

/* Modern Layout with Resizable Sidebar */
.qbank-layout-modern {
    display: flex;
    gap: 0;
    height: calc(100% - 180px);
    overflow: hidden;
    position: relative;
    transition: height 0.3s ease;
}

/* Expand layout when sidebar is collapsed (filter bar hidden) */
.qbank-header-modern:has(~ .qbank-layout-modern .qbank-sidebar-modern.collapsed) ~ .qbank-layout-modern {
    height: calc(100% - 120px);
}

/* Resizable Sidebar */
.qbank-sidebar-modern {
    width: 45%;
    min-width: 320px;
    max-width: 70%;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: width 0.3s ease, min-width 0.3s ease;
}

.qbank-sidebar-modern.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-right: none;
    overflow: hidden;
}

/* Hide filter bar when sidebar is collapsed */
.qbank-header-modern:has(~ .qbank-layout-modern .qbank-sidebar-modern.collapsed) .qbank-filter-bar {
    max-height: 0;
    padding: 0 24px;
    overflow: hidden;
    border: none;
    opacity: 0;
    margin: 0;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

/* Resize Handle */
.qbank-resize-handle-modern {
    position: absolute;
    top: 0;
    right: -5px;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    z-index: 100;
    transition: background 0.2s ease;
    background: transparent;
}

.qbank-resize-handle-modern:hover {
    background: rgba(0, 120, 212, 0.3);
}

.qbank-resize-handle-modern:active {
    background: var(--accent-primary);
}

/* Toggle Button */
.qbank-toggle-modern {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 36px;
    height: 80px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-left: none;
    border-radius: 0 12px 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 200;
    transition: all 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
}

.qbank-sidebar-modern:not(.collapsed)~.qbank-toggle-modern {
    left: 45%;
}

.qbank-toggle-modern:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 2px 0 16px rgba(0, 120, 212, 0.15);
}

.qbank-toggle-modern i {
    font-size: 16px;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}

.qbank-sidebar-modern.collapsed~.qbank-toggle-modern i {
    transform: rotate(180deg);
}

.qbank-sidebar-modern.collapsed ~ .qbank-detail-panel {
    margin-left: 0;
    width: 100%;
}

/* Questions Grid in Sidebar */
.qbank-questions-grid {
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-primary);
    flex: 1;
}

/* No Results State */
.qbank-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 300px;
}

.qbank-no-results > i {
    font-size: 64px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
    opacity: 0.5;
}

.qbank-no-results h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.qbank-no-results p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    max-width: 300px;
}

.qbank-no-results .btn-secondary {
    padding: 10px 20px;
}

.qbank-question-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.qbank-question-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qbank-question-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.qbank-question-card:hover::before {
    opacity: 1;
}

.qbank-question-card.active {
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 120, 212, 0.05));
    border-color: var(--accent-primary);
    box-shadow: 0 4px 16px rgba(0, 120, 212, 0.15);
}

[data-theme="dark"] .qbank-question-card.active {
    background: linear-gradient(135deg, rgba(96, 205, 255, 0.15), rgba(96, 205, 255, 0.05));
}

.qbank-question-card.active::before {
    opacity: 1;
}

.qbank-question-card.read {
    opacity: 0.75;
}

.qbank-question-card.read:hover {
    opacity: 1;
}

.question-card-header {
    display: flex;
    align-items: start;
    gap: 12px;
    margin-bottom: 10px;
}

.question-number-badge {
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.qbank-question-card.active .question-number-badge {
    background: var(--accent-primary);
    color: white;
}

.question-card-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.question-card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.question-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-secondary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.question-meta-badge.important {
    background: linear-gradient(135deg, #FF9500, #FF6B00);
    color: white;
}

.question-meta-badge.critical {
    background: linear-gradient(135deg, #FF3B30, #DC143C);
    color: white;
}

.question-meta-badge.pyq {
    background: linear-gradient(135deg, #34C759, #30A14E);
    color: white;
}

.question-meta-badge i {
    font-size: 11px;
}

/* Detail Panel */
.qbank-detail-panel {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    height: 100%;
}

.qbank-sidebar-modern.collapsed ~ .qbank-toggle-modern ~ .qbank-detail-panel.active {
    height: auto;
    flex: none;
}

.qbank-welcome-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    min-height: 400px;
}

.welcome-graphic {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 120, 212, 0.3);
    animation: float 3s ease-in-out infinite;
}

[data-theme="dark"] .welcome-graphic {
    box-shadow: 0 8px 24px rgba(96, 205, 255, 0.3);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.qbank-welcome-modern h3 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.qbank-welcome-modern p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    max-width: 400px;
}

.welcome-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-item i {
    color: var(--accent-primary);
    font-size: 16px;
}

/* Legacy styles - hide old elements */
.qbank-layout {
    display: none;
}

.qbank-sidebar {
    width: 320px;
    min-width: 200px;
    max-width: 600px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.qbank-sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    border-right: none;
    overflow: hidden;
}

.qbank-resize-handle {
    position: absolute;
    top: 0;
    right: -5px;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    z-index: 1000;
    transition: background 0.2s ease;
    background: transparent;
}

.qbank-resize-handle:hover {
    background: rgba(0, 120, 212, 0.3);
}

.qbank-resize-handle:active {
    background: var(--accent-primary);
}

.qbank-sidebar-toggle {
    display: none !important;
}

.qbank-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
}

.qbank-sidebar-header i {
    font-size: 20px;
    color: var(--accent-primary);
}

.qbank-sidebar-header h3 {
    font-size: 16px;
    margin: 0;
    color: var(--text-primary);
}

.qbank-modules-filter {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-module-select,
.module-selector {
    padding: 10px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.module-selector:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.15);
}

.module-selector:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.qbank-filter-chips {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.filter-chip {
    padding: 6px 14px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-chip:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.05);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--accent-primary), #0078d4);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.25);
}

.qbank-questions-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.qbank-question-item {
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 3px solid transparent;
}

.qbank-question-item.read {
    opacity: 0.7;
    background: var(--bg-secondary);
}

.qbank-question-item.read:hover {
    opacity: 0.85;
}

.qbank-question-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.qbank-question-item.active {
    background: rgba(0, 120, 212, 0.08);
    border-left-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.qbank-question-item-header {
    display: flex;
    align-items: start;
    gap: 8px;
    margin-bottom: 6px;
}

.qbank-question-item-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    font-weight: 500;
}

.qbank-question-item-meta {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.qbank-question-badge {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.qbank-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
}

.qbank-welcome i {
    font-size: 64px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.qbank-welcome h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.qbank-welcome p {
    font-size: 14px;
}

/* Question Content Area */
.qbank-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.qbank-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-primary);
}

.qbank-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.search-box-inline {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box-inline i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.search-box-inline input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s ease;
}

.search-box-inline input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.qbank-main {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.question-detail-view {
    background: var(--bg-card);
    border-radius: 0;
    padding: 0px;
    box-shadow: none;
    height: 100%;
    overflow-y: auto;
}

.question-detail-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.question-detail-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.question-detail-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
}

.bookmark-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.bookmark-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.1);
}

.bookmark-btn.active {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    border-color: #11998e;
    color: white;
}

.bookmark-btn.active:hover {
    background: linear-gradient(135deg, #0e8078, #2fd66d);
}

.bookmark-btn-large {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    padding: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.bookmark-btn-large:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}

.bookmark-btn-large.active {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    border-color: #11998e;
    color: white;
}

.bookmark-btn-large.active:hover {
    background: linear-gradient(135deg, #0e8078, #2fd66d);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.3);
}

.bookmark-btn i,
.bookmark-btn-large i {
    font-size: 18px;
}

.question-detail-answer {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.question-detail-answer h4 {
    color: var(--accent-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-section {
    margin-top: 24px;
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.qbank-sidebar-modern.collapsed ~ .qbank-toggle-modern ~ .qbank-detail-panel .ai-section {
    padding: 32px;
    min-height: auto;
}

.ai-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.ai-section-title i {
    color: var(--accent-primary);
}

.ai-locked-message {
    padding: 16px;
    background: rgba(255, 170, 68, 0.1);
    border-left: 3px solid var(--warning-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
}

.ai-response-area {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    min-height: 100px;
}

.ai-response-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 14px;
}

.ai-response-header i {
    font-size: 16px;
}

.ai-response-content {
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===== Search and Filter Controls ===== */
.topics-controls {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.filter-sort-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.qbank-filters {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.filter-select:hover {
    border-color: var(--accent-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.questions-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.question-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.question-card.expanded {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.question-header {
    margin-bottom: 12px;
}

.question-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.badge-module {
    background: var(--bg-hover);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.question-text {
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

.question-answer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.answer-content {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.answer-content h4 {
    color: var(--accent-primary);
    margin-top: 16px;
    margin-bottom: 8px;
}

.answer-content pre {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    overflow-x: auto;
}

.answer-content code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.answer-content ul,
.answer-content ol {
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.answer-content li {
    margin-bottom: 4px;
    line-height: 1.6;
}

.ai-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.qbank-sidebar-modern.collapsed ~ .qbank-toggle-modern ~ .qbank-detail-panel .ai-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.ai-action-btn {
    padding: 8px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.qbank-sidebar-modern.collapsed ~ .qbank-toggle-modern ~ .qbank-detail-panel .ai-action-btn {
    padding: 14px 20px;
    font-size: 14px;
    justify-content: center;
}

.ai-action-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.ai-action-btn i {
    font-size: 14px;
}

.ai-response {
    margin-top: 16px;
    background: rgba(0, 120, 212, 0.05);
    border-left: 3px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.ai-response-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 14px;
}

.ai-response-content {
    color: var(--text-primary);
    line-height: 1.6;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* PYQ and Important Badge Styles */
.badge-pyq {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.badge-important {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(245, 87, 108, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.badge-critical {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(56, 239, 125, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.badge-marks {
    background: linear-gradient(135deg, #0078d4 0%, #00bcf2 100%);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 120, 212, 0.3);
}

.qbank-question-item.important {
    border-left: 3px solid #f5576c;
    background: linear-gradient(90deg, rgba(245, 87, 108, 0.05) 0%, var(--bg-card) 100%);
}

.qbank-question-item.pyq {
    border-left: 3px solid #667eea;
}

/* Question Bank Page Header */
#questionbankPage {
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#questionbankPage .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
    background: var(--bg-card);
}

#questionbankPage .page-header>div:first-child {
    flex: 1;
}

#questionbankPage .page-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 600;
}

#questionbankPage .page-header .page-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.qbank-stats-badge {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-primary), #0078d4);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.2);
}

/* ===== Enhanced Markdown Rendering Styles ===== */

/* Code Block Wrapper */
.code-block-wrapper {
    position: relative;
    margin: 16px 0;
    border-radius: 8px;
    background: #282c34;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .code-block-wrapper {
    background: #f6f8fa;
    border-color: var(--border-color);
}

/* Code Block Header */
.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

[data-theme="light"] .code-block-header {
    background: rgba(0, 0, 0, 0.03);
    border-bottom-color: var(--border-color);
}

/* Language Badge */
.code-language-badge {
    font-size: 11px;
    font-weight: 600;
    color: #61dafb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Consolas', 'Monaco', monospace;
}

[data-theme="light"] .code-language-badge {
    color: var(--accent-color);
}

/* Monaco Editor Wrapper - Scrollable container */
.monaco-editor-wrapper {
    position: relative;
    overflow: auto;
    flex: 1;
    min-height: 60px;
}

/* Touch Blocker Overlay - Prevents accidental touches */
.code-touch-blocker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: transparent;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
    touch-action: pan-y pan-x;
}

/* Allow scrolling but prevent selection */
.code-touch-blocker:active {
    cursor: grabbing;
}

/* Code Actions Container */
.code-actions {
    display: flex;
    gap: 6px;
}

/* Code Action Buttons */
.code-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #abb2bf;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 101;
}

.code-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.code-action-btn.copied {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
    color: #4caf50;
}

[data-theme="light"] .code-action-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="light"] .code-action-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

.code-action-btn .ms-Icon {
    font-size: 14px;
}

/* Monaco Editor Wrapper */
.monaco-editor-wrapper {
    border-radius: 6px;
    overflow: hidden;
    background: #1e1e1e;
    min-height: 100px;
    position: relative;
}

[data-theme="light"] .monaco-editor-wrapper {
    background: #ffffff;
}

/* Monaco Touch Blocker - Prevents keyboard popup on touch laptops */
.monaco-touch-blocker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: transparent;
    cursor: default;
    /* Block all touch and pointer events */
    touch-action: pan-y pan-x;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    pointer-events: auto;
}

/* Prevent Monaco from intercepting touches */
.monaco-editor-wrapper .monaco-editor {
    pointer-events: none !important;
}

.monaco-editor-wrapper .monaco-editor * {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Allow scrollbar interaction */
.monaco-editor-wrapper .monaco-scrollable-element {
    pointer-events: auto !important;
}

.monaco-touch-blocker:active {
    cursor: grabbing;
}

/* Code Pre and Code Elements (Fallback) */
.code-block-wrapper pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    background: transparent;
}

.code-block-wrapper code {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #abb2bf;
}

[data-theme="light"] .code-block-wrapper code {
    color: var(--text-primary);
}

/* Inline Code */
.markdown-content code:not(.monaco-editor-wrapper code) {
    background: rgba(110, 118, 129, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: var(--accent-color);
}

[data-theme="light"] .markdown-content code:not(.monaco-editor-wrapper code) {
    background: rgba(175, 184, 193, 0.2);
}

/* Highlight.js Theme Override for Light Mode */
[data-theme="light"] .hljs {
    background: transparent !important;
    color: #24292e !important;
}

[data-theme="light"] .hljs-keyword,
[data-theme="light"] .hljs-selector-tag,
[data-theme="light"] .hljs-title,
[data-theme="light"] .hljs-section,
[data-theme="light"] .hljs-doctag,
[data-theme="light"] .hljs-name,
[data-theme="light"] .hljs-strong {
    color: #d73a49 !important;
}

[data-theme="light"] .hljs-string,
[data-theme="light"] .hljs-title.class_,
[data-theme="light"] .hljs-title.class_.inherited__,
[data-theme="light"] .hljs-title.function_,
[data-theme="light"] .hljs-attr {
    color: #22863a !important;
}

[data-theme="light"] .hljs-comment,
[data-theme="light"] .hljs-quote,
[data-theme="light"] .hljs-deletion {
    color: #6a737d !important;
}

[data-theme="light"] .hljs-number,
[data-theme="light"] .hljs-literal {
    color: #005cc5 !important;
}

/* Responsive Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.markdown-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    min-width: 500px;
}

.markdown-table thead {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: white;
}

.markdown-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.markdown-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.markdown-table tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.05);
}

.markdown-table tbody tr:last-child {
    border-bottom: none;
}

.markdown-table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.markdown-table tbody td code {
    background: rgba(110, 118, 129, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Striped table rows */
.markdown-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .markdown-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Mermaid Diagrams */
.mermaid-diagram {
    margin: 20px 0;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    text-align: center;
}

.mermaid-diagram svg {
    max-width: 100%;
    height: auto;
}

.mermaid-error {
    color: #e74c3c;
    padding: 20px;
    text-align: center;
    font-family: monospace;
    font-size: 13px;
}

/* Scrollbar Styling for Code Blocks and Tables */
.code-block-wrapper pre::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.code-block-wrapper pre::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.code-block-wrapper pre::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.code-block-wrapper pre::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .code-block-wrapper pre::-webkit-scrollbar-thumb,
[data-theme="light"] .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .code-block-wrapper pre::-webkit-scrollbar-thumb:hover,
[data-theme="light"] .table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ===== MOBILE RESPONSIVE DESIGN ===== */

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-medium);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-bottom-nav .nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    margin: 0 4px;
}

.mobile-bottom-nav .nav-btn i {
    font-size: 22px;
}

.mobile-bottom-nav .nav-btn.active {
    color: var(--accent-primary);
    background: rgba(0, 120, 212, 0.1);
}

[data-theme="dark"] .mobile-bottom-nav .nav-btn.active {
    color: var(--accent-primary);
    background: rgba(96, 205, 255, 0.15);
}

.mobile-bottom-nav .nav-btn:active {
    transform: scale(0.95);
}

/* Mobile Top Header */
.mobile-top-header {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mobile-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.mobile-menu-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-menu-btn:active {
    background: var(--hover-bg);
    transform: scale(0.95);
}

.mobile-menu-btn i {
    font-size: 20px;
}

.mobile-header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Desktop/Mobile Toggle Classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Mobile Responsive Breakpoint */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }

    /* Hide desktop sidebar */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Show mobile navigation */
    .mobile-bottom-nav {
        display: flex;
    }

    .mobile-top-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Adjust main content for mobile bars */
    .main-content {
        width: 100%;
        padding: 0;
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
        padding-top: 0;
    }

    .content-body {
        padding: 12px;
        padding-bottom: 24px;
    }

    /* Sharper, more native border radius on mobile */
    .card,
    .module-card,
    .qbank-question-item,
    .question-card,
    .filter-chip,
    .btn,
    .badge {
        border-radius: 8px;
    }

    /* Modern Chatbot Mobile Styles */
    .chatbot-container-modern {
        border-radius: 0;
        height: 100%;
    }

    .chat-header-modern {
        padding: 14px 16px;
        flex-wrap: wrap;
    }

    .chat-header-brand {
        flex: 1 1 100%;
        margin-bottom: 12px;
    }

    .chat-avatar-large {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .chat-header-info h3 {
        font-size: 16px;
    }

    .chat-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .model-dropdown-btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 12px;
    }

    .model-dropdown-menu {
        width: calc(100vw - 32px);
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        max-height: 400px;
    }

    .model-selector-modern.active .model-dropdown-menu {
        transform: translateX(-50%) translateY(0);
    }

    .icon-btn-modern {
        width: 38px;
        height: 38px;
    }

    .chat-messages-modern {
        padding: 16px;
    }

    .chat-welcome-modern {
        padding: 40px 16px;
    }

    .welcome-icon-container {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }

    .welcome-icon-container i {
        width: 80px;
        height: 80px;
        font-size: 40px;
        border-radius: 20px;
    }

    .chat-welcome-modern h3 {
        font-size: 22px;
    }

    .chat-welcome-modern p {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .suggestion-chips-modern {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .chip-modern {
        padding: 12px 16px;
        font-size: 13px;
    }

    .chat-input-modern {
        padding: 14px 16px;
    }

    .chat-input-wrapper-modern {
        padding: 6px;
    }

    .input-action-btn {
        display: none;
    }

    .send-btn-modern {
        width: 38px;
        height: 38px;
    }

    .input-footer {
        margin-top: 10px;
    }

    .input-footer p {
        font-size: 10px;
    }

    .code-block-wrapper {
        border-radius: 6px;
    }

    /* Mobile Page Headers */
    .page-header {
        padding: 10px;
    }

    .mobile-page-header {
        padding: 8px 12px;
        background: var(--card-bg);
    }

    /* Question Bank Mobile Layout */
    .qbank-layout {
        flex-direction: column;
        height: auto;
    }

    .qbank-sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
    }

    .qbank-content {
        flex: 1;
        height: auto;
        min-height: 50vh;
    }

    .qbank-main {
        padding: 10px;
    }

    /* Question items more compact on mobile */
    .qbank-question-item {
        padding: 10px;
        margin-bottom: 4px;
    }

    .qbank-question-item-text {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Mobile filter chips */
    .qbank-filter-chips {
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 6px;
    }

    .filter-chip {
        white-space: nowrap;
        font-size: 11px;
        padding: 6px 10px;
    }

    /* Reduce margins for headings on mobile */
    .content-body h1,
    .content-body h2,
    .content-body h3 {
        margin-bottom: 10px;
    }

    .content-body h4,
    .content-body h5 {
        margin-bottom: 8px;
    }

    /* Reduce paragraph and list spacing */
    .content-body p {
        margin-bottom: 10px;
    }

    .content-body ul,
    .content-body ol {
        margin-bottom: 10px;
    }

    .content-body li {
        margin-bottom: 4px;
    }

    /* Hero section mobile */
    .hero-section {
        padding: 16px 12px;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-number {
        font-size: 28px;
    }

    .stat-label {
        font-size: 12px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 8px;
    }

    .hero-actions button {
        width: 100%;
    }

    /* Quick Access Grid Mobile */
    .quick-access-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Module Overview Mobile */
    .module-overview-grid {
        grid-template-columns: 1fr;
    }

    /* Topics Controls Mobile */
    .topics-controls {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }

    .search-box {
        width: 100%;
    }

    .filter-sort-group {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .filter-select {
        width: 100%;
    }

    /* Module Cards Mobile */
    .module-card {
        padding: 12px;
        margin-bottom: 8px;
    }

    .module-card-header {
        margin-bottom: 8px;
    }

    /* Tighter card spacing */
    .card {
        padding: 12px;
        margin-bottom: 8px;
    }

    .card-header {
        margin-bottom: 8px;
    }

    .card-title {
        font-size: 15px;
        margin-bottom: 6px;
    }

    /* Chat Interface Mobile */
    .chatbot-container {
        height: calc(100vh - 110px);
    }

    .chat-header {
        padding: 8px 12px;
        flex-wrap: wrap;
    }

    .chat-messages {
        padding: 12px;
    }

    .message {
        max-width: 85%;
    }

    /* Settings Mobile */
    .settings-container {
        padding: 12px;
    }

    .settings-quick-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .settings-quick-card {
        padding: 16px;
    }

    .quick-card-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .settings-section-modern {
        padding: 16px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        align-items: center;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

    .setting-label {
        width: 100%;
    }

    .setting-value {
        width: 100%;
    }

    .toggle-group {
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
        justify-content: center;
    }

    .api-keys-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .api-key-container {
        flex-direction: column;
        width: 100%;
    }

    /* Modern Question Bank Mobile */
    .qbank-header-top {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .qbank-title-section {
        width: 100%;
    }

    .qbank-icon-badge {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .qbank-title-section h2 {
        font-size: 20px;
    }

    .qbank-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .qbank-stats-card {
        padding: 10px 16px;
        font-size: 13px;
    }

    .qbank-filter-bar {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }

    .qbank-search-container {
        width: 100%;
    }

    .qbank-search-input {
        padding: 10px 40px 10px 40px;
        font-size: 13px;
    }

    .qbank-filter-row {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .module-selector-modern {
        width: 100%;
        min-width: auto;
    }

    .filter-chips-modern {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .chip-filter {
        flex-shrink: 0;
    }

    .qbank-layout-modern {
        display: flex;
        height: calc(100% - 240px);
    }

    .qbank-sidebar-modern {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        border-right: none;
    }

    .qbank-sidebar-modern.collapsed {
        width: 100% !important;
        min-width: 100% !important;
    }

    .qbank-resize-handle-modern {
        display: none;
    }

    .qbank-toggle-modern {
        display: none !important;
    }

    .qbank-questions-grid {
        padding: 12px;
    }

    .qbank-question-card {
        padding: 14px;
        margin-bottom: 10px;
    }

    .qbank-detail-panel {
        display: none;
    }

    .qbank-detail-panel.active {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        z-index: 2000;
        background: var(--bg-primary);
        padding: 16px;
        overflow-y: auto;
    }

    #questionDetailArea {
        display: none;
    }

    #questionDetailArea.active {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 60px;
        z-index: 2000;
        background: var(--bg-primary);
        padding: 16px;
        overflow-y: auto;
    }

    .mobile-detail-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        background: rgba(30, 30, 30, 0.95);
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 0;
        position: sticky;
        top: 0;
        z-index: 100;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .mobile-detail-header span {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .btn-back {
        background: rgba(99, 102, 241, 0.1);
        border: none;
        color: #6366f1;
        font-size: 20px;
        cursor: pointer;
        padding: 8px 12px;
        border-radius: 8px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-back:hover {
        background: rgba(99, 102, 241, 0.2);
        transform: translateX(-2px);
    }

    .mobile-detail-header .bookmark-btn {
        background: rgba(99, 102, 241, 0.1);
        border: none;
        color: #6366f1;
        font-size: 18px;
        cursor: pointer;
        padding: 8px 12px;
        border-radius: 8px;
        transition: all 0.2s ease;
    }

    .mobile-detail-header .bookmark-btn.active {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
    }

    .welcome-graphic {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .qbank-welcome-modern h3 {
        font-size: 22px;
    }

    .welcome-stats {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .stat-item {
        width: 100%;
        justify-content: center;
    }

    .api-key-container input,
    .api-key-container button {
        width: 100%;
    }

    /* Code blocks mobile */
    .code-block-wrapper {
        margin: 8px 0;
    }

    .code-block-wrapper pre {
        font-size: 12px;
        padding: 10px;
    }

    .code-language-badge {
        font-size: 10px;
    }

    .code-action-btn {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }

    /* Tables mobile - force scrolling */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .markdown-table {
        min-width: 100%;
        font-size: 13px;
    }

    .markdown-table thead th,
    .markdown-table tbody td {
        padding: 6px 10px;
        font-size: 13px;
    }

    /* Question Detail Mobile */
    .question-detail-view {
        padding: 0;
    }

    .question-detail-header {
        padding: 10px 12px;
        background: rgba(30, 30, 30, 0.95);
        position: sticky;
        top: 64px;
        z-index: 10;
        border-bottom: 1px solid var(--border-color);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }

    .question-detail-title {
        font-size: 16px;
        line-height: 1.4;
    }

    .question-detail-answer {
        padding: 12px;
    }

    .question-detail-answer h4 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    /* AI Section Mobile */
    .ai-section {
        margin: 10px;
        margin-top: 0;
    }

    .ai-actions {
        flex-direction: column;
    }

    .ai-action-btn {
        width: 100%;
        justify-content: center;
    }

    /* Badges mobile */
    .badge,
    .badge-pyq,
    .badge-important,
    .badge-marks {
        font-size: 10px;
        padding: 3px 8px;
    }

    /* Modal mobile */
    .modal-content {
        width: 90%;
        max-width: 400px;
        margin: 20px;
    }

    /* Sidebar overlay always visible on mobile when sidebar active */
    .sidebar-overlay.active {
        display: block;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .mobile-header-title {
        font-size: 16px;
    }

    .hero-section h1 {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .stat-number {
        font-size: 24px;
    }

    .qbank-question-item-text {
        font-size: 13px;
    }

    .question-detail-title {
        font-size: 15px;
    }

    .markdown-table {
        font-size: 12px;
    }

    .code-block-wrapper pre {
        font-size: 11px;
    }
}

/* Landscape mode adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .qbank-sidebar {
        max-height: 35vh;
    }

    .chatbot-container {
        height: calc(100vh - 90px);
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .mobile-bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .mobile-top-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
}