:root {
    /* Minimalist & Non-Stimulating Palette - Focused on Focus */
    --background: #0f172a;
    --background-elevated: #111827;
    --surface: #1e293b;
    --surface-light: #334155;
    --surface-hover: #475569;

    /* Muted Primary Colors - Professional & Calm */
    --primary: #94a3b8;
    --primary-light: #cbd5e1;
    --primary-dark: #64748b;
    --primary-glow: rgba(148, 163, 184, 0.1);

    /* Muted Accent Colors */
    --accent-purple: #94a3b8;
    --accent-pink: #94a3b8;
    --accent-cyan: #94a3b8;
    --success: #64748b;
    --warning: #475569;
    --error: #ef4444;

    /* Text Hierarchy */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-subtle: #475569;

    /* Borders & Dividers */
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-focus: var(--text-muted);

    /* Gradients - Subtle & Clean */
    --gradient-primary: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    --gradient-accent: var(--gradient-primary);
    --gradient-success: linear-gradient(180deg, #475569 0%, #334155 100%);
    --gradient-ambient: none;

    /* Shadows - Natural & Soft */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: none;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Spacing System */
    --container-max: 1140px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Typography */
    --font-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Animations - Custom Easing Curves */
    --ease-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);

    --duration-fast: 150ms;
    --duration-medium: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 700ms;

    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-toast: 1050;
}

/* Global Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background);
    background-image: var(--gradient-ambient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Text style */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

/* Selection styling */
::selection {
    background-color: var(--primary-glow);
    color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-hover);
}

/* Layout Components */
.navbar {
    height: 72px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px) saturate(180%);
    background: rgba(15, 23, 42, 0.8);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    transition: all var(--duration-medium) var(--ease-smooth);
}

.navbar:hover {
    background: rgba(10, 14, 26, 0.9);
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    width: 100%;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: all var(--duration-medium) var(--ease-smooth);
    position: relative;
}

.brand:hover {
    color: var(--primary-light);
    transform: translateY(-1px);
}

.brand-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
}

/* Main Content Area */
.main-content {
    padding: var(--spacing-3xl) 0;
    animation: fadeInFast var(--duration-medium) var(--ease-out);
    position: relative;
}

@keyframes fadeInFast {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Card Component */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    transition: all var(--duration-medium) var(--ease-smooth);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Premium Button System */
.btn {
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--duration-medium) var(--ease-smooth);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    font-family: var(--font-body);
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background: var(--surface-light);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Enhanced Form Elements */
.form-card {
    max-width: 480px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--duration-fast) var(--ease-smooth);
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--background-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all var(--duration-medium) var(--ease-smooth);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1),
        0 0 20px rgba(99, 102, 241, 0.15);
}

input:focus+label,
select:focus+label,
textarea:focus+label {
    color: var(--primary);
}

/* Flash Messages with Enhanced Animation */
.flash-wrapper {
    position: fixed;
    top: 90px;
    right: var(--spacing-xl);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-xl);
    animation: slideInRight var(--duration-medium) var(--ease-spring);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}

.alert.success {
    border-left-color: var(--success);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), var(--surface));
}

.alert.error {
    border-left-color: var(--error);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), var(--surface));
}

.alert.warning {
    border-left-color: var(--warning);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), var(--surface));
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Grid Layouts */
.grid-cols {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-xl);
}

.grid-cols>* {
    animation: fadeInUp var(--duration-slow) var(--ease-smooth);
    animation-fill-mode: both;
}

.grid-cols>*:nth-child(1) {
    animation-delay: 0ms;
}

.grid-cols>*:nth-child(2) {
    animation-delay: 100ms;
}

.grid-cols>*:nth-child(3) {
    animation-delay: 200ms;
}

.grid-cols>*:nth-child(4) {
    animation-delay: 300ms;
}

.grid-cols>*:nth-child(5) {
    animation-delay: 400ms;
}

.grid-cols>*:nth-child(6) {
    animation-delay: 500ms;
}

/* Premium Progress Bar */
.progress-root {
    height: 8px;
    background: var(--background-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: var(--text-muted);
    transition: width 0.6s var(--ease-smooth);
    width: 0%;
    border-radius: var(--radius-full);
}

/* Enhanced Badge Component */
.badge {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--background-elevated);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Utility Classes */
.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-subtle {
    color: var(--text-subtle);
}

.text-center {
    text-align: center;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mt-8 {
    margin-top: var(--spacing-xl);
}

.mb-8 {
    margin-bottom: var(--spacing-xl);
}

.mb-4 {
    margin-bottom: var(--spacing-md);
}

.w-full {
    width: 100%;
}

/* Topic/Sub Card Enhancements */
.topic-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sub-card {
    padding: 1.25rem;
    background: var(--surface-light);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all var(--duration-medium) var(--ease-smooth);
}

.sub-card:hover {
    background: var(--surface-hover);
    border-color: var(--border);
    transform: translateX(4px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .grid-cols {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    h1 {
        font-size: 2.5rem;
    }

    .navbar {
        height: 64px;
    }

    .main-content {
        padding: var(--spacing-xl) 0;
    }

    .flash-wrapper {
        left: var(--spacing-md);
        right: var(--spacing-md);
        max-width: none;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}