/* ==========================================================================
   ENGLISH LEARNING HUB - DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

/* 1. Core Variables & Design Tokens */
:root {
    /* Color Palette */
    --bg-darkest: #08070d;
    --bg-darker: #0f0d1a;
    --bg-card: rgba(22, 20, 38, 0.45);
    --bg-card-hover: rgba(30, 27, 51, 0.6);
    
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(99, 102, 241, 0.3);
    
    /* Brand Accents */
    --accent-primary: #6366f1; /* Indigo */
    --accent-primary-glow: rgba(99, 102, 241, 0.4);
    --accent-secondary: #a855f7; /* Purple */
    --accent-success: #10b981; /* Emerald */
    --accent-warning: #f59e0b; /* Amber */
    --accent-danger: #ef4444; /* Rose */
    --accent-info: #06b6d4; /* Cyan */
    
    /* Gradient Sets */
    --grad-primary: linear-gradient(135deg, #6366f1, #a855f7);
    --grad-success: linear-gradient(135deg, #34d399, #059669);
    --grad-info: linear-gradient(135deg, #22d3ee, #0891b2);
    --grad-warning: linear-gradient(135deg, #fbbf24, #d97706);
    --grad-bg: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #09070f 80%);
    
    /* Typography & Sizing */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Shadows */
    --shadow-soft: 0 12px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
    --shadow-inset: inset 0 2px 4px 0 rgba(255, 255, 255, 0.05);
    
    /* Transition presets */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-elastic: all 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

/* 2. Base Resets & Page Structure */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-darkest);
    background-image: var(--grad-bg);
    background-attachment: fixed;
    color: #e2e8f0;
    font-family: var(--font-body);
    font-weight: 400;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* 3. Glassmorphic Sidebar Component */
.sidebar {
    background: rgba(13, 11, 24, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding: 0 0.5rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--grad-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: var(--shadow-glow);
}

.brand h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.35rem;
    background: linear-gradient(to right, #ffffff, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

/* Navigation Links */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active a {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.1);
}

.nav-item a i {
    font-size: 1.2rem;
}

/* Sidebar Footer (User info & Quick settings) */
.sidebar-footer {
    border-top: 1px solid var(--border-glass);
    padding-top: 1.5rem;
    margin-top: auto;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--accent-primary);
    border: 1px solid var(--border-glass);
}

.user-info .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

.user-info .role {
    font-size: 0.75rem;
    color: #64748b;
}

/* 4. Core Content Containers */
.main-viewport {
    padding: 3rem 4rem;
    overflow-y: auto;
    height: 100vh;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active-view {
    display: block;
}

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

/* Section Header styling */
.section-header {
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    color: #94a3b8;
    font-size: 1rem;
}

/* 5. Glassmorphism & UI Utilities */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--shadow-soft), var(--shadow-inset);
    transition: var(--transition-normal);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }

/* Buttons styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: #e2e8f0;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ffffff;
}

/* 6. Dashboard View Details */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #fff;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.stat-icon.success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.stat-icon.info { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.stat-info .num {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.75rem;
    color: #ffffff;
    line-height: 1.2;
}

.stat-info .lbl {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Main Dashboard Panel layout */
.dashboard-panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Quote card with subtle micro-interaction */
.quote-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.quote-card::before {
    content: '"';
    position: absolute;
    right: 20px;
    bottom: -20px;
    font-size: 10rem;
    color: rgba(255, 255, 255, 0.03);
    font-family: serif;
    font-weight: 800;
}

.quote-text {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-style: italic;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.quote-author {
    color: #a855f7;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Today's Checklist Widget */
.quick-checklist h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #ffffff;
}

.checklist-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 7. Study Roadmap (Checklist) View Styling */
.roadmap-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.phase-card {
    border-left: 4px solid var(--accent-primary);
}

.phase-card.phase-1 { border-left-color: var(--accent-primary); }
.phase-card.phase-2 { border-left-color: var(--accent-info); }
.phase-card.phase-3 { border-left-color: var(--accent-secondary); }
.phase-card.phase-4 { border-left-color: var(--accent-success); }

.phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.phase-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.phase-title h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.35rem;
    color: #ffffff;
}

.phase-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* Interactive Checkboxes */
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.checkbox-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    margin-top: 0.15rem;
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: var(--transition-fast);
}

.checkbox-item input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: var(--transition-fast);
    background-color: #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox-item input[type="checkbox"]:checked {
    background: var(--grad-primary);
    border-color: transparent;
}

.checkbox-item input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.checkbox-label {
    display: flex;
    flex-direction: column;
}

.checkbox-label .title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    transition: var(--transition-fast);
}

.checkbox-item input[type="checkbox"]:checked ~ .checkbox-label .title {
    color: #64748b;
    text-decoration: line-through;
}

.checkbox-label .sub {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.1rem;
}

/* 8. Active Recall Flashcards Component */
.flashcards-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.deck-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.deck-btn {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color: #94a3b8;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.deck-btn.active {
    background: var(--grad-primary);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

/* 3D Flashcard Container */
.card-scene {
    width: 100%;
    height: 380px;
    perspective: 1200px;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.flash-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flash-card.is-flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-soft), var(--shadow-inset);
    overflow: hidden;
}

.card-face::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(to bottom right, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Front Face (Indigo Accent) */
.card-front {
    background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.15) 0%, rgba(13, 11, 24, 0.7) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.card-front .word {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-front .ipa {
    font-size: 1.15rem;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-family: var(--font-body);
}

.hint-tap {
    position: absolute;
    bottom: 2rem;
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: bounce 2s infinite;
}

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

/* Back Face (Purple Accent) */
.card-back {
    background: radial-gradient(circle at 90% 90%, rgba(168, 85, 247, 0.15) 0%, rgba(13, 11, 24, 0.85) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    transform: rotateY(180deg);
}

.card-back .meaning {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1.5rem;
    text-align: center;
}

.card-back .example-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.example-box .en {
    font-size: 0.95rem;
    color: #e2e8f0;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.example-box .zh {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Active Recall Grading Controls */
.grade-panel {
    display: flex;
    gap: 1rem;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: var(--transition-normal);
}

.grade-panel.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.grade-btn {
    flex: 1;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.grade-btn.easy { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: #34d399; }
.grade-btn.easy:hover { background: rgba(16, 185, 129, 0.2); }
.grade-btn.good { background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.2); color: #818cf8; }
.grade-btn.good:hover { background: rgba(99, 102, 241, 0.2); }
.grade-btn.hard { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #f87171; }
.grade-btn.hard:hover { background: rgba(239, 68, 68, 0.2); }

.grade-btn .lbl { font-size: 0.9rem; }
.grade-btn .sub { font-size: 0.7rem; opacity: 0.7; }

/* Custom Flashcard Addition Widget */
.add-card-panel h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* 9. Writing & Speaking Journal Sandbox */
.journal-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.writing-editor {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.word-count {
    font-size: 0.8rem;
    color: #64748b;
    align-self: flex-end;
}

.sandbox-textarea {
    width: 100%;
    height: 350px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    color: #e2e8f0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    resize: none;
    outline: none;
    transition: var(--transition-fast);
}

.sandbox-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

/* Feedback panel inside sandbox */
.feedback-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    font-size: 0.95rem;
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.feedback-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.feedback-item.error { border-left: 3px solid var(--accent-danger); }
.feedback-item.warning { border-left: 3px solid var(--accent-warning); }
.feedback-item.style { border-left: 3px solid var(--accent-info); }

.feedback-item .type {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.feedback-item.error .type { color: #f87171; }
.feedback-item.warning .type { color: #fbbf24; }
.feedback-item.style .type { color: #22d3ee; }

.feedback-item .issue {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.feedback-item .fix {
    font-size: 0.8rem;
    color: #34d399;
    font-family: monospace;
}

/* 10. Study Resources Hub */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.resource-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.resource-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 1.25rem;
}

.resource-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.resource-card p {
    color: #94a3b8;
    font-size: 0.85rem;
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

.resource-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.resource-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.08);
}

/* 11. Modal Dialog Component */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(18, 16, 31, 0.9);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    transform: translateY(20px);
    transition: var(--transition-elastic);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
}

.close-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-btn:hover {
    color: #ffffff;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* 12. Responsive Adjustments */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-panels {
        grid-template-columns: 1fr;
    }
    
    .flashcards-layout, .journal-layout {
        grid-template-columns: 1fr;
    }
    
    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none; /* Mobile navigation would normally be a dropdown or burger drawer */
    }
    
    .main-viewport {
        padding: 2rem 1.5rem;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
}
