/* ========================================
   UPDATED LAYOUT - SIMPLIFIED VERSION
   ======================================== */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;

    --border-color: #e5e7eb;
    --border-light: #f3f4f6;

    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;

    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;

    --border-color: #374151;
    --border-light: #4b5563;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========================================
   APP LAYOUT
   ======================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 28px;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 0 12px 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.sidebar.collapsed .user-info {
    display: none;
}

.sidebar-nav {
    padding: 0 12px;
    position: relative;
}

/* NAV WRAP - Container cho bubble effect - KÍCH THƯỚC BAN ĐẦU */
.nav-wrap {
    border: 1px solid rgba(102, 126, 234, 0.3);
    width: 100%;
    max-width: 280px;
    margin: 12px auto;
    border-radius: 25px;
    position: relative;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.1),
        0 6px 20px rgba(102, 126, 234, 0.15);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.98),
            rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(15px);
    padding: 4px;
}

.nav-wrap::after {
    content: "";
    display: block;
    position: absolute;
    inset: -3px;
    background: linear-gradient(180deg,
            rgba(102, 126, 234, 0.12),
            rgba(118, 75, 162, 0.12));
    border-radius: 28px;
    z-index: -1;
}

/* Dark mode nav-wrap */
body.dark-mode .nav-wrap {
    border: 1px solid rgba(102, 126, 234, 0.4);
    background: linear-gradient(180deg,
            rgba(30, 30, 40, 0.98),
            rgba(20, 20, 30, 0.98));
}

body.dark-mode .nav-wrap::after {
    background: linear-gradient(180deg,
            rgba(102, 126, 234, 0.18),
            rgba(118, 75, 162, 0.18));
}

.sidebar-nav {
    width: 100%;
    anchor-name: --nav;
    margin: 0;
    padding: 8px;
}

/* BUBBLE EFFECTS - KÍCH THƯỚC BAN ĐẦU */
.bubble {
    background: white;
    top: anchor(top);
    right: anchor(right);
    bottom: anchor(bottom);
    left: anchor(left);
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    pointer-events: none;
}

.bubble.active {
    position-anchor: --active;
    z-index: 2;
    background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.95),
            rgba(118, 75, 162, 0.95));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 6px 20px rgba(102, 126, 234, 0.4);
}

.bubble.hover {
    z-index: 1;
    background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.15),
            rgba(118, 75, 162, 0.15));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position-anchor: --nav;
    opacity: 0;
}

/* Dark mode bubbles */
body.dark-mode .bubble.active {
    background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.9),
            rgba(118, 75, 162, 0.9));
}

body.dark-mode .bubble.hover {
    background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.18),
            rgba(118, 75, 162, 0.18));
}

.nav-item {
    z-index: 10;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 20px;
    min-height: 52px;
}

.nav-item::before {
    content: "";
    display: block;
    position: absolute;
    inset: 0;
    opacity: 0;
    border-radius: 20px;
    transition: opacity 0.3s ease;
}

/* CHỮ NỔI BẬT VỪA PHẢI KHI ĐƯỢC CHỌN */
.nav-item.active {
    anchor-name: --active;
    color: #ffffff !important;
    font-weight: 650;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

.nav-item:hover::before {
    anchor-name: --nav;
    opacity: 0.08;
    background: rgba(102, 126, 234, 0.2);
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-item span {
    transition: all 0.3s ease;
    flex: 1;
}

/* BADGE HOT/NEW/AI - NOTIFICATION BADGE Ở GÓC TRÊN - KÍCH THƯỚC LỚN HƠN */
.nav-item-badge {
    position: absolute;
    top: 12px;
    right: 16px;
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
    font-size: 7px;
    font-weight: 800;
    padding: 0;
    border-radius: 50%;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.4);
    animation: pulse-badge 3s ease-in-out infinite;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 15;
}

.nav-item-badge.new {
    background: linear-gradient(135deg, #2ed573, #1dd1a1);
    box-shadow: 0 2px 4px rgba(46, 213, 115, 0.4);
}

.nav-item-badge.hot {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.4);
}

.nav-item-badge.ai {
    background: linear-gradient(135deg, #a55eea, #8854d0);
    box-shadow: 0 2px 4px rgba(165, 94, 234, 0.4);
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.03);
        opacity: 0.9;
    }
}

/* HIỆU ỨNG KHI HOVER - NHẸ NHÀNG HƠN */
.nav-item:hover {
    color: var(--primary-color);
    transform: translateX(1px);
}

.nav-item:hover i {
    transform: scale(1.05);
}

.nav-item.active i {
    transform: scale(1.08);
    color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

.nav-item.active span {
    color: #ffffff !important;
}

.nav-item.active .nav-item-badge {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--primary-color) !important;
    box-shadow: 0 1px 4px rgba(255, 255, 255, 0.4) !important;
    font-weight: 900;
}
}

.nav-item-badge.hot {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.nav-item-badge.ai {
    background: linear-gradient(135deg, #a55eea, #8854d0);
    box-shadow: 0 2px 6px rgba(165, 94, 234, 0.3);
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* HIỆU ỨNG KHI HOVER */
.nav-item:hover {
    color: var(--primary-color);
    transform: translateX(2px);
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item.active i {
    transform: scale(1.15);
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.nav-item.active span {
    color: #ffffff !important;
}

.nav-item.active .nav-item-badge {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3) !important;
}

/* Admin badge styling - NOTIFICATION BADGE Ở GÓC TRÊN - KÍCH THƯỚC LỚN HƠN */
.admin-only-badge {
    position: absolute;
    top: 12px;
    right: 16px;
    background: linear-gradient(135deg, #ffa502, #ff6348);
    color: white;
    font-size: 7px;
    font-weight: 800;
    padding: 0;
    border-radius: 50%;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(255, 165, 2, 0.4);
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 15;
}

.nav-item.active .admin-only-badge {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #ffa502 !important;
    box-shadow: 0 1px 4px rgba(255, 255, 255, 0.4) !important;
    font-weight: 900;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item-badge,
.sidebar.collapsed .admin-only-badge {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-wrap {
        max-width: 260px;
        margin: 10px auto;
        border-radius: 22px;
        padding: 3px;
    }

    .nav-wrap::after {
        border-radius: 25px;
    }

    .nav-item {
        padding: 14px 18px;
        font-size: 14px;
        min-height: 48px;
        gap: 12px;
    }

    .nav-item i {
        font-size: 16px;
        width: 18px;
    }

    .bubble,
    .nav-item,
    .nav-item::before {
        border-radius: 18px;
    }

    .nav-item-badge,
    .admin-only-badge {
        font-size: 6px;
        width: 12px;
        height: 12px;
        top: 10px;
        right: 14px;
    }
}

/* Collapsed sidebar adjustments */
.sidebar.collapsed .nav-wrap {
    max-width: 64px;
    margin: 10px auto;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 16px 12px;
}

.sidebar.collapsed .bubble {
    border-radius: 18px;
}

/* CSS Anchor Positioning Fallback */
@supports not (anchor-name: --test) {

    /* Fallback cho trình duyệt chưa hỗ trợ CSS Anchor Positioning */
    .bubble {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: translateY(0);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-item:first-child.active~.bubble.active {
        transform: translateY(0);
    }

    .nav-item:nth-child(2).active~.bubble.active {
        transform: translateY(calc(100% + 3px));
    }

    .nav-item:nth-child(3).active~.bubble.active {
        transform: translateY(calc(200% + 6px));
    }

    .nav-item:nth-child(4).active~.bubble.active {
        transform: translateY(calc(300% + 9px));
    }

    .nav-item:nth-child(5).active~.bubble.active {
        transform: translateY(calc(400% + 12px));
    }

    .nav-item:nth-child(6).active~.bubble.active {
        transform: translateY(calc(500% + 15px));
    }

    .nav-item:nth-child(7).active~.bubble.active {
        transform: translateY(calc(600% + 18px));
    }

    .nav-item:nth-child(8).active~.bubble.active {
        transform: translateY(calc(700% + 21px));
    }

    .nav-item:nth-child(9).active~.bubble.active {
        transform: translateY(calc(800% + 24px));
    }
}

/* Animation cho bubble khi load trang */
@keyframes bubbleSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.bubble.active {
    animation: bubbleSlideIn 0.4s ease-out;
}

/* Hiệu ứng ripple khi click */
.nav-item {
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
    z-index: 0;
}

.nav-item:active::after {
    width: 200px;
    height: 200px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.copyright {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

.sidebar.collapsed .copyright {
    display: none;
}

/* ========================================
   MAIN WRAPPER
   ======================================== */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar.collapsed~.main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* ========================================
   TOP HEADER
   ======================================== */
.top-header {
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.current-quiz-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.quiz-name {
    font-weight: 600;
    font-size: 14px;
}

.header-center {
    flex: 1;
    max-width: 500px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 16px;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-bar i {
    color: var(--text-tertiary);
}

.search-bar input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-create-quiz,
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-create-quiz {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-create-quiz:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.theme-toggle-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 10px;
    width: 40px;
    height: 40px;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background: var(--bg-tertiary);
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.main-content-area {
    flex: 1;
    padding: 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

/* ========================================
   STATS SECTION
   ======================================== */
.stats-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-icon.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

/* ========================================
   RECENT SECTION
   ======================================== */
.recent-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

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

.view-more {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.view-more:hover {
    color: var(--primary-dark);
}

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

.empty-state-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.empty-state-card i {
    font-size: 48px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.empty-state-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ========================================
   FEATURES SECTION
   ======================================== */
.features-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
}

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

.feature-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.feature-icon i {
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.btn-paste-inline {
    position: absolute;
    right: 0;
    top: 0;
    padding: 6px 12px;
    background: var(--info-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-paste-inline:hover {
    background: #2563eb;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-textarea.large {
    min-height: 200px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

/* ========================================
   QUIZ START CARD
   ======================================== */
.quiz-start-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.quiz-controls-modern {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quiz-control-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--bg-tertiary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* ========================================
   QUIZ MANAGE LIST
   ======================================== */
.quiz-manage-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .header-center {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 16px;
    }

    .header-left {
        display: none;
    }

    .btn-create-quiz span {
        display: none;
    }

    .main-content-area {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quiz-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}