/* ====================
   Aeon AI Platform - Waymo Inspired Design
   Clean, Modern, Trustworthy
   ==================== */

:root {
    /* Waymo Blue Color System */
    --primary-blue: #4285F4;
    --primary-blue-dark: #1967D2;
    --primary-blue-light: #8AB4F8;
    --primary-blue-lighter: #D2E3FC;
    --accent-teal: #00897B;
    --accent-green: #34A853;
    --accent-yellow: #FBBC04;
    --accent-orange: #FF6F00;
    --accent-red: #EA4335;

    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F4;
    --gray-200: #E8EAED;
    --gray-300: #DADCE0;
    --gray-400: #BDC1C6;
    --gray-500: #9AA0A6;
    --gray-600: #80868B;
    --gray-700: #5F6368;
    --gray-800: #3C4043;
    --gray-900: #202124;

    /* Text Colors */
    --text-primary: #202124;
    --text-secondary: #5F6368;
    --text-tertiary: #80868B;
    --text-white: #FFFFFF;
    --text-link: #1967D2;

    /* Backwards compatibility */
    --text-light: #202124;
    --text-gray: #5F6368;
    --text-dark: #202124;
    --accent-purple: #4285F4;
    --gradient-primary: #4285F4;
    --gradient-dark: #F8F9FA;

    /* Backgrounds */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #F1F3F4;
    --bg-card: #FFFFFF;
    --bg-hover: #F1F3F4;
    --bg-active: #E8EAED;

    /* Borders */
    --border-color: #DADCE0;
    --border-hover: #BDC1C6;
    --border-focus: #4285F4;

    /* Shadows - Waymo Style Layered Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(60, 64, 67, 0.15);
    --shadow-sm: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 2px 6px 2px rgba(60, 64, 67, 0.15), 0 8px 24px 4px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 4px 8px 3px rgba(60, 64, 67, 0.15), 0 12px 32px 8px rgba(60, 64, 67, 0.15);
    --shadow-xl: 0 8px 16px 4px rgba(60, 64, 67, 0.15), 0 16px 48px 12px rgba(60, 64, 67, 0.15);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius - Clean, Modern */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Google Sans', 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====================
   Typography
   ==================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; font-weight: 400; }
h2 { font-size: 2rem; font-weight: 400; }
h3 { font-size: 1.75rem; font-weight: 400; }
h4 { font-size: 1.5rem; font-weight: 500; }
h5 { font-size: 1.25rem; font-weight: 500; }
h6 { font-size: 1rem; font-weight: 500; }

.gradient-text {
    color: var(--primary-blue);
    font-weight: 500;
}

/* ====================
   Layout Components
   ==================== */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-secondary);
}

.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md);
}

.nav-section {
    margin-bottom: var(--spacing-xl);
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--spacing-sm);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    margin-bottom: 4px;
    overflow: hidden;
}

.nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-blue-lighter);
    color: var(--primary-blue-dark);
    font-weight: 500;
}

.nav-item-icon {
    font-size: 1.25rem;
    width: 24px;
    min-width: 24px;
    text-align: center;
}

.nav-item-badge {
    margin-left: auto;
    background: var(--primary-blue);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    background: linear-gradient(to bottom, transparent, rgba(102, 126, 234, 0.02));
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-card);
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-profile:hover {
    background: var(--bg-hover);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
}

.user-avatar::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    bottom: 0;
    right: -2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(102, 126, 234, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
}

.btn-logout {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-logout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-logout:hover::before {
    left: 100%;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-logout:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-logout i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-logout:hover i {
    transform: translateX(-3px);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    gap: 0.75rem;
    overflow: visible;
}

.search-bar {
    flex: 1 1 auto;
    max-width: 420px;
    min-width: 0;
    position: relative;
}

.search-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    padding: 9px 18px 9px 42px;
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: var(--transition-fast);
}

.search-input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-sm);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Notification icon group with subtle separator before language switcher */
.top-bar-actions .language-switcher {
    margin-left: 6px;
}

.icon-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    font-size: 0.95rem;
}

.icon-button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.icon-button .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: var(--accent-red);
    border-radius: 9px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--white);
    border: 2px solid var(--white);
    line-height: 1;
}

.content-area {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
}

/* ====================
   Buttons
   ==================== */

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    box-shadow: var(--shadow-md);
}

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

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

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

.btn-outline:hover {
    background: var(--primary-blue-lighter);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* ====================
   Cards
   ==================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

.card-gradient {
    background: linear-gradient(135deg, var(--primary-blue-lighter) 0%, var(--white) 100%);
    border: 1px solid var(--primary-blue-light);
}

.card-hover-lift:hover {
    transform: translateY(-4px);
}

/* ====================
   Metric Cards
   ==================== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.metric-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--primary-blue-lighter);
    opacity: 0.3;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.metric-change {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-change.positive {
    background: rgba(52, 168, 83, 0.1);
    color: var(--accent-green);
}

.metric-change.negative {
    background: rgba(234, 67, 53, 0.1);
    color: var(--accent-red);
}

.metric-value {
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ====================
   Quick Actions
   ==================== */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.action-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-xs);
}

.action-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--primary-blue);
}

.action-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    background: var(--primary-blue);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.action-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ====================
   AI Insights
   ==================== */

.ai-insights {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-xs);
}

.insight-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary-blue);
    margin-bottom: var(--spacing-sm);
}

.insight-item.warning {
    border-left-color: var(--accent-yellow);
    background: rgba(251, 188, 4, 0.1);
}

.insight-item.info {
    border-left-color: var(--accent-teal);
    background: rgba(0, 137, 123, 0.1);
}

.insight-item.success {
    border-left-color: var(--accent-green);
    background: rgba(52, 168, 83, 0.1);
}

.insight-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.insight-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ====================
   Course Cards
   ==================== */

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

.course-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-fast);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}

.course-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.course-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    position: relative;
}

.course-status {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.course-info {
    padding: var(--spacing-lg);
}

.course-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.course-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.course-stats {
    display: flex;
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.course-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.course-stat i {
    color: var(--primary-blue);
}

/* ====================
   Progress Bars
   ==================== */

.progress-container {
    margin-top: var(--spacing-sm);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* ====================
   Wizard / Stepper
   ==================== */

.wizard-container {
    max-width: 900px;
    margin: 0 auto;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: var(--transition-fast);
}

.wizard-step.active .step-number {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    box-shadow: var(--shadow-md);
}

.wizard-step.completed .step-number {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.wizard-step.active .step-label {
    color: var(--text-primary);
    font-weight: 500;
}

.wizard-content {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    min-height: 400px;
    box-shadow: var(--shadow-xs);
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

/* ====================
   Forms
   ==================== */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-blue-lighter);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235F6368' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ====================
   Loading States
   ==================== */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ====================
   Animations
   ==================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ====================
   Utilities
   ==================== */

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

.rounded-xs { border-radius: var(--radius-xs); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ====================
   Responsive Design
   ==================== */

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

    .top-bar {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .search-bar {
        max-width: 260px;
    }

    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: var(--spacing-md);
    }

    .top-bar {
        padding: 0 0.75rem 0 3.5rem;
        gap: 0.5rem;
    }

    .search-bar {
        min-width: 0;
        flex: 1 1 140px;
        max-width: none;
    }

    .icon-button {
        width: 32px;
        height: 32px;
        font-size: 0.88rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}
