/*
 * Classroom Observation System - Innlit í kennslustundir
 * Nordic Professional Design - Fjord Slate Theme
 * Mobile-first responsive design
 */

/* ================================
   DESIGN TOKENS
   ================================ */
:root {
    /* Primary Colors - Fjord Slate */
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;

    /* Accent Colors */
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-400: #2dd4bf;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --amber-400: #fbbf24;

    /* Rating Colors */
    --rating-green: #10b981;
    --rating-green-light: #d1fae5;
    --rating-green-dark: #059669;
    --rating-yellow: #f59e0b;
    --rating-yellow-light: #fef3c7;
    --rating-yellow-dark: #d97706;
    --rating-purple: #8b5cf6;
    --rating-purple-light: #ede9fe;
    --rating-purple-dark: #7c3aed;

    /* Semantic Colors */
    --primary: var(--teal-500);
    --primary-dark: var(--teal-600);
    --secondary: var(--amber-500);
    --background: var(--slate-50);
    --surface: #ffffff;
    --text-primary: var(--slate-800);
    --text-secondary: var(--slate-500);
    --text-muted: var(--slate-400);
    --border: var(--slate-200);

    /* Legacy mappings for compatibility */
    --green: var(--rating-green);
    --green-light: var(--rating-green-light);
    --green-dark: var(--rating-green-dark);
    --yellow: var(--rating-yellow);
    --yellow-light: var(--rating-yellow-light);
    --yellow-dark: var(--rating-yellow-dark);
    --red: var(--rating-purple);
    --red-light: var(--rating-purple-light);
    --red-dark: var(--rating-purple-dark);

    /* Gray scale mappings */
    --gray-50: var(--slate-50);
    --gray-100: var(--slate-100);
    --gray-200: var(--slate-200);
    --gray-300: var(--slate-300);
    --gray-400: var(--slate-400);
    --gray-500: var(--slate-500);
    --gray-600: var(--slate-600);
    --gray-700: var(--slate-700);
    --gray-800: var(--slate-800);
    --gray-900: var(--slate-900);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);

    /* Glow effects */
    --glow-teal: 0 0 20px rgba(20, 184, 166, 0.3);
    --glow-green: 0 0 20px rgba(16, 185, 129, 0.4);
    --glow-yellow: 0 0 20px rgba(245, 158, 11, 0.4);
    --glow-purple: 0 0 20px rgba(139, 92, 246, 0.4);

    /* Border Radius */
    --radius: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ================================
   BASE RESET & TYPOGRAPHY
   ================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--slate-900);
}

/* ================================
   NAVIGATION - Dark Slate Header
   ================================ */
.main-nav {
    background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 100%);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.25);
}

.nav-brand a {
    font-weight: 800;
    font-size: 1.125rem;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    letter-spacing: -0.025em;
}

.nav-brand a::before {
    content: '';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    border-radius: var(--radius);
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

.nav-links {
    display: none;
    gap: 0.25rem;
}

.nav-links a {
    padding: 0.5rem 1rem;
    color: var(--slate-300);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-base);
    position: relative;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-links a.active {
    background: var(--teal-500);
    color: #fff;
    font-weight: 600;
}

.nav-user {
    display: none;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.875rem;
    color: var(--slate-300);
    font-weight: 500;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-base);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    color: #fff;
    transition: all var(--transition-base);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--slate-800);
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 99;
    box-shadow: var(--shadow-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav.open {
    display: flex;
    animation: slideDown 0.2s ease;
}

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

.mobile-nav a {
    padding: 1rem 1.5rem;
    color: var(--slate-200);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-base);
}

.mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav a.active {
    background: rgba(20, 184, 166, 0.15);
    color: var(--teal-400);
    border-left: 3px solid var(--teal-500);
}

/* Desktop Navigation */
@media (min-width: 768px) {
    .main-nav {
        padding: 0 2rem;
    }

    .nav-links {
        display: flex;
    }

    .nav-user {
        display: flex;
    }

    .mobile-menu-btn {
        display: none;
    }

    .mobile-nav {
        display: none !important;
    }
}

/* ================================
   MAIN CONTAINER
   ================================ */
.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    animation: fadeInUp 0.4s ease;
}

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

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
}

/* ================================
   FOOTER
   ================================ */
.main-footer {
    background: var(--slate-800);
    border-top: 1px solid var(--slate-700);
    padding: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--slate-400);
    margin-top: auto;
}

/* ================================
   LOGIN PAGE - Immersive Dark Design
   ================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--slate-900);
    position: relative;
    overflow: hidden;
}

/* Decorative background elements */
.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Geometric grid pattern */
.login-container {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 100%);
    background-size: 50px 50px, 50px 50px, 100% 100%;
}

.login-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.5s ease;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.login-logo svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--slate-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.login-header p {
    color: var(--slate-500);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ================================
   FORMS
   ================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--slate-700);
    font-size: 0.9375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-base);
    background: #fff;
    color: var(--slate-800);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--slate-400);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--slate-300);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

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

.form-row {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row.three-col {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================================
   BUTTONS
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-700) 100%);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--slate-100);
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
}

.btn-secondary:hover {
    background: var(--slate-200);
    border-color: var(--slate-300);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--rating-green) 0%, var(--rating-green-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--rating-purple) 0%, var(--rating-purple-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Ripple effect container */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ================================
   CARDS
   ================================ */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--slate-100);
    transition: all var(--transition-base);
}

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

.card-header {
    padding: 1.25rem 1.5rem;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate-800);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.card-body {
    padding: 1.5rem;
}

/* ================================
   PAGE HEADER
   ================================ */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--slate-900);
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
}

.page-header p {
    color: var(--slate-500);
    font-weight: 500;
}

@media (min-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
}

/* ================================
   STATS CARDS
   ================================ */
.stats-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--slate-100);
    border-left: 4px solid var(--teal-500);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, transparent 50%, rgba(20, 184, 166, 0.05) 50%);
    pointer-events: none;
}

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

.stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--slate-900);
    line-height: 1;
    letter-spacing: -0.025em;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--slate-500);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ================================
   TRAFFIC LIGHT RATING SYSTEM
   ================================ */
.criteria-section {
    margin-bottom: 2rem;
}

.criteria-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--slate-100);
    transition: all var(--transition-base);
}

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

.criteria-header {
    padding: 1.25rem 1.5rem;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-100);
}

.criteria-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 0.25rem;
}

.criteria-header p {
    font-size: 0.875rem;
    color: var(--slate-500);
}

.criteria-body {
    padding: 1.5rem;
}

/* Rating Buttons - Large Touch Targets with Glow */
.rating-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rating-btn {
    flex: 1;
    min-height: 80px;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: all var(--transition-base);
    background: var(--slate-50);
    color: var(--slate-600);
    position: relative;
    overflow: hidden;
}

.rating-btn .emoji {
    font-size: 1.75rem;
    transition: transform var(--transition-base);
}

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

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

/* Green Rating */
.rating-btn[data-rating="green"]:hover,
.rating-btn[data-rating="green"].selected {
    background: var(--rating-green-light);
    border-color: var(--rating-green);
    color: var(--rating-green-dark);
}

.rating-btn[data-rating="green"].selected {
    box-shadow: var(--glow-green), var(--shadow-md);
}

.rating-btn[data-rating="green"].selected .emoji {
    transform: scale(1.15);
}

/* Yellow Rating */
.rating-btn[data-rating="yellow"]:hover,
.rating-btn[data-rating="yellow"].selected {
    background: var(--rating-yellow-light);
    border-color: var(--rating-yellow);
    color: var(--rating-yellow-dark);
}

.rating-btn[data-rating="yellow"].selected {
    box-shadow: var(--glow-yellow), var(--shadow-md);
}

.rating-btn[data-rating="yellow"].selected .emoji {
    transform: scale(1.15);
}

/* Purple (Red) Rating */
.rating-btn[data-rating="red"]:hover,
.rating-btn[data-rating="red"].selected {
    background: var(--rating-purple-light);
    border-color: var(--rating-purple);
    color: var(--rating-purple-dark);
}

.rating-btn[data-rating="red"].selected {
    box-shadow: var(--glow-purple), var(--shadow-md);
}

.rating-btn[data-rating="red"].selected .emoji {
    transform: scale(1.15);
}

/* ARIA improvements */
.rating-btn[aria-pressed="true"] {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Comment Box - Emphasized States */
.comment-wrapper {
    position: relative;
    transition: all var(--transition-base);
}

.comment-wrapper textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all var(--transition-base);
}

.comment-wrapper textarea:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.comment-wrapper.emphasized {
    animation: emphasisPulse 0.5s ease;
}

.comment-wrapper.emphasized textarea {
    border-color: var(--rating-yellow);
    background: var(--rating-yellow-light);
}

.comment-wrapper.emphasized textarea:focus {
    border-color: var(--rating-yellow-dark);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.comment-wrapper.emphasized-red {
    animation: emphasisPulse 0.5s ease;
}

.comment-wrapper.emphasized-red textarea {
    border-color: var(--rating-purple);
    background: var(--rating-purple-light);
}

.comment-wrapper.emphasized-red textarea:focus {
    border-color: var(--rating-purple-dark);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

@keyframes emphasisPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.comment-hint {
    display: none;
    font-size: 0.8125rem;
    color: var(--rating-yellow-dark);
    margin-top: 0.5rem;
    font-weight: 500;
}

.comment-wrapper.emphasized .comment-hint,
.comment-wrapper.emphasized-red .comment-hint {
    display: block;
}

.comment-wrapper.emphasized-red .comment-hint {
    color: var(--rating-purple-dark);
}

/* ================================
   TABLES
   ================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--slate-100);
}

th {
    background: var(--slate-50);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--slate-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

td {
    font-size: 0.9375rem;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--slate-50);
}

/* ================================
   RATING BADGE
   ================================ */
.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}

.rating-badge.green {
    background: var(--rating-green-light);
    color: var(--rating-green-dark);
}

.rating-badge.yellow {
    background: var(--rating-yellow-light);
    color: var(--rating-yellow-dark);
}

.rating-badge.red {
    background: var(--rating-purple-light);
    color: var(--rating-purple-dark);
}

.rating-badge.unrated {
    background: var(--slate-100);
    color: var(--slate-500);
}

.summary-item.unrated {
    border-left: 4px solid var(--slate-300);
    opacity: 0.6;
}

/* ================================
   REPORT VIEW
   ================================ */
.report-container {
    max-width: 800px;
    margin: 0 auto;
}

.report-header {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--slate-100);
    position: relative;
    overflow: hidden;
}

.report-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--teal-500), var(--amber-500));
}

.report-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--slate-900);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--slate-600);
    font-size: 0.9375rem;
}

.report-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--slate-50);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--slate-100);
}

@media (min-width: 640px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.summary-item {
    background: #fff;
    padding: 1.25rem 1rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--slate-100);
    transition: all var(--transition-base);
}

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

.summary-item .emoji {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.summary-item .label {
    font-size: 0.8125rem;
    color: var(--slate-600);
    font-weight: 500;
}

.summary-item.green {
    border-left: 4px solid var(--rating-green);
}

.summary-item.yellow {
    border-left: 4px solid var(--rating-yellow);
}

.summary-item.red {
    border-left: 4px solid var(--rating-purple);
}

/* Criteria Detail */
.criteria-detail {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--slate-100);
}

.criteria-detail-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-100);
}

.criteria-detail-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.criteria-detail-body {
    padding: 1.5rem;
}

.criteria-comment {
    background: var(--slate-50);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--slate-700);
    border-left: 3px solid var(--teal-500);
    margin-top: 1rem;
}

.text-gray {
    color: var(--slate-500);
}

/* ================================
   COMPARISON VIEW
   ================================ */
.comparison-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.comparison-table {
    min-width: 600px;
}

.comparison-table th,
.comparison-table td {
    min-width: 150px;
    vertical-align: top;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    min-width: 200px;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}

.comparison-table th:first-child {
    background: var(--slate-50);
}

.comparison-date {
    font-size: 0.8125rem;
    color: var(--slate-500);
    font-weight: 500;
}

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

.comparison-cell .rating-badge {
    margin-bottom: 0.5rem;
}

.comparison-comment {
    font-size: 0.8125rem;
    color: var(--slate-600);
    text-align: left;
    margin-top: 0.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.comparison-comment.expanded {
    max-height: 200px;
}

.toggle-comment {
    font-size: 0.75rem;
    color: var(--teal-600);
    cursor: pointer;
    font-weight: 600;
}

.toggle-comment:hover {
    text-decoration: underline;
}

/* ================================
   ALERTS
   ================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: var(--rating-green-light);
    color: var(--rating-green-dark);
    border: 1px solid var(--rating-green);
}

.alert-error {
    background: var(--rating-purple-light);
    color: var(--rating-purple-dark);
    border: 1px solid var(--rating-purple);
}

.alert-warning {
    background: var(--rating-yellow-light);
    color: var(--rating-yellow-dark);
    border: 1px solid var(--rating-yellow);
}

/* ================================
   EMPTY STATE
   ================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--slate-500);
}

.empty-state .icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.125rem;
    color: var(--slate-700);
    margin-bottom: 0.5rem;
}

/* ================================
   SEARCH & FILTER
   ================================ */
.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box input {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1rem;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all var(--transition-base);
}

.search-box input:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

/* ================================
   TEACHER SELECTION
   ================================ */
.teacher-select-container {
    margin-bottom: 1.5rem;
}

.teacher-list {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .teacher-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .teacher-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.teacher-item {
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
}

.teacher-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--teal-200);
}

.teacher-item .name {
    font-weight: 700;
    color: var(--slate-800);
}

.teacher-item .count {
    font-size: 0.875rem;
    color: var(--slate-500);
    font-weight: 500;
}

/* ================================
   COMPARISON SELECTION
   ================================ */
.comparison-select {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.comparison-checkbox {
    display: none;
}

.comparison-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.comparison-label:hover {
    border-color: var(--slate-300);
}

.comparison-checkbox:checked + .comparison-label {
    border-color: var(--teal-500);
    background: rgba(20, 184, 166, 0.05);
    box-shadow: var(--glow-teal);
}

.comparison-label .check-icon {
    width: 28px;
    height: 28px;
    border: 2px solid var(--slate-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    font-size: 0.875rem;
    color: transparent;
    flex-shrink: 0;
}

.comparison-checkbox:checked + .comparison-label .check-icon {
    background: var(--teal-500);
    border-color: var(--teal-500);
    color: #fff;
}

.comparison-label .details {
    flex: 1;
}

.comparison-label .date {
    font-weight: 700;
    color: var(--slate-800);
}

.comparison-label .info {
    font-size: 0.875rem;
    color: var(--slate-500);
    font-weight: 500;
}

/* ================================
   AUTOCOMPLETE
   ================================ */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid var(--teal-500);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-lg);
    display: none;
}

.autocomplete-list.show {
    display: block;
}

.autocomplete-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-weight: 500;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: var(--slate-100);
}

/* ================================
   ACTIONS
   ================================ */
.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

/* ================================
   LOADING SPINNER
   ================================ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--slate-200);
    border-radius: 50%;
    border-top-color: var(--teal-500);
    animation: spin 0.8s linear infinite;
}

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

/* ================================
   PRINT STYLES
   ================================ */
@media print {
    /* Force browsers to print background colors */
    *,
    *::before,
    *::after {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }

    body {
        background: white !important;
        font-size: 11pt;
    }

    .main-nav,
    .main-footer,
    .no-print {
        display: none !important;
    }

    .container {
        max-width: none;
        padding: 0;
        animation: none;
    }

    .card,
    .report-header,
    .criteria-detail,
    .stat-card,
    .teacher-card {
        box-shadow: none !important;
        break-inside: avoid;
    }

    .card {
        border: 1px solid #cbd5e1;
    }

    .summary-grid {
        background: white;
        border: 1px solid #cbd5e1;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    /* Preserve rating badge colors */
    .rating-badge.green {
        background: #d1fae5 !important;
        color: #059669 !important;
    }

    .rating-badge.yellow {
        background: #fef3c7 !important;
        color: #d97706 !important;
    }

    .rating-badge.red {
        background: #ede9fe !important;
        color: #7c3aed !important;
    }

    .rating-badge.unrated {
        background: #f1f5f9 !important;
        color: #64748b !important;
    }

    /* Preserve distribution bar colors */
    [style*="background:var(--rating-green)"],
    [style*="background: var(--rating-green)"] {
        background: #10b981 !important;
    }

    [style*="background:var(--rating-yellow)"],
    [style*="background: var(--rating-yellow)"] {
        background: #f59e0b !important;
    }

    [style*="background:var(--rating-purple)"],
    [style*="background: var(--rating-purple)"] {
        background: #8b5cf6 !important;
    }

    /* Preserve card left border colors */
    [style*="border-left:4px solid var(--rating-green)"],
    [style*="border-left: 4px solid var(--rating-green)"] {
        border-left: 4px solid #10b981 !important;
    }

    [style*="border-left:4px solid var(--rating-yellow)"],
    [style*="border-left: 4px solid var(--rating-yellow)"] {
        border-left: 4px solid #f59e0b !important;
    }

    [style*="border-left:4px solid var(--rating-purple)"],
    [style*="border-left: 4px solid var(--rating-purple)"] {
        border-left: 4px solid #8b5cf6 !important;
    }

    /* Criteria comment styling */
    .criteria-comment {
        background: #f8fafc !important;
        border-left: 3px solid #14b8a6 !important;
    }

    /* Count badge backgrounds */
    [style*="background:var(--rating-green-light)"],
    [style*="background: var(--rating-green-light)"] {
        background: #d1fae5 !important;
    }

    [style*="background:var(--rating-yellow-light)"],
    [style*="background: var(--rating-yellow-light)"] {
        background: #fef3c7 !important;
    }

    [style*="background:var(--rating-purple-light)"],
    [style*="background: var(--rating-purple-light)"] {
        background: #ede9fe !important;
    }

    /* Page break control */
    .criteria-detail,
    .teacher-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    h2 {
        break-after: avoid;
        page-break-after: avoid;
    }

    /* Remove hover effects in print */
    .card:hover,
    .stat-card:hover,
    .teacher-item:hover,
    .summary-item:hover {
        box-shadow: none !important;
        transform: none !important;
    }

    /* Links print as text */
    a {
        text-decoration: none !important;
        color: inherit !important;
    }
}

/* ================================
   UTILITIES
   ================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Stagger animation utility */
.stagger-item {
    animation: fadeInUp 0.4s ease both;
}

@media (prefers-reduced-motion: reduce) {
    .stagger-item {
        animation: none;
    }
}

.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 50ms; }
.stagger-item:nth-child(3) { animation-delay: 100ms; }
.stagger-item:nth-child(4) { animation-delay: 150ms; }
.stagger-item:nth-child(5) { animation-delay: 200ms; }
.stagger-item:nth-child(6) { animation-delay: 250ms; }
.stagger-item:nth-child(7) { animation-delay: 300ms; }
.stagger-item:nth-child(8) { animation-delay: 350ms; }
.stagger-item:nth-child(9) { animation-delay: 400ms; }
.stagger-item:nth-child(10) { animation-delay: 450ms; }
