@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* OpenSans Font - Matching mobile app typography */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap');

/* Animation System - Week 3: Comprehensive Animations */
@import url('animations.css');

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   Centralized design system values
   ============================================ */

:root {
    /* === COLOR PALETTE === */
    /* Primary Colors */
    --color-primary: #20A855;
    --color-primary-dark: #1A8A46;
    --color-primary-light: #4CAF70;
    --color-primary-lighter: #E8F5ED;
    --color-primary-hover: #1a8c47;
    --color-primary-pressed: #157038;
    --color-primary-disabled: #9DD6B4;

    /* Secondary Colors */
    --color-secondary: #F4A51C;
    --color-secondary-dark: #D88C0F;
    --color-secondary-light: #FFC94D;
    --color-secondary-lighter: #FFF8E6;

    /* Semantic Colors */
    --color-success: #20A855;
    --color-success-light: #E8F5ED;
    --color-warning: #F4A51C;
    --color-warning-light: #FFF8E6;
    --color-error: #E53935;
    --color-error-light: #FFEBEE;
    --color-info: #2196F3;
    --color-info-light: #E3F2FD;

    /* Background Colors */
    --color-background: #F9FBFA;
    --color-surface: #FFFFFF;
    --color-surface-alt: #FAFAFA;

    /* Text Colors */
    --color-text-primary: #1E2A2F;
    --color-text-secondary: #6B7280;
    --color-text-disabled: #9CA3AF;

    /* Divider & Border Colors */
    --color-divider: #E5E7EB;
    --color-divider-light: #F3F4F6;
    --color-border: #EAEFF2;

    /* Gray Scale */
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;
    --color-gray-950: #0A0E14;

    /* === SPACING SCALE === */
    --spacing-tiny: 2px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-sm-md: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* === TYPOGRAPHY SCALE === */
    --font-size-xs: 10px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-2-5xl: 28px;
    --font-size-3xl: 32px;
    --font-size-4xl: 40px;
    --font-size-5xl: 48px;

    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    --line-height-loose: 2.0;

    /* === BORDER RADIUS === */
    --radius-none: 0px;
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* === ELEVATION (SHADOWS) === */
    --shadow-none: none;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.075);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 6px 12px rgba(0, 0, 0, 0.075);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 12px 24px rgba(0, 0, 0, 0.1);

    /* === TRANSITIONS === */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;

    /* === Z-INDEX SCALE === */
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-appbar: 1100;
    --z-drawer: 1300;
    --z-modal: 1400;
    --z-popover: 1500;
    --z-snackbar: 1600;
    --z-tooltip: 1700;
}

/* ============================================
   BASE STYLES
   ============================================ */

html, body {
    font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    color: orange;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ============================================
   FOGHLAIM AI CUSTOM STYLES
   Matching mobile app design system
   ============================================ */

/* ============================================
   TYPOGRAPHY CLASSES
   Matching mobile XAML styles
   ============================================ */

.page-header {
    font-size: var(--font-size-2-5xl); /* 28px - PageHeaderStyle */
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
    line-height: var(--line-height-tight);
}

.page-subheader {
    font-size: var(--font-size-md); /* 16px - PageSubheaderStyle */
    color: var(--color-gray-700);
    margin: 0 var(--spacing-lg) var(--spacing-sm-md);
    line-height: var(--line-height-normal);
}

/* Page Header Component - for flexible layouts */
.page-header-container {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.page-header-icon {
    margin-top: 0.5rem;
}

.page-header-content {
    flex: 1;
}

.page-header-container .page-header {
    margin: 0;
}

.page-header-container .page-subheader {
    margin: 0.25rem 0 0 0;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.section-header {
    font-size: var(--font-size-lg); /* 18px - SectionHeaderStyle */
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
}

.card-title {
    font-size: var(--font-size-xl); /* 20px */
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.body-text {
    font-size: var(--font-size-base); /* 14px */
    font-weight: var(--font-weight-regular);
    color: var(--color-text-primary);
    line-height: var(--line-height-normal);
}

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

.text-light {
    color: var(--color-gray-400);
}

/* ============================================
   CARD COMPONENTS
   Enhanced with animations, loading states, and variants
   ============================================ */

/* === BASE CARD COMPONENT === */
.base-card {
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-base);
    overflow: hidden;
}

/* Card Variants */
.base-card-elevated {
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
}

.base-card-outlined {
    background: var(--color-surface);
    border: 1px solid var(--color-divider);
}

.base-card-filled {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-divider);
}

/* Clickable Card */
.base-card-clickable {
    cursor: pointer;
}

.base-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.base-card-clickable:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Loading State */
.base-card-loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Filled Card Header */
.base-card-header-filled {
    background: var(--color-primary-lighter);
    border-bottom: 1px solid var(--color-divider);
}

/* === STAT CARD ENHANCEMENTS === */
.stats-card {
    background: var(--color-surface) !important;
    border: 1px solid var(--color-gray-200) !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

/* Shimmer loading effect for skeleton */
.stats-card-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.stats-card:hover {
    border-color: var(--color-primary) !important;
    box-shadow: var(--shadow-lg) !important;
    transform: translateY(-2px);
}

.stats-card:active {
    transform: translateY(0);
}

.stats-card .mud-card-content {
    padding: var(--spacing-lg) !important;
}

/* Stat Value Animation */
.stat-value-animate {
    animation: countUp 0.5s ease-out;
}

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

/* === HOMEWORK CARD ENHANCEMENTS === */
.homework-card {
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid var(--color-gray-200) !important;
    border-radius: var(--radius-md) !important;
    position: relative;
}

.homework-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-primary);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.homework-card:hover::after {
    transform: scaleY(1);
}

.homework-card:hover {
    border-color: var(--color-primary) !important;
    box-shadow: var(--shadow-xl) !important;
    transform: translateY(-2px) translateX(4px);
}

.homework-card:active {
    transform: translateY(0) translateX(2px);
}

/* === PROGRESS BAR CARD ENHANCEMENTS === */
.progress-bar-card {
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-base);
}

.progress-bar-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Smooth progress bar animation */
.mud-progress-linear .mud-progress-linear-bar {
    transition: width 1s ease-out;
}

/* === SKILL PROGRESS CARD ENHANCEMENTS === */
.skill-progress-card {
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-base);
    border: 1px solid var(--color-divider);
}

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

/* === LEGACY CARD STYLES === */
.custom-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

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

/* Homework Card Component - Matching mobile homework cards */
.homework-card {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid #E5E7EB; /* Gray200 */
}

.homework-card:hover {
    border-color: #20A855 !important; /* Primary green on hover */
    box-shadow: 0 6px 16px rgba(32, 168, 85, 0.15) !important;
    transform: translateY(-2px);
}

/* Global MudCard Styling - Consistent 8px border radius */
.mud-card {
    border-radius: 8px !important;
    border: 1px solid #E5E7EB; /* Gray200 border */
    background: #FFFFFF;
}

.mud-card-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white !important;
    border-bottom: 1px solid #E5E7EB;
    padding: 1rem 1.5rem !important;
}

.mud-card-content {
    padding: 1.5rem !important;
}

/* Interactive cards with hover effect */
.mud-list-item {
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.mud-list-item:hover {
    background-color: #F3F4F6 !important; /* Gray100 */
    cursor: pointer;
}

/* MudPaper Styling */
.mud-paper {
    border-radius: 8px !important;
    border: 1px solid #E5E7EB;
}

/* Button Styling - Matching Mobile App */
.mud-button-root {
    border-radius: 8px !important;
    min-height: 44px;
    padding: 10px 14px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    transition: all 0.2s ease-in-out;
}

/* Filled Button (Primary) */
.mud-button-filled.mud-button-filled-primary {
    background-color: #20A855 !important;
    color: white !important;
}

.mud-button-filled.mud-button-filled-primary:hover {
    background-color: #1a8c47 !important;
    box-shadow: 0 2px 4px rgba(32, 168, 85, 0.2);
}

.mud-button-filled.mud-button-filled-primary:active {
    background-color: #157038 !important;
    transform: scale(0.98);
}

.mud-button-filled.mud-button-filled-primary:disabled {
    background-color: #E5E7EB !important; /* Gray200 */
    color: #1F2937 !important; /* Gray950 */
    cursor: not-allowed;
}

/* Outlined Button */
.mud-button-outlined {
    border: 1px solid #E5E7EB !important;
    color: #20A855 !important;
    background-color: transparent !important;
}

.mud-button-outlined:hover {
    background-color: #F9FBFA !important;
    border-color: #20A855 !important;
}

.mud-button-outlined:active {
    background-color: #E8F5ED !important;
    transform: scale(0.98);
}

.mud-button-outlined:disabled {
    border-color: #E5E7EB !important;
    color: #9CA3AF !important; /* Gray400 */
    cursor: not-allowed;
}

/* Text Button */
.mud-button-text {
    color: #20A855 !important;
    padding: 8px 12px !important;
}

.mud-button-text:hover {
    background-color: #E8F5ED !important; /* PrimaryLighter */
}

.mud-button-text:active {
    background-color: #D1ECE0 !important;
}

.mud-button-text:disabled {
    color: #9CA3AF !important; /* Gray400 */
    cursor: not-allowed;
}

/* Button Sizes */
.mud-button-root.mud-button-size-small {
    min-height: 36px;
    padding: 6px 12px !important;
    font-size: 13px !important;
}

.mud-button-root.mud-button-size-large {
    min-height: 52px;
    padding: 14px 20px !important;
    font-size: 16px !important;
}

/* Button Group */
.mud-button-group .mud-button-root {
    border-radius: 8px !important;
}

/* Icon Button */
.mud-icon-button {
    border-radius: 8px !important;
    min-width: 44px;
    min-height: 44px;
}

.mud-icon-button:hover {
    background-color: #F3F4F6 !important; /* Gray100 */
}

/* Focus State for Accessibility */
.mud-button-root:focus-visible {
    outline: 2px solid #20A855;
    outline-offset: 2px;
}

/* Loading State */
.mud-button-root .mud-progress-circular {
    color: currentColor;
}

/* Input Fields - Matching mobile Entry style */
.mud-input-root {
    border-radius: 8px;
}

.mud-input {
    font-size: 0.875rem; /* 14px */
}

/* === ENHANCED NAVIGATION MENU === */
.nav-menu-enhanced {
    padding: var(--spacing-sm) 0;
}

/* Navigation Groups */
.nav-menu-enhanced .mud-nav-group {
    margin-bottom: var(--spacing-sm);
}

.nav-menu-enhanced .mud-nav-group .mud-nav-group-header {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    margin: 0 var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    transition: var(--transition-fast);
}

.nav-menu-enhanced .mud-nav-group .mud-nav-group-header:hover {
    background-color: var(--color-gray-100);
}

/* Navigation Links - Enhanced with better active states */
.nav-link-enhanced {
    border-radius: var(--radius-sm);
    margin: var(--spacing-tiny) var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

/* Ripple effect preparation */
.nav-link-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--color-primary-lighter);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.nav-link-enhanced:active::before {
    width: 200px;
    height: 200px;
}

/* Navigation Link Hover State */
.nav-link-enhanced:hover {
    background-color: var(--color-gray-100);
    transform: translateX(4px);
}

/* Navigation Link Active State - Matching mobile tab styling */
.nav-link-enhanced.mud-nav-link-active,
.mud-nav-link-active .nav-link-enhanced {
    background-color: var(--color-primary-lighter) !important;
    color: var(--color-primary) !important;
    font-weight: var(--font-weight-semibold);
    border-left: 3px solid var(--color-primary);
    padding-left: calc(var(--spacing-md) - 3px);
}

.nav-link-enhanced.mud-nav-link-active .mud-icon-root,
.mud-nav-link-active .nav-link-enhanced .mud-icon-root {
    color: var(--color-primary) !important;
    transform: scale(1.1);
}

/* Navigation Link Icons */
.nav-link-enhanced .mud-icon-root {
    margin-right: var(--spacing-sm);
    transition: var(--transition-fast);
}

.nav-link-enhanced:hover .mud-icon-root {
    transform: scale(1.05);
}

/* Navigation Group Styling */
.nav-group-main .mud-nav-group-header {
    color: var(--color-primary);
}

.nav-group-learning .mud-nav-group-header {
    color: var(--color-primary);
}

.nav-group-gamification .mud-nav-group-header {
    color: var(--color-secondary);
}

.nav-group-account .mud-nav-group-header {
    color: var(--color-gray-700);
}

/* Navigation Section Labels (legacy support) */
.section-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-top: var(--spacing-sm);
}

/* Legacy nav-menu-custom support */
.nav-menu-custom .mud-navmenu .mud-nav-link {
    border-radius: var(--radius-sm);
    margin: var(--spacing-xs) var(--spacing-sm);
}

/* Keyboard Navigation Focus States */
.nav-link-enhanced:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--color-primary-lighter);
}

/* Navigation Badge (for future notification counts) */
.nav-badge {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    background: var(--color-error);
    color: var(--color-surface);
    border-radius: var(--radius-full);
    padding: 2px 6px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: 1;
}

/* === SECTION HEADER COMPONENT === */
.section-header-component {
    margin-bottom: var(--spacing-lg);
}

/* === SEARCH INPUT COMPONENT === */
.search-input {
    max-width: 600px;
}

.search-input .mud-input-adornment {
    color: var(--color-text-secondary);
}

.search-input:focus-within .mud-input-adornment {
    color: var(--color-primary);
}

/* === FORM SECTION COMPONENT === */
.form-section {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-divider);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.form-section-header {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-divider);
}

.form-section-content {
    padding: var(--spacing-lg);
}

/* Form Layout Utilities */
.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-divider);
}

.form-grid {
    display: grid;
    gap: var(--spacing-md);
}

.form-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* === DASHBOARD ENHANCEMENTS === */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--color-primary-lighter) 0%, var(--color-surface) 100%);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
}

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

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

.quick-action-card {
    text-align: center;
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

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

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

/* Divider Styling */
.mud-divider {
    background-color: var(--color-divider);
}

/* Badge/Chip Styling */
.mud-chip {
    border-radius: 8px !important;
}

.success-badge {
    background-color: #E8F5ED; /* SuccessLight */
    color: #20A855; /* Success */
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.warning-badge {
    background-color: #FFF8E6; /* WarningLight */
    color: #F4A51C; /* Warning */
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.error-badge {
    background-color: #FFEBEE; /* ErrorLight */
    color: #E53935; /* Error */
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.info-badge {
    background-color: #E3F2FD; /* InfoLight */
    color: #2196F3; /* Info */
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Alert Styling - Matching mobile alert design */
.mud-alert {
    border-radius: 8px !important;
    border-left-width: 4px !important;
}

/* Progress Bar Styling */
.mud-progress-linear {
    border-radius: 8px !important;
    height: 8px !important;
}

.mud-progress-linear.mud-progress-medium {
    height: 12px !important;
}

/* Timeline Styling */
.mud-timeline-item-dot {
    border-width: 3px !important;
}

/* Spacing Utilities - Consistent with mobile Margin/Padding */
.spacing-sm {
    padding: 0.5rem;
}

.spacing-md {
    padding: 1rem;
}

.spacing-lg {
    padding: 1.5rem;
}

.spacing-xl {
    padding: 2rem;
}

/* Border Utilities */
.border-primary {
    border: 1px solid #20A855;
}

.border-light {
    border: 1px solid #EAEFF2; /* BorderColor */
}

.border-gray {
    border: 1px solid #E5E7EB; /* Gray200 */
}

/* Icon Sizing - Standard 24px like mobile */
.icon-sm {
    width: 20px;
    height: 20px;
}

.icon-md {
    width: 24px;
    height: 24px;
}

.icon-lg {
    width: 32px;
    height: 32px;
}

/* Gradient Backgrounds - Matching mobile gradients */
.gradient-primary {
    background: linear-gradient(135deg, #1A8A46 0%, #20A855 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, #F4A51C 0%, #FFC94D 100%);
}

.gradient-app {
    background: linear-gradient(180deg, #1A8A46 0%, #20A855 50%, #F4A51C 100%);
}

/* ============================================
   NAVIGATION & LAYOUT STYLES
   Enhanced with smooth transitions and modern styling
   ============================================ */

/* === APP BAR CUSTOM STYLING === */
.app-bar-custom {
    height: 64px !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-divider);
    transition: var(--transition-base);
    background: linear-gradient(135deg, #27a230 30%, var(--color-secondary) 100%);
}

.app-bar-custom .mud-appbar-content {
    padding: var(--spacing-sm) var(--spacing-md);
}

/* User Menu in AppBar */
.user-menu {
    display: flex !important; /* Force always visible */
}

.user-menu .mud-menu-activator {
    transition: var(--transition-fast);
    display: flex !important; /* Ensure menu button is always visible */
}

.user-menu .mud-menu-activator:hover {
    transform: scale(1.05);
}

/* Mobile - Ensure user menu stays visible and is properly sized */
@media (max-width: 768px) {
    .user-menu {
        display: flex !important;
        margin-left: auto; /* Push to right on mobile */
    }

    .user-menu .mud-menu-activator {
        min-width: 40px !important;
        min-height: 40px !important;
    }

    /* Ensure theme toggle and user menu are visible on mobile */
    .app-bar-custom .mud-appbar-content {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
}

/* === DRAWER CUSTOM STYLING === */
:root {
    --drawer-width: 260px;
}

.drawer-custom {
    width: var(--drawer-width) !important;
    transition: transform var(--transition-slow) ease-in-out,
                width var(--transition-slow) ease-in-out !important;
}

.drawer-custom .mud-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--color-surface);
}

@media (min-width: 960px) {
    .drawer-custom.mud-drawer-open {
        box-shadow: var(--shadow-lg);
    }

    .bottom-nav {
        display: none !important;
    }
    .drawer-custom.mud-drawer-close {
        transform: translateX(calc(-1 * var(--drawer-width) - 48px)) !important;
        visibility: hidden;
        pointer-events: none;
        box-shadow: none !important;
    }

    .drawer-custom.mud-drawer-open ~ .main-content-custom {
        margin-left: var(--drawer-width);
    }

    .drawer-custom.mud-drawer-close ~ .main-content-custom {
        margin-left: 0;
    }

    .mud-overlay-drawer {
        display: none !important;
    }
}

/* Enhanced Drawer Header with User Profile */
.drawer-header-enhanced {
    padding: 0 !important;
    background: linear-gradient(135deg, var(--color-primary-lighter) 0%, var(--color-background) 100%);
    border-bottom: 2px solid var(--color-primary);
    min-height: auto !important;
}

.drawer-header-enhanced .mud-stack {
    width: 100%;
}

/* Avatar Styling in Drawer */
.avatar-large {
    width: 64px !important;
    height: 64px !important;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    box-shadow: var(--shadow-md);
    border: 3px solid var(--color-surface);
    transition: var(--transition-base);
}

.avatar-large:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Drawer Content Area */
.drawer-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-sm) 0;
}

/* Custom Scrollbar for Drawer */
.drawer-content::-webkit-scrollbar {
    width: 6px;
}

.drawer-content::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

.drawer-content::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: var(--radius-full);
}

.drawer-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
}

/* Enhanced Drawer Footer */
.drawer-footer-enhanced {
    padding: 0 !important;
    background: var(--color-background);
    border-top: 1px solid var(--color-divider);
    margin-top: auto;
}

.drawer-footer-enhanced .mud-link {
    text-decoration: none;
    transition: var(--transition-fast);
}

.drawer-footer-enhanced .mud-link:hover {
    color: var(--color-primary) !important;
    text-decoration: underline;
}

/* Drawer Header - Original (keeping for backwards compatibility) */
.drawer-header {
    padding: 2rem 1rem !important;
    background: linear-gradient(135deg, var(--color-background) 0%, var(--color-primary-lighter) 100%);
    border-bottom: 2px solid var(--color-primary);
}

.drawer-header .mud-stack {
    width: 100%;
}

/* === MAIN CONTENT STYLING === */
.main-content-custom {
    transition: margin-left var(--transition-slow) ease-in-out;
}

/* Smooth page transitions */
.main-content-custom .mud-container {
    animation: fadeIn var(--transition-slow);
}

/* Auth layout centering */
.auth-layout {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
}

@media (max-width: 600px) {
    .auth-layout {
        padding: var(--spacing-lg) var(--spacing-sm);
        align-items: flex-start;
    }
}

.auth-layout .mud-container {
    width: 100%;
}

.google-button.loading {
    position: relative;
    color: transparent;
}

.google-button.loading .google-button-text {
    visibility: hidden;
}

.google-button.loading .mud-progress-circular {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.login-status-alert {
    margin-bottom: var(--spacing-md);
}

/* Image upload preview */
.image-preview-frame {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.05);
}

.image-preview-frame::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 2px solid #00c853;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(0, 200, 83, 0.35);
}

.image-upload-preview {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
    background-color: #000;
}

.cropper-view-box,
.cropper-face {
    border: 2px solid #00c853 !important;
    border-radius: 12px !important;
}

.cropper-line,
.cropper-point {
    background-color: #00c853 !important;
}

/* === HOMEWORK WIZARD STYLES === */
/* Camera video preview for wizard */
.capture-video {
    width: 100%;
    max-width: 640px;
    height: auto;
    border-radius: var(--radius-md);
    background-color: #000;
    object-fit: cover;
}

/* Crop container for wizard */
.crop-container {
    position: relative;
    width: 100%;
    max-height: 600px;
    background-color: var(--color-gray-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.crop-container img {
    max-width: 100%;
    display: block;
}

/* Wizard step container - mobile-first responsive layout */
.wizard-step-container {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Mobile: Full viewport strategy with fixed buttons */
@media (max-width: 767px) {
    .wizard-step-container {
        height: calc(100vh - 220px);
        height: calc(100dvh - 220px); /* Dynamic viewport for mobile browsers */
        min-height: 400px;
    }

    /* Content area with padding for fixed buttons */
    .wizard-step-container > div:first-child {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 80px !important; /* Space for fixed buttons */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    /* Fixed action bar on mobile */
    .wizard-step-container > div:last-child {
        position: fixed !important;
        bottom: 65px;
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--mud-palette-surface);
        border-top: 1px solid var(--mud-palette-divider);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
        padding: 1rem !important;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
    }
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .wizard-step-container {
        max-height: calc(100vh - 280px);
        min-height: 500px;
    }

    /* Content area - scrollable */
    .wizard-step-container > div:first-child {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Action bar - sticky at bottom of container */
    .wizard-step-container > div:last-child {
        position: sticky;
        bottom: 65px;
        z-index: 10;
        background: var(--mud-palette-surface);
        border-top: 1px solid var(--mud-palette-divider);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* Desktop - increase height slightly */
@media (min-width: 1024px) {
    .wizard-step-container {
        max-height: calc(100vh - 260px);
    }
}

/* Wizard action buttons - mobile optimized */
.wizard-step-container .mud-button-root {
    min-height: 48px; /* Touch-friendly size */
}

/* Mobile: Make buttons full width for easier tapping */
@media (max-width: 767px) {
    .wizard-step-container .mud-button-root {
        flex: 1;
        width: 100%;
        max-width: none;
        font-size: 1rem;
        padding: 12px 16px;
    }
}

/* Center icons in progress stepper chips */
.mud-chip .mud-chip-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.mud-chip .mud-chip-icon {
    margin: 0 !important;
}

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

/* Bottom Navigation - Mobile tab bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1300;
    display: none; /* Hidden by default, shown on mobile */
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 64px;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    min-width: 60px;
    text-decoration: none;
    color: #6B7280;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.bottom-nav-item:hover {
    color: #20A855;
    background: #E8F5ED;
    border-radius: 8px;
}

.bottom-nav-item.active {
    color: #20A855;
}

.bottom-nav-item .icon {
    font-size: 24px;
}

.bottom-nav-item .label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ============================================
   MOBILE-FIRST RESPONSIVE DESIGN
   Week 2: Touch Targets, Mobile Layouts, Responsive Patterns
   ============================================ */

/* === TOUCH TARGET OPTIMIZATION (Week 2 Day 6) === */
/* Minimum 44x44px touch targets for accessibility */
.mud-button-root,
.mud-icon-button,
.mud-fab {
    min-height: 44px;
    min-width: 44px;
}

.mud-chip {
    min-height: 32px;
    padding: 6px 12px !important;
}

.mud-checkbox,
.mud-radio {
    min-height: 44px;
    min-width: 44px;
}

/* Increase tap areas on mobile */
@media (max-width: 768px) {
    .nav-link-enhanced {
        padding: var(--spacing-md) var(--spacing-md);
        min-height: 48px;
    }

    .mud-list-item {
        min-height: 48px;
        padding: var(--spacing-md) !important;
    }

    .bottom-nav-item {
        min-height: 56px;
        min-width: 56px;
    }
}

/* === MOBILE GESTURE SUPPORT (Week 2 Day 6) === */
/* Pull-to-refresh indicator */
.pull-to-refresh {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-md);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.pull-to-refresh.active {
    opacity: 1;
}

/* Swipe indicators */
.swipe-action-left,
.swipe-action-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.swipe-action-left {
    left: 0;
    background: var(--color-success);
}

.swipe-action-right {
    right: 0;
    background: var(--color-error);
}

/* === MOBILE LAYOUT OPTIMIZATIONS === */
/* Responsive utilities */
@media (max-width: 768px) {
    /* Typography - Mobile sizes */
    .page-header {
        font-size: var(--font-size-2xl); /* 24px on mobile */
        margin: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
    }

    .page-subheader {
        font-size: var(--font-size-base); /* 14px on mobile */
        margin: 0 var(--spacing-md) var(--spacing-md);
    }

    .section-header {
        font-size: var(--font-size-md); /* 16px on mobile */
        margin: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
    }

    /* Mobile Navigation - Show bottom nav, hide drawer */
    .bottom-nav {
        display: block !important;
    }

    .mud-drawer {
        display: none !important;
    }

    .mud-main-content {
        padding-bottom: 80px !important; /* Space for bottom nav */
    }

    /* Ensure menu button is always visible on mobile to access drawer */
    .mud-appbar .mud-icon-button:first-child {
        display: none;
    }

    /* Card Spacing on Mobile */
    .stats-card,
    .homework-card,
    .skill-progress-card {
        margin-bottom: var(--spacing-md);
    }

    /* Dashboard Grid - Single column on mobile */
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Form Grid - Single column on mobile */
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    /* Reduce padding on mobile */
    .mud-card-content {
        padding: var(--spacing-md) !important;
    }

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

    /* Full width buttons on mobile */
    .form-actions {
        flex-direction: column;
    }

    .form-actions .mud-button-root {
        width: 100%;
    }

    /* Search Input - Full width on mobile */
    .search-input {
        max-width: 100%;
    }
}
@media (max-width: 960px){
   .bottom-nav {
        display: block !important;
    }
}
/* === TABLET LAYOUT (Week 2 Day 10) === */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Two-column layouts on tablet */
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Persistent drawer on tablet */
    .mud-drawer {
        display: block !important;
    }

    /* Card grid - 2 columns */
    .homework-grid,
    .skills-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
}

/* === LARGE SCREEN OPTIMIZATION (Week 2 Day 10) === */
@media (min-width: 1440px) {
    /* Max width for content */
    .mud-container {
        max-width: 1440px;
    }

    /* 3-4 column layouts on large screens */
    .dashboard-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .dashboard-quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Card grid - 3 columns */
    .homework-grid,
    .skills-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }

    /* Sidebar widgets for large screens */
    .dashboard-with-sidebar {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: var(--spacing-2xl);
    }
}

/* === MOBILE-SPECIFIC ENHANCEMENTS === */
@media (max-width: 768px) {
    /* Larger font for better readability */
    body {
        font-size: 16px;
    }

    /* Prevent zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Sticky headers on mobile */
    .mobile-sticky-header {
        position: sticky;
        top: 64px;
        background: var(--color-surface);
        z-index: 10;
        box-shadow: var(--shadow-sm);
    }

    /* Bottom sheet style dialogs */
    .mud-dialog-container {
        align-items: flex-end;
    }

    .mud-dialog {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
        max-height: 90vh;
    }

    /* Mobile table - card view */
    .mobile-card-table .mud-table {
        display: block;
    }

    .mobile-card-table .mud-table-row {
        display: block;
        margin-bottom: var(--spacing-md);
        border: 1px solid var(--color-divider);
        border-radius: var(--radius-sm);
        padding: var(--spacing-md);
    }

    .mobile-card-table .mud-table-cell {
        display: block;
        padding: var(--spacing-xs) 0;
        border: none !important;
    }
}

/* === RESPONSIVE IMAGES === */
.responsive-image {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === MOBILE PERFORMANCE === */
/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   WEEK 4: PERFORMANCE & ACCESSIBILITY
   Production-Ready Optimizations
   ============================================ */

/* === PERFORMANCE OPTIMIZATIONS (Week 4 Day 16) === */
/* GPU acceleration for animations */
.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform;
}

/* Contain layout for better performance */
.contain-layout {
    contain: layout style paint;
}

/* Content-visibility for virtual scrolling */
.lazy-content {
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

/* === ACCESSIBILITY (Week 4 Days 17-18) === */
/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: var(--spacing-md);
    z-index: 100;
    text-decoration: none;
    font-weight: 600;
    transition: top var(--transition-base);
}

.skip-to-main:focus {
    top: 0;
}

/* Focus visible styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* Remove focus outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* === HIGH CONTRAST MODE SUPPORT (Week 4 Day 18) === */
@media (prefers-contrast: high) {
    :root {
        --color-text-primary: #000000;
        --color-text-secondary: #000000;
        --color-background: #FFFFFF;
        --color-surface: #FFFFFF;
    }

    .mud-button-root,
    .base-card,
    .stats-card {
        border: 2px solid currentColor;
    }
}

/* === DARK MODE ENHANCEMENTS (Week 3 Day 15) === */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0A0E14;
        --color-surface: #1A1A1A;
        --color-surface-alt: #1F2937;
        --color-text-primary: #E0E0E0;
        --color-text-secondary: #B0B0B0;
        --color-text-disabled: #6B7280;
        --color-divider: #374151;
        --color-divider-light: #4B5563;
    }

    /* Dark mode card shadows - subtle glow */
    .base-card-elevated,
    .stats-card,
    .homework-card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5),
                    0 0 0 1px rgba(255, 255, 255, 0.05);
    }

    .base-card-clickable:hover,
    .stats-card:hover,
    .homework-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6),
                    0 0 0 1px rgba(32, 168, 85, 0.3);
    }

    /* Adjust image brightness in dark mode */
    img:not([src*=".svg"]) {
        filter: brightness(0.9);
    }
}

/* === PRINT STYLES (Week 4 Day 19) === */
@media print {
    /* Hide navigation and non-essential elements */
    .mud-appbar,
    .mud-drawer,
    .bottom-nav,
    .mud-fab,
    button,
    .no-print {
        display: none !important;
    }

    /* Optimize for print */
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .mud-container {
        max-width: 100%;
        padding: 0;
    }

    /* Page breaks */
    .page-break-before {
        page-break-before: always;
    }

    .page-break-after {
        page-break-after: always;
    }

    .page-break-avoid {
        page-break-inside: avoid;
    }

    /* Cards for print */
    .base-card,
    .stats-card,
    .homework-card {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* === ERROR BOUNDARY STYLES (Week 4 Day 18) === */
.error-boundary {
    padding: var(--spacing-2xl);
    background: var(--color-error-light);
    border: 2px solid var(--color-error);
    border-radius: var(--radius-md);
    margin: var(--spacing-lg);
}

.error-boundary-title {
    color: var(--color-error);
    font-weight: 700;
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
}

/* === LOADING STATES (Week 4 Day 16) === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

/* === OFFLINE INDICATOR (Week 4 Day 18) === */
.offline-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-warning);
    color: var(--color-text-primary);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    animation: slideInUp var(--duration-base) var(--ease-standard);
}

@media (min-width: 769px) {
    .offline-indicator {
        bottom: var(--spacing-lg);
    }
}

/* === THEME TRANSITION (Week 3 Day 15) === */
.theme-transition * {
    transition: background-color var(--duration-slow) ease-in-out,
                color var(--duration-slow) ease-in-out,
                border-color var(--duration-slow) ease-in-out !important;
}

/* === PRODUCTION POLISH === */
/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better text rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prevent layout shift */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* Better tap highlight */
* {
    -webkit-tap-highlight-color: rgba(32, 168, 85, 0.1);
}

/* Selection color */
::selection {
    background-color: var(--color-primary-lighter);
    color: var(--color-primary);
}

/* Scrollbar styling (webkit) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
}

/* === FINAL POLISH === */
/* Prevent text selection on buttons and navigation */
button,
.mud-nav-link,
.bottom-nav-item {
    user-select: none;
    -webkit-user-select: none;
}

/* Smooth color transitions */
a,
button,
.mud-button-root,
.mud-icon-button,
.nav-link-enhanced {
    transition: color var(--transition-base),
                background-color var(--transition-base),
                border-color var(--transition-base),
                transform var(--transition-base),
                box-shadow var(--transition-base);
}

/* ============================================
   CONGRATULATIONS! 🎉
   4-Week MudBlazor UI Improvement Plan Complete
   ============================================ */
/* === GLOBAL APP BACKGROUND SHELL === */
.app-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(135deg,
        rgba(32, 168, 85, 0.03) 0%,
        rgba(244, 165, 28, 0.03) 50%,
        rgba(32, 168, 85, 0.05) 100%);
}

.app-background {
    position: fixed; /* stays behind all pages */
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.app-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* reuse your existing orbs + animations */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    will-change: transform, filter;
    transform: translateZ(0);
    animation:
        float 20s ease-in-out infinite,
        hueShift 28s ease-in-out infinite alternate;
}

/* keep your existing orb-1 / orb-2 / orb-3 sizes/positions */
.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #20A855 0%, #16a34a 100%);
    top: -200px;
    left: -200px;
}
.orb-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #F4A51C 0%, #f59e0b 100%);
    bottom: -150px;
    right: -150px;
}
.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #20A855 0%, #F4A51C 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* color shift – subtle */
@keyframes hueShift {
    0%   { filter: blur(80px) hue-rotate(0deg); }
    50%  { filter: blur(80px) hue-rotate(18deg); }
    100% { filter: blur(80px) hue-rotate(-12deg); }
}

@media (prefers-reduced-motion: reduce) {
    .gradient-orb {
        filter: none !important;
        opacity: 0.15 !important;
        animation: none !important;
    }
}
/* keep your existing @media + prefers-reduced-motion overrides –
   just update selectors from .login-container/.login-background
   to .app-shell/.app-background where relevant */