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

:root {
    /* Light Mode Colors - Professional Light Theme */
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #6366f1;
    --accent-color: #818cf8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    --bg-gradient-start: #f0f4f8;
    --bg-gradient-end: #e8f0f5;
}

[data-theme="dark"] {
    /* Dark Mode Colors - Enhanced Professional Dark Theme */
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary-color: #a78bfa;
    --accent-color: #c4b5fd;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    --text-color: #f9fafb;
    --text-light: #e5e7eb;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 5px 20px rgba(0, 0, 0, 0.6);
    --bg-gradient-start: #1e293b;
    --bg-gradient-end: #0f172a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}


[data-theme="dark"] .navbar {
    background: rgba(30, 41, 59, 0.95);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 1rem;
    flex-wrap: nowrap;
}

.nav-brand {
    flex-shrink: 0;
    min-width: 0;
}

.nav-brand h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    white-space: nowrap;
    margin: 0;
}

.nav-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

/* Hamburger Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-user {
    color: var(--text-light);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    padding: 0.5rem 0.75rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nav-link span {
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.theme-toggle i {
    font-size: 1rem;
}

/* Color Palette Dropdown */
.color-palette-dropdown {
    position: relative;
}

.dropdown-toggle {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-family: inherit;
}

.dropdown-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.dropdown-toggle i:last-child {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.dropdown-toggle.active i:last-child {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
}

.color-palette-options {
    padding: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.palette-option-small {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color);
    position: relative;
}

.palette-option-small:hover {
    background: var(--bg-color);
}

.palette-option-small.selected {
    background: var(--bg-color);
    font-weight: 500;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: inline-block;
    flex-shrink: 0;
}

.palette-option-small span:not(.color-dot) {
    flex: 1;
}

.check-icon {
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.875rem;
}

.palette-option-small.selected .check-icon {
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.25);
    color: #10b981;
    border-left-color: #10b981;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--error-color);
}

[data-theme="dark"] .alert-error {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    border-left-color: #ef4444;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

[data-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
    border-left-color: #3b82f6;
}

.alert-close {
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.alert-close:hover {
    opacity: 1;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    animation: fadeInUp 0.5s ease;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.9;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-light);
    font-size: 1rem;
}

.auth-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group label i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
}

select.form-control {
    cursor: pointer;
}

select.form-control option {
    background: var(--card-bg);
    color: var(--text-color);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn-primary i,
.btn-success i,
.btn-warning i {
    margin-right: 0.5rem;
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-color);
}

.btn-warning:hover {
    background: #dd6b20;
    color: white;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 2rem;
    color: var(--text-color);
}

.dashboard-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-header h1 i,
.dashboard-header h2 i,
.dashboard-header h3 i {
    margin-right: 0.5rem;
    opacity: 0.9;
}

.dashboard-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.stat-icon i {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0;
}

.stat-info p {
    color: var(--text-light);
    margin: 0;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.card-header h2 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-color);
    transition: background 0.3s ease;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.data-table th i {
    margin-right: 0.5rem;
    color: var(--primary-color);
    opacity: 0.7;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--bg-color);
    transition: background 0.3s ease;
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.1);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

[data-theme="dark"] .badge-success {
    background: rgba(16, 185, 129, 0.3);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

[data-theme="dark"] .badge-warning {
    background: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

[data-theme="dark"] .badge-info {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

/* Welcome Card */
.welcome-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    opacity: 0.9;
}

.welcome-icon i {
    font-size: 4rem;
}

.welcome-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-box {
    background: var(--bg-color);
    border-left: 4px solid var(--info-color);
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1.5rem;
    text-align: left;
    transition: background 0.3s ease;
}

.info-box i {
    margin-right: 0.5rem;
    color: var(--info-color);
}

/* Quick Actions */
.quick-actions {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.quick-actions h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.action-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.action-icon i {
    font-size: 2.5rem;
}

.action-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.action-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-light);
    margin-top: auto;
    transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .footer {
    background: rgba(30, 41, 59, 0.95);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.text-center {
    text-align: center;
}

/* Content Management */
.content-management {
    margin-top: 3rem;
}

.section-title {
    color: var(--text-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-title i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.subject-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.subject-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .subject-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.subject-header:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

[data-theme="dark"] .subject-header:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.subject-header h3 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subject-header h3 i {
    margin-right: 0.5rem;
}

.section-count {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: normal;
}

.collapse-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.collapsible-header.active .collapse-icon {
    transform: rotate(180deg);
}

.sections-container {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 1.5rem;
}

.sections-container.collapsed {
    max-height: 0;
    padding: 0 1.5rem;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.sections-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sections-list .section-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.sections-list .section-card .section-header {
    margin-bottom: 0;
    flex: 1;
}

.sections-list .section-card .section-description {
    margin: 0 1.5rem;
    flex: 1;
}

.sections-list .section-card .btn {
    margin-top: 0;
    width: auto;
    min-width: 150px;
}

.content-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.content-items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-items-list .content-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.content-items-list .content-item-card .content-item-header {
    margin-bottom: 0;
    flex: 1;
}

.content-items-list .content-item-card .content-description {
    margin: 0 1.5rem;
    flex: 1;
}

.content-items-list .content-item-card .btn {
    margin-top: 0;
    width: auto;
    min-width: 150px;
}

.section-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.section-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    background: var(--bg-color);
}

[data-theme="dark"] .section-card:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

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

.section-header h4 {
    color: var(--text-color);
    margin: 0;
    font-size: 1.1rem;
}

.item-count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 500;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.section-actions .btn {
    flex: 1;
    min-width: 120px;
}

.content-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    margin-left: auto;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-toggle-btn:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
}

.view-toggle-btn i {
    font-size: 1rem;
}

.content-form {
    max-width: 100%;
}

/* Content Display Styles */
.content-display {
    line-height: 1.8;
    color: var(--text-color);
}

.content-display h1 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 700;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
}

.content-display h2 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.6rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.content-display h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.content-display h3:first-child {
    margin-top: 0;
}

.content-display h4 {
    color: var(--primary-color);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.content-display h5,
.content-display h6 {
    color: var(--primary-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.content-display p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.content-display ul, .content-display ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.content-display li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.content-display strong {
    color: var(--primary-color);
    font-weight: 600;
}

.content-display em {
    color: var(--text-light);
    font-style: italic;
}

.content-display code {
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .content-display code {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.3);
}

.content-display blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-style: italic;
}

[data-theme="dark"] .content-display blockquote {
    background: rgba(139, 92, 246, 0.1);
    border-left-color: #8b5cf6;
    padding: 1rem;
    border-radius: 4px;
}

/* Content Browse Styles */
.content-items-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-item-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.content-item-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

[data-theme="dark"] .content-item-card:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.content-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.content-item-header h3 {
    margin: 0;
    color: var(--primary-color);
    flex: 1;
}

.content-date {
    color: var(--text-light);
    font-size: 0.875rem;
    white-space: nowrap;
}

.content-description {
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.content-meta {
    color: var(--text-light);
}

.text-muted {
    color: var(--text-light);
    font-size: 0.9rem;
}

.section-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

/* Quiz Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--bg-color);
    border-radius: 0 0 12px 12px;
}

.quiz-question {
    transition: all 0.3s ease;
}

.quiz-question:hover {
    box-shadow: var(--shadow);
}

.quiz-options label:hover {
    border-color: var(--primary-color) !important;
    background: var(--bg-color) !important;
}

.quiz-options input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

/* Assignment Checkbox Styles */
.assignment-checkbox {
    transition: all 0.2s ease;
}

.assignment-checkbox:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.assignment-checkbox input[type="checkbox"]:checked + div {
    color: var(--primary-color);
}

.assignment-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.checkbox-group {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-light);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Color Palette Selector */
.color-palette-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.palette-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.palette-option:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.palette-option.selected {
    border-color: var(--primary-color);
    border-width: 3px;
    background: var(--bg-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.palette-preview {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: inline-block;
}

.palette-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* Dark Theme Heading & Title Improvements */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-color);
}

[data-theme="dark"] h1 {
    color: #c4b5fd;
    text-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] h2 {
    color: #a78bfa;
}

[data-theme="dark"] h3 {
    color: #8b5cf6;
}

[data-theme="dark"] h4 {
    color: #a78bfa;
}

[data-theme="dark"] .dashboard-header h1 {
    color: #c4b5fd;
    text-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

[data-theme="dark"] .dashboard-header h2,
[data-theme="dark"] .dashboard-header h3 {
    color: #a78bfa;
}

[data-theme="dark"] .auth-header h1 {
    color: #8b5cf6;
    text-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .card-header h2 {
    color: #a78bfa;
}

[data-theme="dark"] .welcome-card h2 {
    color: #8b5cf6;
}

[data-theme="dark"] .quick-actions h3 {
    color: #a78bfa;
}

[data-theme="dark"] .action-card h4 {
    color: #8b5cf6;
}

[data-theme="dark"] .section-title {
    color: #c4b5fd;
    border-bottom-color: rgba(139, 92, 246, 0.5);
}

[data-theme="dark"] .section-title i {
    color: #8b5cf6;
}

[data-theme="dark"] .subject-header h3 {
    color: white;
}

[data-theme="dark"] .section-header h4 {
    color: #a78bfa;
}

[data-theme="dark"] .content-item-header h3 {
    color: #8b5cf6;
}

[data-theme="dark"] .stat-info h3 {
    color: #8b5cf6;
}

[data-theme="dark"] .modal-header h2 {
    color: white;
}

[data-theme="dark"] .nav-brand h2 {
    color: #8b5cf6;
    text-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

/* Dark Theme Content Overrides */
[data-theme="dark"] .content-display,
[data-theme="dark"] .multiplication-table-wrapper,
[data-theme="dark"] .number-types-content {
    color: var(--text-color);
}

[data-theme="dark"] .content-display h1 {
    color: #c4b5fd !important;
    border-bottom-color: rgba(139, 92, 246, 0.5) !important;
    text-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .content-display h2 {
    color: #a78bfa !important;
    border-bottom-color: rgba(139, 92, 246, 0.4) !important;
}

[data-theme="dark"] .content-display h3 {
    color: #8b5cf6 !important;
    border-bottom-color: rgba(139, 92, 246, 0.3) !important;
}

[data-theme="dark"] .content-display h4 {
    color: #a78bfa !important;
}

[data-theme="dark"] .content-display h5,
[data-theme="dark"] .content-display h6 {
    color: #c4b5fd !important;
}

/* Override any inline styles in content for headings */
[data-theme="dark"] .content-display h1[style*="color"],
[data-theme="dark"] .content-display h2[style*="color"],
[data-theme="dark"] .content-display h3[style*="color"],
[data-theme="dark"] .content-display h4[style*="color"] {
    color: #a78bfa !important;
}

[data-theme="dark"] .content-display div[style*="background"] {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .content-display div[style*="background: #e3f2fd"],
[data-theme="dark"] .content-display div[style*="background:#e3f2fd"] {
    background: rgba(59, 130, 246, 0.15) !important;
    border-left-color: #3b82f6 !important;
}

[data-theme="dark"] .content-display div[style*="background: #f0f7ff"],
[data-theme="dark"] .content-display div[style*="background:#f0f7ff"] {
    background: rgba(59, 130, 246, 0.15) !important;
    border-left-color: #3b82f6 !important;
}

[data-theme="dark"] .content-display div[style*="background: #fff3cd"],
[data-theme="dark"] .content-display div[style*="background:#fff3cd"] {
    background: rgba(245, 158, 11, 0.15) !important;
    border-left-color: #f59e0b !important;
}

[data-theme="dark"] .content-display div[style*="background: #f5f5f5"],
[data-theme="dark"] .content-display div[style*="background:#f5f5f5"] {
    background: rgba(51, 65, 85, 0.5) !important;
}

[data-theme="dark"] .content-display div[style*="background: white"],
[data-theme="dark"] .content-display div[style*="background:white"] {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .content-display table {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .content-display table th {
    background: rgba(139, 92, 246, 0.2) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .content-display table td {
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

[data-theme="dark"] .content-display table tbody tr:nth-child(even) {
    background: rgba(51, 65, 85, 0.3) !important;
}

[data-theme="dark"] .content-display table tbody tr:hover {
    background: rgba(139, 92, 246, 0.2) !important;
}

[data-theme="dark"] .content-display div[style*="color: white"] {
    color: var(--text-color) !important;
}

[data-theme="dark"] .content-display div[style*="background: linear-gradient"] {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }

    .nav-brand {
        flex: 1;
    }

    .nav-controls {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .nav-controls .control-label {
        display: none;
    }

    .nav-controls .theme-toggle {
        padding: 0.5rem;
        min-width: auto;
        width: auto;
    }

    .nav-controls .theme-toggle i {
        margin: 0;
    }

    .nav-controls .dropdown-toggle {
        padding: 0.5rem;
        min-width: auto;
        width: auto;
    }

    .nav-controls .dropdown-toggle span {
        display: none;
    }

    .nav-controls .dropdown-toggle i:first-child {
        margin: 0;
    }

    .nav-controls .dropdown-toggle i:last-child {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    /* Mobile Menu - Completely hidden when collapsed */
    .nav-menu {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 20px;
        right: 20px;
        width: calc(100% - 40px);
        display: none;
        flex-direction: column;
        background: var(--card-bg);
        border-radius: 8px;
        box-shadow: var(--shadow-lg);
        margin: 0;
        padding: 0;
        height: 0;
        min-height: 0;
        max-height: 0;
        overflow: hidden;
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: visible;
    }

    /* Menu Items */
    .nav-menu > * {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .nav-menu .nav-link,
    .nav-menu .nav-user {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.6rem 1rem;
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu .nav-link:last-child {
        border-bottom: none;
    }

    .nav-menu .nav-link:hover {
        background: var(--primary-color);
        color: white;
    }

    
    .dropdown-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .nav-controls .dropdown-menu {
        right: 0;
        left: auto;
        transform: translateY(-10px);
        min-width: 280px;
        position: absolute;
        top: calc(100% + 0.5rem);
        margin-top: 0;
    }
    
    .nav-controls .dropdown-menu.show {
        transform: translateY(0);
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

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

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}


