:root {
    /* Light Mode Palette */
    --primary: #0D9488;      /* Teal-600 */
    --primary-dark: #0F766E; /* Teal-700 */
    --primary-light: #2DD4BF; /* Teal-400 */
    --secondary: #10B981;    /* Green-500 */
    --bg-body: #F3F4F6;      /* Gray-100 */
    --bg-card: #FFFFFF;
    --bg-sidebar: #1E293B;   /* Slate-800 - Darker background for sidebar */
    --text-main: #111827;    /* Gray-900 */
    --text-muted: #6B7280;   /* Gray-500 */
    --text-sidebar: #E2E8F0; /* Slate-200 - Lighter text for sidebar */
    --border-color: #E5E7EB; /* Gray-200 */
    
    /* Components */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-body: #0F172A;      /* Slate-900 */
    --bg-card: #1E293B;      /* Slate-800 */
    --bg-sidebar: #020617;   /* Slate-950 */
    --text-main: #F3F4F6;    /* Gray-100 */
    --text-muted: #94A3B8;   /* Slate-400 */
    --border-color: #334155; /* Slate-700 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utility Classes */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background: var(--border-color);
}

/* Auth Pages Layout */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-body) 0%, rgba(13, 148, 136, 0.1) 100%);
    padding: 1rem;
}

.auth-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    position: relative;
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Sidebar Layout */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px 0 rgba(0,0,0,0.2); /* Stronger shadow to stand out */
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 800; /* Bolder brand */
    color: var(--primary-light);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2); /* Darker header area */
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    color: #94A3B8; /* Muted text */
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-weight: 500;
    border: 1px solid transparent; /* Prepare for border on hover */
}

.sidebar-link i {
    width: 24px;
    margin-right: 10px;
    font-size: 1.2rem; /* Slightly larger icons */
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #F8FAFC;
    transform: translateX(5px); /* Slight movement on hover */
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.2) 0%, rgba(13, 148, 136, 0.05) 100%);
    color: var(--primary-light);
    border-left: 3px solid var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    background-color: var(--bg-body);
    transition: margin-left 0.3s ease;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search input {
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border-radius: 50px;
    color: var(--text-main);
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Dashboard Widgets */
.dashboard-padding {
    padding: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: rgba(13, 148, 136, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: #EF4444; }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Card Components */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

.exam-card-modern {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.exam-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.exam-cover {
    height: 120px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: relative;
}

.exam-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    color: var(--primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.exam-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.exam-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.exam-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.exam-footer {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}

/* Form Inputs */
.form-control, .form-select {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
    background-color: var(--bg-card);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .header-search {
        display: none;
    }
}
