/* HomeworkHero - Child-Friendly Modern Design System */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Bubblegum+Sans&family=Nunito:ital,wght@0,400;0,600;0,700;0,800;1,700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary: #ec4899;
    --accent-yellow: #f59e0b;
    --accent-yellow-light: #fef3c7;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;

    --bg-main: #f0f4ff;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --font-heading: 'Fredoka', cursive, system-ui, sans-serif;
    --font-fun: 'Bubblegum Sans', cursive, system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, sans-serif;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --radius-full: 9999px;

    --shadow-sm: 0 3px 8px rgba(148, 163, 184, 0.15);
    --shadow-md: 0 10px 24px rgba(148, 163, 184, 0.20);
    --shadow-lg: 0 18px 36px rgba(99, 102, 241, 0.18);

    /* Playful rainbow accents (kid-friendly redesign) */
    --rainbow: linear-gradient(90deg, #f87171, #fb923c, #facc15, #4ade80, #38bdf8, #818cf8, #e879f9);
    --rainbow-soft: linear-gradient(135deg, #a5b4fc, #c4b5fd, #f9a8d4, #fbbf24);
    --sky-blue: #38bdf8;
    --grass-green: #4ade80;
    --candy-pink: #f472b6;
    --sunny: #fbbf24;
    --coral: #fb7185;
    --mint: #6ee7b7;

    --bounce-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
    --smooth-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    background-image:
        radial-gradient(circle at 8% 12%, rgba(129, 140, 248, 0.15) 0, transparent 45%),
        radial-gradient(circle at 92% 8%, rgba(56, 189, 248, 0.18) 0, transparent 40%),
        radial-gradient(circle at 85% 88%, rgba(244, 114, 182, 0.15) 0, transparent 42%),
        radial-gradient(circle at 5% 90%, rgba(74, 222, 128, 0.18) 0, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.06) 0, transparent 60%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Floating background decorations */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle 3px at 15% 25%, rgba(129, 140, 248, 0.3) 0, transparent 100%),
        radial-gradient(circle 2px at 80% 15%, rgba(56, 189, 248, 0.3) 0, transparent 100%),
        radial-gradient(circle 3px at 70% 70%, rgba(244, 114, 182, 0.25) 0, transparent 100%),
        radial-gradient(circle 2px at 25% 80%, rgba(74, 222, 128, 0.3) 0, transparent 100%),
        radial-gradient(circle 3px at 45% 45%, rgba(251, 191, 36, 0.2) 0, transparent 100%);
    background-size: 200px 200px;
    animation: dotDrift 30s linear infinite;
}

/* Fun, chunky scrollbar */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: #eef2ff; border-radius: 999px; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--purple));
    border-radius: 999px;
    border: 3px solid #eef2ff;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--primary-hover), #7c3aed); }

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: #0f172a;
    font-weight: 600;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover {
    color: var(--primary-hover);
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* App Header */
.app-header {
    background: #ffffff;
    border-bottom: 2px solid #e0e7ff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 7px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-heading);
    font-size: 1.28rem;
    font-weight: 700;
    color: #1e1b4b;
}

.brand-title .highlight {
    color: var(--primary);
}

.badge-curriculum {
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.74rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
    border: 1px solid #fca5a5;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item {
    font-weight: 700;
    padding: 5px 11px;
    border-radius: var(--radius-md);
    color: #475569;
    font-size: 0.88rem;
}
.nav-item:hover, .nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}
button.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Question Sets Dropdown */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 270px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    z-index: 1000;
}
.nav-item-dropdown:hover .nav-dropdown-content,
.nav-dropdown-content.show {
    display: block;
}
.nav-dropdown-content a {
    display: block;
    padding: 10px 16px;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-content a:hover {
    background: #eff6ff;
    color: #2563eb;
}

/* Submissions Top Navigation Button Badge */
.nav-item-submissions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
}
.nav-submission-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    letter-spacing: -0.02em;
    transition: all 0.2s ease;
}
.nav-submission-pill.pill-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.45);
    animation: gentlePulse 2.5s infinite;
}
.nav-submission-pill.pill-urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.45);
    animation: gentlePulse 1.8s infinite;
}
.nav-submission-pill.pill-zero {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #cbd5e1;
}

.user-pill-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.user-profile-dropdown {
    position: relative;
    display: inline-block;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #f1f5f9;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.user-profile-badge:hover,
.user-profile-dropdown:hover .user-profile-badge,
.user-profile-dropdown:focus-within .user-profile-badge {
    background: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-dropdown-content {
    right: 0 !important;
    left: auto !important;
    min-width: 205px !important;
    margin-top: 6px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15) !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 6px 0 !important;
}

.user-dropdown-content::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.user-dropdown-content a {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 9px 16px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
}

.avatar-circle {
    font-size: 1.22rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-circle-sm {
    font-size: 1.2rem;
    margin-right: 6px;
}

.avatar-circle-lg {
    font-size: 2.8rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-weight: 700;
    font-size: 0.88rem;
}

.user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Flash Messages */
.flash-container {
    margin-top: 15px;
}

.flash-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-weight: 600;
    animation: slideDown 0.3s ease-out;
}

.flash-success {
    background: var(--success-light);
    color: #065f46;
    border: 2px solid #a7f3d0;
}
.flash-error {
    background: var(--danger-light);
    color: #991b1b;
    border: 2px solid #fecaca;
}
.flash-info {
    background: var(--info-light);
    color: #075985;
    border: 2px solid #bae6fd;
}

.flash-close {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 9px 18px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s var(--bounce-ease);
    font-size: 0.95rem;
}

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

.btn-start-homework {
    position: relative;
    overflow: hidden;
}
.btn-start-homework::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}
.btn-start-homework:hover::after {
    left: 130%;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-purple {
    background: var(--purple);
    color: white;
}
.btn-purple:hover {
    background: #7c3aed;
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover {
    background: #059669;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-outline {
    background: white;
    color: #334155;
    border-color: #cbd5e1;
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-danger {
    background: var(--danger-light);
    color: #b91c1c;
    border-color: #fca5a5;
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-bounce {
    animation: gentlePulse 3s infinite;
}

/* Badges & Chips */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}
.badge-pill {
    border-radius: var(--radius-full);
    background: #e2e8f0;
    color: #334155;
}
.badge-info {
    background: var(--info-light);
    color: #0369a1;
}
.badge-success {
    background: var(--success-light);
    color: #047857;
}
.badge-warning {
    background: var(--accent-yellow-light);
    color: #b45309;
}
.badge-danger {
    background: var(--danger-light);
    color: #b91c1c;
}
.badge-status-submitted {
    background: #fef3c7;
    color: #92400e;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.status-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
}
.status-published { background: #dcfce7; color: #15803d; }
.status-draft { background: #fef9c3; color: #854d0e; }
.status-closed { background: #fee2e2; color: #991b1b; }
.status-not-started { background: #f1f5f9; color: #64748b; }

.subject-tag {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

/* Content Cards */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.content-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    border-bottom: 3px dashed #e0e7ff;
    padding-bottom: 12px;
}
.card-header-flex h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-lg);
    color: #0f172a;
    transition: transform 0.2s var(--bounce-ease);
}
.metric-card:hover {
    transform: translateY(-3px) scale(1.02);
}
.card-blue { background: #eff6ff; border: 2px solid #bfdbfe; }
.card-green { background: #f0fdf4; border: 2px solid #bbf7d0; }
.card-orange { background: #fffbeb; border: 2px solid #fde68a; }
.card-purple { background: #faf5ff; border: 2px solid #e9d5ff; }

.metric-icon {
    font-size: 2.2rem;
}
.metric-content h3 {
    font-size: 1.8rem;
    line-height: 1.1;
}
.metric-content p {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.data-table th {
    background: linear-gradient(135deg, #eef2ff 0%, #ede9fe 100%);
    padding: 12px 14px;
    text-align: left;
    font-weight: 800;
    font-family: var(--font-heading);
    color: #4338ca;
    border-bottom: 2px solid var(--border-color);
}
.data-table th:first-child { border-top-left-radius: var(--radius-md); }
.data-table th:last-child { border-top-right-radius: var(--radius-md); }
.data-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.data-table tr:nth-child(even) td {
    background: #f8fafc;
}
.data-table tr:hover td {
    background: var(--primary-light);
}
.table-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Homework Banner */
.hw-banner-card {
    background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%);
    border-radius: var(--radius-xl);
    padding: 28px;
    border: 2px solid #c7d2fe;
    box-shadow: var(--shadow-md);
}
.hw-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.hw-title {
    font-size: 1.8rem;
    margin: 8px 0;
}
.hw-desc {
    color: #475569;
    max-width: 650px;
}
.hw-banner-stats {
    display: flex;
    gap: 16px;
}
.stat-box {
    background: white;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.hw-action-bar {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    position: relative;
}

/* Questions Cards */
.question-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 18px;
    transition: border-color 0.2s ease;
}
.question-card:hover {
    border-color: #cbd5e1;
}
.q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.q-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.q-number {
    font-family: var(--font-heading);
    background: #e2e8f0;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 700;
}
.q-text {
    font-size: 1.15rem;
    margin-bottom: 14px;
}
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.option-pill {
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}
.option-correct {
    background: #dcfce7;
    border-color: #86efac;
    color: #14532d;
    font-weight: 700;
}
.correct-tag {
    font-size: 0.75rem;
    color: #15803d;
    display: block;
}
.ans-box {
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin: 8px 0;
}
.explanation-box {
    margin-top: 10px;
    background: #fefce8;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: #854d0e;
}

/* Kid Dashboard Styles */
.kid-hero-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fef08a 0%, #fdba74 30%, #f9a8d4 60%, #c4b5fd 100%);
    border-radius: var(--radius-xl);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 12px 30px rgba(251, 191, 36, 0.25);
    border: 4px solid #fde047;
}
.kid-hero-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: var(--rainbow);
    background-size: 200% 100%;
    animation: rainbowSlide 4s linear infinite;
}
.kid-hero-banner::after {
    content: "🎈🌟☁️✨⭐";
    position: absolute;
    top: 10px;
    right: 22px;
    font-size: 1.8rem;
    letter-spacing: 10px;
    opacity: 0.6;
    animation: floatUpDown 4s ease-in-out infinite;
    pointer-events: none;
}
.hero-left {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}
.hero-avatar {
    font-size: 4.2rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
    display: inline-block;
    animation: gentleWiggle 3s ease-in-out infinite;
    background: white;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.hero-greeting {
    font-size: 2.1rem;
    color: #422006;
    font-weight: 700;
}
.hero-subtitle {
    color: #78350f;
    font-size: 1.05rem;
    font-weight: 600;
    max-width: 500px;
}
.hero-stars-card {
    position: relative;
    z-index: 1;
    background: white;
    padding: 20px 26px;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    min-width: 180px;
    border: 3px solid #fde047;
    transition: transform 0.3s var(--bounce-ease);
}
.hero-stars-card:hover {
    transform: translateY(-5px) rotate(-2deg) scale(1.03);
}
.stars-icon {
    font-size: 2.5rem;
    line-height: 1;
    display: inline-block;
    animation: starSpin 3s ease-in-out infinite;
}
.stars-count {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-yellow);
    text-shadow: 0 2px 0 rgba(245, 158, 11, 0.2);
    line-height: 1.1;
}
.stars-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #78350f;
}
.stars-badge {
    margin-top: 6px;
    background: #f0fdf4;
    color: #15803d;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

/* Kid Homework Cards */
.kid-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.kid-hw-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 22px;
    border: 3px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s var(--bounce-ease);
    position: relative;
    overflow: hidden;
}
.kid-hw-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--rainbow);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.kid-hw-card:hover {
    transform: translateY(-8px) scale(1.02) rotate(-0.5deg);
    box-shadow: 0 16px 32px rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}
.kid-hw-card:hover::before {
    opacity: 1;
}
.kid-hw-card-overdue {
    animation: overdueWiggle 2s ease-in-out infinite;
}
.status-border-evaluated { border-top: 7px solid var(--success); }
.status-border-submitted { border-top: 7px solid var(--accent-yellow); }
.status-border-in_progress { border-top: 7px solid var(--info); }
.status-border-not_started { border-top: 7px solid var(--purple); }

.card-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.due-badge {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
}
.hw-card-title {
    font-size: 1.25rem;
    margin-bottom: 6px;
}
.hw-card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-grow: 1;
}
.hw-card-meta {
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}
.hw-card-footer {
    margin-top: auto;
}

/* Taking Homework Sticky Bar */
.quiz-sticky-header {
    background: white;
    border-radius: var(--radius-xl);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    border: 2px solid #e2e8f0;
    position: sticky;
    top: 75px;
    z-index: 50;
    margin-top: 15px;
}
.quiz-header-info h2 {
    font-size: 1.35rem;
    display: inline-block;
    margin-left: 8px;
}
.autosave-pill {
    background: #f0fdf4;
    color: #15803d;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #bbf7d0;
}
.autosave-pill .dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.kid-tip-card {
    background: #fefce8;
    border: 2px dashed #fde047;
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.tip-icon { font-size: 1.8rem; }
.tip-text { font-size: 0.95rem; color: #713f12; }

/* Kid Question Taking Box - Tablet & Laptop Friendly */
.kid-question-box {
    background: white;
    border: 2.5px solid #e0e7ff;
    border-radius: var(--radius-xl);
    padding: 18px 24px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.kid-question-box:hover {
    border-color: #c7d2fe;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.12);
}
@media (max-width: 768px) {
    .kid-question-box {
        padding: 14px 16px;
    }
}
.q-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.q-badge {
    background: #e0e7ff;
    color: #4338ca;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 0.82rem;
}
.q-marks-pill {
    background: #fef3c7;
    color: #b45309;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 0.82rem;
}
.q-title {
    font-size: 1.18rem;
    margin-top: 8px;
    margin-bottom: 12px;
    line-height: 1.42;
    color: #0f172a;
}

/* Kid Options List (Responsive 2-Column Grid on Tablets & Laptops) */
.kid-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
@media (min-width: 600px) {
    .kid-options-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
.kid-option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    min-height: 52px;
    border: 2.5px solid #e2e8f0;
    border-radius: var(--radius-lg);
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.2s var(--bounce-ease);
}
.kid-option-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    transform: translateX(4px);
}
.kid-option-item.selected {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #1e1b4b;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.18);
    transform: scale(1.02);
}
.kid-option-item input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    pointer-events: none !important;
}
.option-label-chip {
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    font-family: var(--font-heading);
    transition: all 0.2s ease;
}
.kid-option-item.selected .option-label-chip {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
    transform: scale(1.1);
}
.option-label-text {
    font-size: 0.94rem;
    line-height: 1.35;
}

/* True / False Buttons */
.kid-tf-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.kid-tf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border: 3px solid #e2e8f0;
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.2s var(--bounce-ease);
}
.kid-tf-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.kid-tf-btn input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    pointer-events: none !important;
}
.kid-tf-btn.tf-true.selected {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
    box-shadow: 0 3px 12px rgba(34, 197, 94, 0.25);
    transform: scale(1.03);
}
.kid-tf-btn.tf-false.selected {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.25);
    transform: scale(1.03);
}

/* Blank & Subjective */
.kid-blank-input {
    font-size: 1.1rem;
    font-family: var(--font-heading);
    padding: 12px 16px;
    border: 2.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    background: #fafafa;
    width: 100%;
    transition: all 0.2s ease;
}
.kid-blank-input:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.kid-subj-textarea {
    font-size: 0.98rem;
    line-height: 1.5;
    padding: 12px 16px;
    border: 2.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    background: #fafafa;
    width: 100%;
    transition: all 0.2s ease;
}
.kid-subj-textarea:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Step Navigation Toolbar (STRICTLY ONE LINE) */
.step-nav-toolbar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    margin-top: 14px !important;
    padding-top: 12px !important;
    border-top: 2px dashed #e0e7ff !important;
}
.nav-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 10px 20px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    border-radius: var(--radius-lg) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-width: 150px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}
.nav-center-info {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    flex-shrink: 1 !important;
    white-space: nowrap !important;
}
.step-counter-text {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
}
.btn-compact-save {
    font-size: 0.82rem !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
}
@media (max-width: 768px) {
    .nav-btn {
        min-width: auto !important;
        padding: 8px 12px !important;
        font-size: 0.88rem !important;
    }
}

/* Quiz Bottom Bar */
.bottom-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.bottom-bar-content p {
    font-weight: 700;
    font-size: 1.1rem;
    color: #334155;
}

/* Report Card Styles */
.report-card-hero {
    background: linear-gradient(135deg, #ede9fe 0%, #fef08a 100%);
    border-radius: var(--radius-xl);
    padding: 34px;
    box-shadow: var(--shadow-md);
    border: 3px solid #ddd6fe;
    text-align: center;
}
.report-confetti-badge {
    background: #f59e0b;
    color: white;
    font-weight: 800;
    padding: 6px 18px;
    border-radius: var(--radius-full);
    font-size: 1rem;
}
.report-title {
    font-size: 2.2rem;
    margin: 14px 0 6px;
}
.report-subject {
    font-size: 1.1rem;
    color: #475569;
    font-weight: 700;
}
.score-stars-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    margin: 24px 0;
}
.score-circle {
    width: 130px;
    height: 130px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    border: 4px solid var(--primary);
}
.circle-score {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
}
.circle-max {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.percentage-pill {
    background: var(--primary);
    color: white;
    font-size: 1.4rem;
    font-weight: 800;
    padding: 6px 18px;
    border-radius: var(--radius-full);
    display: inline-block;
}
.stars-awarded {
    font-size: 2rem;
    margin: 8px 0;
}
.teacher-feedback-note {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    border-left: 6px solid var(--purple);
}
.feedback-icon { font-size: 2.2rem; }

/* Review List */
.review-qa-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: transform 0.2s ease;
}
.review-qa-card:hover {
    transform: translateY(-2px);
}
.qa-success { border-left: 8px solid var(--success); }
.qa-wrong { border-left: 8px solid var(--danger); }
.qa-neutral { border-left: 8px solid var(--purple); }

.review-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.tag-correct { color: #15803d; font-weight: 800; }
.tag-wrong { color: #b91c1c; font-weight: 800; }
.tag-manual { color: #6d28d9; font-weight: 800; }
.student-ans-pill {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: inline-block;
}
.ans-pill-correct {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1.5px solid #86efac !important;
}
.ans-pill-wrong {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1.5px solid #fca5a5 !important;
}
.correct-ans-pill {
    background: #dcfce7;
    color: #14532d;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

/* Student Result Review Options */
.review-options-section {
    margin: 12px 0 16px 0;
}
.review-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.review-opt-card {
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.2s ease;
}
.review-opt-card.opt-selected-correct {
    border-color: #10b981 !important;
    background: #ecfdf5 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.review-opt-card.opt-selected-wrong {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
}
.review-opt-card.opt-expected {
    border-color: #3b82f6 !important;
    background: #eff6ff !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-card {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    animation: zoomIn 0.25s ease-out;
}
.modal-lg { max-width: 800px; }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    border-bottom: 3px dashed #e0e7ff;
    padding-bottom: 10px;
}
.close-btn {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    color: #475569;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.close-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
    transform: scale(1.08);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    border-top: 3px dashed #e0e7ff;
    padding-top: 15px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-row {
    display: flex;
    gap: 16px;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.92rem;
    color: #334155;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.form-input-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}
.form-textarea-sm {
    padding: 8px 12px;
    font-size: 0.88rem;
}
.form-textarea-lg {
    padding: 12px 16px;
    font-size: 1rem;
}
.form-input-lg {
    padding: 12px 16px;
    font-size: 1.05rem;
}

/* Auth Page */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 15px;
}
.auth-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 34px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-md);
    border: 3px solid #e0e7ff;
}
.auth-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-avatar-hero {
    font-size: 3rem;
    margin: 8px 0;
}
.demo-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}
.demo-user-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    color: #334155;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}
.demo-user-card:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}
.credentials-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* Footer */
.app-footer {
    margin-top: auto;
    background: white;
    border-top: 3px solid #e0e7ff;
    padding: 24px 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Keyframes */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}
@keyframes rainbowSlide {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}
@keyframes floatUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes gentleWiggle {
    0%, 100% { transform: rotate(-5deg) scale(1); }
    50% { transform: rotate(7deg) scale(1.05); }
}
@keyframes starSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(20deg) scale(1.15); }
}
@keyframes dotDrift {
    0% { background-position: 0 0; }
    100% { background-position: 200px 200px; }
}
@keyframes overdueWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-0.5deg); }
    75% { transform: rotate(0.5deg); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.5) translateY(30px); }
    60% { opacity: 1; transform: scale(1.05) translateY(-5px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes popIn {
    0% { opacity: 0; transform: scale(0); }
    80% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* Utility animation classes */
.animate-bounce-in {
    animation: bounceIn 0.5s var(--bounce-ease) forwards;
}
.animate-pop {
    animation: popIn 0.3s var(--bounce-ease) forwards;
}

@media (max-width: 768px) {
    .nav-container { flex-direction: column; align-items: stretch; }
    .nav-menu { flex-wrap: wrap; justify-content: center; }
    .hero-left { flex-direction: column; text-align: center; }
    .kid-hero-banner { flex-direction: column; text-align: center; padding: 24px; }
    .hero-stars-card { margin: 0 auto; }
    .form-row { flex-direction: column; gap: 0; }
    .bottom-bar-content { flex-direction: column; text-align: center; }
}

/* Auth Tabs */
.auth-card-wide {
    max-width: 620px;
}
.tab-pill-bar {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}
.tab-pill {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    color: #475569;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}
.tab-pill:hover {
    color: var(--primary);
}
.tab-pill.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.tab-intro {
    text-align: center;
    margin-bottom: 18px;
}

/* Pending Student Approvals */
.pending-approvals-card {
    border-left: 8px solid var(--accent-yellow);
    background: #fffdf5;
}
.pending-students-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pending-student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: white;
    border: 1px solid #fed7aa;
    border-radius: var(--radius-md);
    gap: 16px;
}
.item-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.item-actions {
    display: flex;
    gap: 8px;
}

/* Live Timer Pill */
.timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #fde68a;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}
.timer-icon {
    font-size: 1.1rem;
    animation: gentlePulse 2s infinite;
}

/* ============================================================
   Kid-Friendly Enhancements
   ============================================================ */

/* Playful empty state */
.empty-state-fun {
    text-align: center;
    padding: 40px 20px;
}
.empty-state-fun .emoji-cluster {
    font-size: 3rem;
    animation: floatUpDown 3s ease-in-out infinite;
}

/* Fun subject color coding */
.subject-math { background: #dbeafe !important; color: #1d4ed8 !important; }
.subject-science { background: #d1fae5 !important; color: #047857 !important; }
.subject-social { background: #fef3c7 !important; color: #92400e !important; }
.subject-english { background: #fce7f3 !important; color: #be185d !important; }
.subject-french { background: #ede9fe !important; color: #6d28d9 !important; }

/* Sparkle decoration */
.sparkle::before {
    content: "✨";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1.2rem;
    animation: gentlePulse 2s infinite;
}

/* Fun progress bar */
.fun-progress-track {
    height: 16px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    border: 2px solid #cbd5e1;
}
.fun-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    border-radius: var(--radius-full);
    transition: width 0.5s var(--bounce-ease);
    position: relative;
}
.fun-progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

/* ============================================================
   Tablet & Laptop Viewport Optimizations
   ============================================================ */

/* Tablet View (iPad, tablets in portrait & landscape) */
@media (min-width: 600px) and (max-width: 1024px) {
    .container {
        padding: 0 16px;
        max-width: 100%;
    }
    .kid-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .hero-welcome {
        padding: 22px;
    }
    .stat-badge-group {
        gap: 8px;
    }
    .nav-container {
        padding: 0 16px;
    }
    .kid-question-box {
        padding: 16px 20px;
    }
    .step-nav-toolbar {
        gap: 8px !important;
    }
    .nav-btn {
        padding: 9px 16px !important;
        font-size: 0.92rem !important;
        min-width: 130px !important;
    }
    .kid-options-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* Laptop View (1025px and wider) */
@media (min-width: 1025px) {
    .container {
        max-width: 1140px;
        padding: 0 20px;
    }
    .kid-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    .kid-question-box {
        padding: 20px 26px;
    }
    .kid-options-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .nav-btn {
        min-width: 160px !important;
    }
}

/* Global utility classes */
.d-none {
    display: none !important;
}

/* Playful progress bar shine (widths still set inline per data) */
.progress-fill-shine {
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    background-size: 60px 100%;
    background-repeat: no-repeat;
    animation: shineMove 2.5s ease-in-out infinite;
}
@keyframes shineMove {
    0% { background-position: -60px 0; }
    100% { background-position: 260px 0; }
}

/* Kid-friendly alert card enhancements */
.student-alerts-container { display: flex; flex-direction: column; gap: 12px; }
.student-alert-card {
    border-radius: var(--radius-lg) !important;
    transition: all 0.25s ease;
}
.student-alert-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.alert-card-maintenance {
    border: 2.5px solid #f59e0b !important;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    box-shadow: 0 4px 14px rgba(245,158,11,0.15) !important;
}
.alert-card-warning {
    border: 2.5px solid #ef4444 !important;
    background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%) !important;
    box-shadow: 0 4px 14px rgba(239,68,68,0.16) !important;
}
.alert-card-celebration, .alert-card-success {
    border: 2.5px solid #10b981 !important;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    box-shadow: 0 4px 14px rgba(16,185,129,0.16) !important;
}
.alert-card-info, .alert-card-announcement {
    border: 2.5px solid #3b82f6 !important;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    box-shadow: 0 4px 14px rgba(59,130,246,0.14) !important;
}

/* Submit modal kid-friendly enhancements */
.kid-submit-illustration {
    font-size: 3rem;
    animation: floatUpDown 2.5s ease-in-out infinite;
}

/* ---- Single-line Updates Dropdown in Top Bar ---- */
.nav-updates-dropdown-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.nav-updates-btn {
    background: #fffbeb !important;
    color: #92400e !important;
    border: 1.5px solid #f59e0b !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    padding: 5px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    font-size: 0.82rem !important;
    transition: all 0.2s ease !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.nav-updates-btn:hover {
    background: #fef3c7 !important;
    transform: translateY(-1px);
}
.nav-updates-count-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1;
}
.nav-updates-caret {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-left: 2px;
}
.nav-updates-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 560px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    overflow: hidden;
    animation: kdFadeSlide 0.2s ease-out;
}
@media (max-width: 860px) {
    .nav-updates-panel {
        position: fixed;
        top: 64px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        border-radius: 18px;
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
    }
}
@media (max-width: 640px) {
    .nav-updates-panel {
        top: 56px;
        left: 8px;
        right: 8px;
    }
    .up-linear-author {
        display: none !important;
    }
    .up-linear-title {
        max-width: 130px !important;
    }
}
.nav-updates-header {
    padding: 10px 14px;
    background: #fffbeb;
    border-bottom: 1.5px solid #fde68a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-updates-title {
    font-weight: 800;
    font-size: 0.88rem;
    color: #78350f;
}
.nav-updates-close {
    background: transparent;
    border: none;
    color: #78350f;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    touch-action: manipulation;
}
.nav-updates-body {
    max-height: 380px;
    overflow-y: auto;
    overflow-x: auto;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
}
.nav-updates-list-linear {
    display: flex;
    flex-direction: column;
    min-width: 100%;
}
.nav-update-row-linear {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.82rem;
    transition: background 0.15s ease;
    white-space: nowrap;
    min-width: fit-content;
}
.nav-update-row-linear:last-child {
    border-bottom: none;
}
.nav-update-row-linear:hover {
    background: #f8fafc;
}
.up-linear-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.up-linear-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.up-linear-badge.badge-evaluated {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}
.up-linear-badge.badge-assigned {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}
.up-linear-title {
    font-weight: 700;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    flex-shrink: 1;
}
.up-linear-score {
    font-size: 0.76rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
    flex-shrink: 0;
}
.up-linear-score.score-high {
    background: #dcfce7;
    color: #15803d;
}
.up-linear-score.score-med {
    background: #fef3c7;
    color: #92400e;
}
.up-linear-score.score-low {
    background: #fee2e2;
    color: #991b1b;
}
.up-linear-author {
    color: #64748b;
    font-size: 0.74rem;
    flex-shrink: 0;
}
.up-linear-time {
    color: #94a3b8;
    font-size: 0.72rem;
    margin-left: auto;
    flex-shrink: 0;
}
.up-linear-arrow {
    color: #2563eb;
    font-weight: 800;
    margin-left: 4px;
    flex-shrink: 0;
}
.up-linear-unread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 2px #dbeafe;
    flex-shrink: 0;
    display: inline-block;
}
.nav-update-row-linear.is-read {
    opacity: 0.68;
    background: #fafbfc;
}
.nav-update-row-linear.is-read:hover {
    opacity: 1;
    background: #f1f5f9;
}
.nav-update-row-linear.is-read .up-linear-title {
    font-weight: 600;
    color: #475569;
}
.nav-updates-mark-all {
    background: #fef3c7;
    border: 1px solid #fde047;
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.15s ease;
}
.nav-updates-mark-all:hover {
    background: #fde68a;
    color: #78350f;
}

/* ---- Admin Activity Feed in Top Bar ---- */
.badge-admin-act {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-size: 0.66rem !important;
}
.nav-admin-act-row {
    position: relative !important;
    padding-right: 32px !important;
    transition: all 0.2s ease;
}
.nav-admin-act-link {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
    text-decoration: none !important;
    color: inherit !important;
}
.nav-admin-act-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    max-width: 270px;
}
.nav-admin-act-title {
    max-width: 270px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.8rem;
}
.nav-admin-act-sub {
    font-size: 0.71rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}
.nav-admin-act-dismiss {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    z-index: 2;
}
.nav-admin-act-dismiss:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* ---- Admin Top Bar Alert Buttons ---- */
.nav-item-review-alert, .nav-item-overdue-alert {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    padding: 5px 12px !important;
    font-size: 0.82rem !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}
.nav-item-review-alert {
    background: #fff7ed !important;
    color: #c2410c !important;
    border: 1.5px solid #fb923c !important;
}
.nav-item-review-alert:hover {
    background: #ffedd5 !important;
    transform: translateY(-1px);
}
.nav-item-overdue-alert {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1.5px solid #f87171 !important;
}
.nav-item-overdue-alert:hover {
    background: #fee2e2 !important;
    transform: translateY(-1px);
}
.nav-alert-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
}
.nav-alert-pill.pill-urgent {
    background: #ea580c;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(234, 88, 12, 0.4);
    animation: gentlePulse 2s infinite;
}
.nav-alert-pill.pill-warning {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(220, 38, 38, 0.4);
    animation: gentlePulse 1.8s infinite;
}
.nav-alert-pill.pill-zero {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #cbd5e1;
}

