/* Define Light and Dark Mode Colors */
:root {
    /* Light Mode */
    --primary: #f9fafb;
    --secondary: #f3f4f6;
    --accent: #60a5fa;
    --background: #f5f7fa;
    --text-primary: #1a2a44;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --card-background: #ffffff;
    --sidebar-background: #1a2a44;
    --sidebar-bg: #1f493d;
    --sidebar-text: #e5e7eb;
    --sidebar-text-hover: #ffffff;
    --sidebar-active: #3b82f6;
    --border: #e6e6e6;
    --shadow: rgba(0, 0, 0, 0.05);
    --alternate-bg: #f9fafb;
    --subcategory-bg: #fafafa;
    --category-hover: #f1f5f9;
    --logout-text: #ff6b6b;
}

[data-theme="dark"] {
    /* Dark Mode */
    --primary: #1e293b;
    --secondary: #374151;
    --accent: #60a5fa;
    --background: #1a1a1a;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --card-background: #2d2d2d;
    --sidebar-background: #121212;
    --sidebar-text: #ffffff;
    --sidebar-text-hover: #e5e7eb;
    --sidebar-active: #2563eb;
    --border: #444444;
    --shadow: rgba(255, 255, 255, 0.05);
    --alternate-bg: #252525;
    --subcategory-bg: #2a2a2a;
    --category-hover: #3a3a3a;
    --logout-text: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* General Layout */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    background: var(--background);
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Left Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-background);
    color: var(--sidebar-text);
    padding: 20px;
    position: fixed;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.logo-image {
    width: 40px;
    height: 40px;
    margin-right: 12px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.toggle-label {
    font-size: 14px;
    color: var(--sidebar-text);
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #3b82f6;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Dashboard Styles */
.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    width: 220px;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 1.5rem;
}

.sidebar .logo {
    color: var(--sidebar-text);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav a.active {
    background: var(--accent);
    color: var(--primary);
}

.sidebar-account {
    margin-top: auto;
}

.sidebar-account ul {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.sidebar-account a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.sidebar-account a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    padding: 0.75rem 0;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Main Content Area */
.main-content {
    width: calc(100% - 250px);
    margin-left: 250px;
    padding: 30px 40px;
    background: var(--background);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.page-header .subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Categories Section */
.categories-section {
    background: var(--card-background);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
}

.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.categories-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.total-questions {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    border-bottom: 1px solid var(--border);
}

.category-item:last-child {
    border-bottom: none;
}

.category-item.alternate {
    background: var(--alternate-bg);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
}

.category-header:hover {
    background: var(--category-hover);
}

.category-name {
    font-weight: 500;
    flex: 1;
}

.question-range {
    font-weight: 400;
    color: var(--text-secondary);
    margin-right: 20px;
}

.chevron {
    font-size: 14px;
    color: var(--text-secondary);
}

.subcategories {
    list-style: none;
    padding: 0 20px 15px 40px;
    margin: 0;
    background: var(--subcategory-bg);
}

.subcategories li {
    font-size: 14px;
    color: var(--text-tertiary);
    padding: 8px 0;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 15px;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 15px;
    }

    .category-header {
        flex-wrap: wrap;
        gap: 5px;
        padding: 10px 15px;
    }

    .question-range {
        font-size: 14px;
        margin-right: 10px;
    }

    .subcategories {
        padding: 0 15px 10px 30px;
    }

    .subcategories li {
        font-size: 13px;
    }

    .logo-image {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 18px;
    }
}

@media (min-width: 1201px) {
    .main-content {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        padding: 30px 0;
    }

    .sidebar + .main-content {
        margin-left: 300px;
    }

}
