/* 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: #fafafa;
    --sidebar-text-hover: #ffffff;
    --sidebar-active: #3b82f6;
    --border: #e6e6e6;
    --shadow: rgba(0, 0, 0, 0.05);
    --progress-fill: #3b82f6;
    --logout-text: #ff6b6b;
    --input-bg: #ffffff;
    --input-border: #e6e6e6;
}

[data-theme="dark"] {
    /* Dark Mode */
    --background: #1a1a1a;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --card-background: #2d2d2d;
    --sidebar-background: #121212;
    --sidebar-text: #9ca3af;
    --sidebar-text-hover: #e5e7eb;
    --sidebar-active: #2563eb;
    --border: #444444;
    --shadow: rgba(255, 255, 255, 0.05);
    --progress-fill: #60a5fa;
    --logout-text: #f87171;
    --input-bg: #3a3a3a;
    --input-border: #555555;
}

* {
    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);
}

/* Header Section */
.page-header {
    margin-bottom: 30px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text-primary);
}

/* Category Selection Section */
.category-selection-section {
    display: flex;
    gap: 30px;
}

/* Category List */
.category-list {
    flex: 1;
    background: var(--card-background);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
}

.category-list h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.categories {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 500px;
    overflow-y: auto;
}

.categories li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.categories li:last-child {
    border-bottom: none;
}

.categories label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
}

.categories input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Exam Summary Card */
.exam-summary-card {
    width: 300px;
    background: var(--card-background);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.exam-icon {
    font-size: 40px;
    color: var(--progress-fill);
    margin-bottom: 15px;
}

.exam-summary-card h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.exam-summary-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.start-button {
    padding: 10px 20px;
    background: var(--progress-fill);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.start-button:hover {
    background: #2563eb;
}

/* 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-selection-section {
        flex-direction: column;
        gap: 20px;
    }

    .exam-summary-card {
        width: 100%;
    }

    .category-list h2 {
        font-size: 16px;
    }

    .categories li {
        font-size: 14px;
    }

    .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;
    }

}
