/* Rich Blue Theme Variables */
:root {
    /* Color Palette */
    --color-bg-dark: #0f172a;
    /* Slate 900 */
    --color-bg-card: #1e293b;
    /* Slate 800 */
    --color-primary: #3b82f6;
    /* Blue 500 */
    --color-primary-hover: #2563eb;
    /* Blue 600 */
    --color-accent: #0ea5e9;
    /* Sky 500 */
    --color-text-main: #f8fafc;
    /* Slate 50 */
    --color-text-muted: #94a3b8;
    /* Slate 400 */
    --color-success: #10b981;
    /* Emerald 500 */
    --color-error: #ef4444;
    /* Red 500 */
    --color-border: #334155;
    /* Slate 700 */

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg-dark);
    color: var(--color-text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

/* Typography */
h1,
h2,
h3 {
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: white;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.6);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    background-color: #1e293b;
    /* darker slate for input */
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.auth-card {
    background-color: var(--color-bg-card);
    padding: var(--spacing-xl);
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    border: 1px solid var(--color-border);
}

/* Navbar */
.navbar {
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

/* Hero Section */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 1rem;
    background: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Errors */
.error-msg {
    color: var(--color-error);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

/* Dashboard/Course Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: var(--spacing-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    border-color: var(--color-primary);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: #334155;
    border-radius: 9999px;
    height: 0.5rem;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    width: 0%;
    transition: width 0.5s ease;
}

/* Protected Layout */
.layout {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 250px;
    background-color: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: var(--spacing-xl);
}

/* Mobile responsive fixes */
@media (max-width: 768px) {

    /* Safe area for mobile browsers */
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .layout {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        height: auto;
        max-height: 250px;
        /* Collapsible feel */
    }

    .main-content {
        padding: var(--spacing-md);
    }

    .nav-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    .auth-card {
        margin: 1rem;
        padding: 1.5rem;
    }
}