:root {
    --bg-main: #0a0a0f;
    --bg-surface: rgba(25, 25, 35, 0.7);
    --bg-surface-hover: rgba(35, 35, 45, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-on-dark: #a5b4fc;
    --text-on-light: #14181c;
    --text-secondary-on-light: #5b6470;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);
    
    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    
    /* Spacing Scale */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

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

body {
    font-family: 'Inter', sans-serif;
    font-size: var(--text-base);
    line-height: 1.5;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5, h6 { font-size: var(--text-base); }

/* Dynamic background gradients */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15) 0%, rgba(10, 10, 15, 0) 50%);
    z-index: -1;
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand .logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.brand h1 {
    font-size: var(--text-xl);
    font-weight: 700;
    background: linear-gradient(to right, #fff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

nav a:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

nav a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-on-dark);
    border-left: 3px solid var(--primary-color);
}

.user-profile {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.5);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h2 {
    font-size: var(--text-2xl);
    font-weight: 600;
}

.content-area {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Components */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: var(--text-sm);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

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

.btn-outline:hover {
    background: var(--bg-surface-hover);
    border-color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 80px 0;
    color: var(--text-secondary);
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: var(--text-xl);
}

/* Course Card */
.course-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: var(--glass-blur);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.course-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.course-title {
    font-size: var(--text-xl);
    font-weight: 600;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.status-published { background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.status-completed { background: rgba(5, 150, 105, 0.16); color: #6ee7b7; border: 1px solid rgba(5, 150, 105, 0.35); }
.status-available { background: rgba(37, 99, 235, 0.16); color: #93c5fd; border: 1px solid rgba(37, 99, 235, 0.35); }
.status-locked { background: rgba(107, 114, 128, 0.16); color: #d1d5db; border: 1px solid rgba(107, 114, 128, 0.35); }
.status-empty { background: rgba(220, 38, 38, 0.16); color: #fca5a5; border: 1px solid rgba(220, 38, 38, 0.35); }

.item-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: #e2e8f0; border-radius: 50%; font-size: var(--text-xs); color: var(--text-on-light); }

.container, .nav-content { max-width: 1200px; margin-inline: auto; padding-inline: 24px; width: 100%; }
.nav-content { display: flex; align-items: center; gap: 32px; justify-content: flex-start; flex-wrap: wrap; row-gap: 8px; }
.nav-links { display: flex; gap: 8px; flex-grow: 1; flex-wrap: wrap; }
@media (max-width: 640px) { .nav-content { gap: 16px; } }
.nav-links a { text-decoration: none; color: var(--text-secondary); padding: 8px 12px; border-radius: 6px; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.navbar { background: rgba(10, 10, 15, 0.8); backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--border-color); padding: 16px 0; }

/* Layout & Grid Extracted */
.dashboard-section { margin-bottom: var(--space-2xl); }
.section-title { font-size: var(--text-2xl); font-weight: 600; margin-bottom: var(--space-md); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--border-color); }
.dashboard-grid, .catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-lg); margin-top: var(--space-xl); }
@media (max-width: 640px) {
    .dashboard-grid, .catalog-grid { grid-template-columns: minmax(100%, 1fr); }
}
.search-bar { width: 100%; max-width: 500px; padding: 0.75rem 1rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: var(--text-base); background: var(--bg-surface); color: var(--text-primary); min-height: 44px; }
.course-desc { color: var(--text-secondary); font-size: var(--text-sm); margin-bottom: var(--space-md); line-height: 1.5; }

/* Tactile Interactions */
.btn:active, .dash-card:active { transform: translateY(0) scale(0.98); box-shadow: none; }
.btn:disabled, .action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }

/* Hover background for curriculum items */
.curriculum-item:hover, .outline-item:hover:not(.locked) { background: rgba(255, 255, 255, 0.05); }

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    z-index: 9999;
    backdrop-filter: var(--glass-blur);
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Sidebar Drawer (Mobile) */
.hamburger { display: none; background: transparent; border: none; color: white; cursor: pointer; font-size: var(--text-2xl); margin-right: 16px; }
@media (max-width: 1024px) {
    .sidebar { position: fixed; top: 0; left: 0; height: 100vh; transform: translateX(-100%); transition: transform 0.3s ease; z-index: 1000; width: 280px; }
    body.drawer-open .sidebar { transform: translateX(0); }
    .hamburger { display: block; }
}
.nav-brand { font-size: var(--text-xl); font-weight: 700; background: linear-gradient(to right, #fff, #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }


.curriculum-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.curriculum-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.curriculum-item-title {
    font-weight: 500;
}

.curriculum-item-type {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 12px;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

/* Custom Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal h3 { margin-bottom: 12px; font-weight: 600; font-size: var(--text-xl); }
.modal p { color: var(--text-secondary); margin-bottom: 20px; font-size: var(--text-sm); line-height: 1.5; }
.modal input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    margin-bottom: 20px;
    font-family: inherit;
    font-size: var(--text-base);
}
.modal input:focus {
    outline: none;
    border-color: var(--primary-color);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
