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

:root {
    --primary-color: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --secondary-color: #1976D2;
    --secondary-light: #42A5F5;
    --secondary-dark: #1565C0;
    --background: #F5F7FA;
    --surface: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #546E7A;
    --border-color: #E0E0E0;
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #f44336;
    --info: #2196F3;

    /* Subject Colors */
    --maths: #4CAF50;
    --english: #1976D2;
    --cs: #FF9800;

    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== SCROLLBAR STYLES ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}
@keyframes slideIn {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

.fade-in { animation: fadeIn 0.5s ease-in-out; }
.timer-warning { animation: pulse 1s infinite; color: var(--error) !important; }

/* ===== APP CONTAINER ===== */
.app-container { min-height: 100vh; position: relative; }

/* ===== AUTH PAGES ===== */
.auth-page { display: none; min-height: 100vh; background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark)); }
.auth-page.active { display: block; }

.auth-container {
    display: flex; min-height: 100vh; max-width: 1200px; margin: 0 auto;
    background: var(--surface); border-radius: var(--border-radius);
    overflow: hidden; box-shadow: var(--box-shadow);
}

.auth-card {
    flex: 1; padding: 40px; display: flex; flex-direction: column;
    justify-content: center; max-width: 480px; margin: 0 auto;
}

.auth-image {
    flex: 1; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex; align-items: center; justify-content: center; padding: 40px; color: white;
}
.auth-image-content { max-width: 400px; }
.auth-image h3 { font-size: 2rem; margin-bottom: 20px; }
.auth-image ul { list-style: none; }
.auth-image li { margin: 15px 0; display: flex; align-items: center; gap: 10px; }
.auth-image li i { font-size: 1.2rem; }

.logo { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 700; color: var(--primary-color); margin-bottom: 40px; }
.logo i { font-size: 2rem; }

.auth-header { text-align: center; margin-bottom: 40px; }
.auth-header h2 { font-size: 2rem; margin-bottom: 10px; color: var(--text-primary); }
.auth-header p { color: var(--text-secondary); }

/* ===== FORM STYLES ===== */
.form-group { margin-bottom: 20px; position: relative; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-primary); }
.form-group label i { margin-right: 8px; color: var(--primary-color); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 16px; border: 2px solid var(--border-color);
    border-radius: var(--border-radius); font-size: 1rem; transition: var(--transition);
    font-family: 'Inter', sans-serif;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary-color);
}

.password-toggle { position: absolute; right: 16px; top: 45px; background: none; border: none; cursor: pointer; color: var(--text-secondary); }

/* Password Strength */
.password-strength { display: flex; gap: 5px; margin-top: 8px; }
.strength-bar { height: 4px; flex: 1; background: var(--border-color); border-radius: 2px; transition: var(--transition); }
.strength-bar.active:nth-child(1) { background: var(--error); }
.strength-bar.active:nth-child(2) { background: var(--warning); }
.strength-bar.active:nth-child(3) { background: var(--success); }

/* Checkbox Styles */
.checkbox-container { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox-container input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark { height: 20px; width: 20px; background-color: #fff; border: 2px solid var(--border-color); border-radius: 4px; display: inline-block; position: relative; }
.checkbox-container:hover input ~ .checkmark { background-color: #f5f5f5; }
.checkbox-container input:checked ~ .checkmark { background-color: var(--primary-color); border-color: var(--primary-color); }
.checkmark:after { content: ""; position: absolute; display: none; }
.checkbox-container input:checked ~ .checkmark:after { display: block; }
.checkbox-container .checkmark:after { left: 6px; top: 2px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.form-options { display: flex; justify-content: flex-end; align-items: center; margin: 20px 0; }
.forgot-link { color: var(--primary-color); text-decoration: none; font-weight: 500; }
.forgot-link:hover { text-decoration: underline; }
.terms-checkbox { margin: 20px 0; }
.terms-checkbox a { color: var(--primary-color); text-decoration: none; }

/* ===== BUTTONS ===== */
.auth-btn { width: 100%; padding: 14px; background: var(--primary-color); color: white; border: none; border-radius: var(--border-radius); font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.auth-btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(46,125,50,0.3); }

.btn-primary { background: var(--primary-color); color: white; border: none; padding: 12px 24px; border-radius: var(--border-radius); font-size: 0.95rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(46,125,50,0.3); }

.btn-secondary { background: transparent; color: var(--primary-color); border: 2px solid var(--primary-color); padding: 12px 24px; border-radius: var(--border-radius); font-size: 0.95rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); }
.btn-secondary:hover { background: rgba(46,125,50,0.1); transform: translateY(-2px); }

.btn-icon { width: 45px; height: 45px; border-radius: 50%; border: none; background: var(--surface); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); box-shadow: var(--box-shadow); }
.btn-icon:hover { background: var(--primary-color); color: white; transform: rotate(5deg); }

.btn-icon-small { width: 35px; height: 35px; border-radius: 50%; border: none; background: transparent; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.btn-icon-small:hover { background: rgba(0,0,0,0.05); }

.btn-start { background: var(--primary-color); color: white; border: none; padding: 8px 16px; border-radius: var(--border-radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: var(--transition); }
.btn-start:hover { background: var(--primary-dark); }

.btn-study { background: var(--secondary-color); color: white; border: none; padding: 8px 16px; border-radius: var(--border-radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: var(--transition); }
.btn-study:hover { background: var(--secondary-dark); }

.btn-review { flex: 1; padding: 15px; border: none; border-radius: var(--border-radius); font-size: 1rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); }
.btn-review#hardBtn { background: var(--error); color: white; }
.btn-review#goodBtn { background: var(--warning); color: white; }
.btn-review#easyBtn { background: var(--success); color: white; }
.btn-review:hover { transform: translateY(-2px); filter: brightness(1.1); }

.btn-close { background: none; border: none; font-size: 1.2rem; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.btn-close:hover { color: var(--error); transform: scale(1.1); }

.btn-practice { background: var(--secondary-color); color: white; border: none; padding: 8px 16px; border-radius: var(--border-radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: var(--transition); width: 100%; margin-top: 10px; }
.btn-practice:hover { background: var(--secondary-dark); }

.btn-change-avatar { background: var(--primary-color); color: white; border: none; padding: 8px 16px; border-radius: var(--border-radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: var(--transition); }
.btn-change-avatar:hover { background: var(--primary-dark); }

/* ===== AUTH FOOTER ===== */
.auth-footer { text-align: center; margin-top: 30px; color: var(--text-secondary); }
.auth-footer a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.stats-mini { display: flex; gap: 30px; margin-top: 30px; }
.stat-item { text-align: center; }
.stat-number { font-size: 2rem; font-weight: 700; display: block; }
.stat-label { font-size: 0.9rem; opacity: 0.9; }

/* ===== MAIN APP LAYOUT ===== */
.main-app { display: none; min-height: 100vh; }
.main-app.active { display: flex; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--surface); box-shadow: 2px 0 10px rgba(0,0,0,0.05); display: flex; flex-direction: column; position: fixed; height: 100vh; transition: var(--transition); z-index: 1000; }
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-header { padding: 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-color); }
.sidebar.collapsed .logo span { display: none; }

.sidebar-toggle { background: none; border: none; font-size: 1.2rem; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.sidebar-toggle:hover { color: var(--primary-color); }

/* User Info */
.user-info { padding: 20px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--border-color); }
.sidebar.collapsed .user-details, .sidebar.collapsed .streak-badge span { display: none; }

.user-avatar { width: 50px; height: 50px; border-radius: 50%; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-details h4 { font-size: 1rem; margin-bottom: 4px; }
.user-details p { font-size: 0.85rem; color: var(--text-secondary); }

.streak-badge { background: var(--warning); color: white; padding: 5px 10px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 5px; margin-left: auto; }

/* Sidebar Navigation */
.sidebar-nav { flex: 1; padding: 20px 0; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav li { margin: 5px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 15px; padding: 12px 20px; color: var(--text-secondary); text-decoration: none; transition: var(--transition); border-left: 3px solid transparent; }
.sidebar.collapsed .sidebar-nav a span { display: none; }
.sidebar-nav a i { font-size: 1.2rem; width: 24px; text-align: center; }
.sidebar-nav li.active a { background: rgba(46,125,50,0.1); color: var(--primary-color); border-left-color: var(--primary-color); }
.sidebar-nav a:hover { background: rgba(46,125,50,0.05); color: var(--primary-color); }

/* Sidebar Footer */
.sidebar-footer { padding: 20px; border-top: 1px solid var(--border-color); }
.sidebar.collapsed .daily-goal, .sidebar.collapsed .logout-btn span { display: none; }

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

.progress-bar { height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.progress { height: 100%; background: var(--primary-color); border-radius: 4px; transition: width 0.3s ease; }

.logout-btn { width: 100%; padding: 10px; background: none; border: 1px solid var(--border-color); border-radius: var(--border-radius); color: var(--error); font-size: 0.95rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: var(--transition); }
.logout-btn:hover { background: var(--error); color: white; border-color: var(--error); }

/* Main Content */
.main-content { flex: 1; margin-left: var(--sidebar-width); transition: var(--transition); min-height: 100vh; background: var(--background); }
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* Pages */
.page { display: none; padding: 30px; }
.page.active { display: block; animation: fadeIn 0.5s ease-in-out; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.admin-content { background: var(--surface); border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
.page-header h1 { font-size: 2rem; color: var(--text-primary); }
.header-actions { display: flex; gap: 10px; }

/* Welcome Banner */
.welcome-banner { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); padding: 30px; border-radius: var(--border-radius); color: white; margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; }
.welcome-text h2 { font-size: 1.8rem; margin-bottom: 10px; }
.welcome-text p { opacity: 0.9; }
.welcome-stats .stat { background: rgba(255,255,255,0.2); padding: 15px 25px; border-radius: var(--border-radius); text-align: center; }
.welcome-stats .stat-value { font-size: 2rem; font-weight: 700; display: block; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--surface); padding: 20px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); display: flex; align-items: center; gap: 20px; transition: var(--transition); }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.1); }

.stat-icon { width: 60px; height: 60px; border-radius: 50%; background: rgba(46,125,50,0.1); display: flex; align-items: center; justify-content: center; }
.stat-icon i { font-size: 1.8rem; color: var(--primary-color); }
.stat-content { flex: 1; }
.stat-label { display: block; color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 5px; }
.stat-value { display: block; font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }

/* Chart Container */
.chart-container { background: var(--surface); padding: 20px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); margin-bottom: 30px; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.chart-header h3 { font-size: 1.2rem; color: var(--text-primary); }
.chart-filter { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--border-radius); background: var(--surface); color: var(--text-primary); cursor: pointer; }
.chart { height: 300px; position: relative; }

/* Subjects Grid */
.subjects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
.subject-card { background: var(--surface); border-radius: var(--border-radius); padding: 20px; box-shadow: var(--box-shadow); }
.subject-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.subject-header i { font-size: 1.5rem; }
.subject-header.maths i { color: var(--maths); }
.subject-header.english i { color: var(--english); }
.subject-header.cs i { color: var(--cs); }
.subject-header h4 { font-size: 1.1rem; color: var(--text-primary); }
.subject-progress { margin-bottom: 15px; }
.progress-info { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 5px; }
.subject-stats { display: flex; gap: 15px; font-size: 0.85rem; color: var(--text-secondary); }
.subject-stats i { margin-right: 5px; }

/* Recent Activity */
.recent-activity { background: var(--surface); border-radius: var(--border-radius); padding: 20px; box-shadow: var(--box-shadow); }
.recent-activity h3 { margin-bottom: 20px; font-size: 1.2rem; }
.activity-list { display: flex; flex-direction: column; gap: 15px; }
.activity-item { display: flex; align-items: center; gap: 15px; padding: 10px; border-radius: var(--border-radius); transition: var(--transition); }
.activity-item:hover { background: rgba(0,0,0,0.02); }
.activity-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.activity-icon.maths   { background: rgba(76,175,80,0.1);  color: var(--maths); }
.activity-icon.english { background: rgba(25,118,210,0.1); color: var(--english); }
.activity-icon.cs      { background: rgba(255,152,0,0.1);  color: var(--cs); }
.activity-details { flex: 1; }
.activity-details h4 { font-size: 1rem; margin-bottom: 4px; }
.activity-details p { font-size: 0.85rem; color: var(--text-secondary); }
.activity-time { font-size: 0.8rem; color: var(--text-secondary); }

/* ===== QUIZZES PAGE ===== */
.filters-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.filter-group { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-select { padding: 10px 15px; border: 1px solid var(--border-color); border-radius: var(--border-radius); background: var(--surface); color: var(--text-primary); cursor: pointer; min-width: 150px; }
.search-box { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 5px 15px; min-width: 250px; }
.search-box i { color: var(--text-secondary); margin-right: 10px; }
.search-box input { border: none; outline: none; width: 100%; padding: 8px 0; font-size: 0.95rem; }

.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.quiz-card { background: var(--surface); border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--box-shadow); transition: var(--transition); }
.quiz-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.1); }

.quiz-header { padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); }

.subject-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.subject-badge.maths   { background: rgba(76,175,80,0.1);  color: var(--maths); }
.subject-badge.english { background: rgba(25,118,210,0.1); color: var(--english); }
.subject-badge.cs      { background: rgba(255,152,0,0.1);  color: var(--cs); }

.difficulty-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.difficulty-badge.easy   { background: rgba(76,175,80,0.1);  color: var(--success); }
.difficulty-badge.medium { background: rgba(255,152,0,0.1);  color: var(--warning); }
.difficulty-badge.hard   { background: rgba(244,67,54,0.1);  color: var(--error); }

.quiz-body { padding: 15px; }
.quiz-body h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-primary); }
.quiz-body p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 15px; }
.quiz-meta { display: flex; gap: 15px; font-size: 0.85rem; color: var(--text-secondary); }
.quiz-meta i { margin-right: 5px; }
.quiz-footer { padding: 15px; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.quiz-stats { font-size: 0.8rem; color: var(--text-secondary); }
.quiz-stats i { margin-right: 5px; }

/* ===== QUIZ INTERFACE ===== */
.quiz-interface { background: var(--surface); border-radius: var(--border-radius); padding: 30px; box-shadow: var(--box-shadow); }
.quiz-interface .quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.quiz-info { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.quiz-info h2 { font-size: 1.5rem; color: var(--text-primary); }

.quiz-timer { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: rgba(0,0,0,0.02); border-radius: var(--border-radius); }
.quiz-timer i { color: var(--primary-color); }

.quiz-progress { width: 100%; }
.quiz-progress span { display: block; margin-bottom: 10px; color: var(--text-secondary); }

.question-container { max-width: 800px; margin: 0 auto; }
.question-card { background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 30px; }
.question-card h3 { font-size: 1.3rem; margin-bottom: 30px; color: var(--text-primary); }

.options-grid { display: grid; gap: 15px; margin-bottom: 30px; }
.option-item { display: flex; align-items: center; padding: 15px; border: 2px solid var(--border-color); border-radius: var(--border-radius); cursor: pointer; transition: var(--transition); }
.option-item:hover { border-color: var(--primary-color); background: rgba(46,125,50,0.05); }
.option-item input[type="radio"] { margin-right: 15px; accent-color: var(--primary-color); transform: scale(1.2); }
.option-text { font-size: 1rem; }
.question-navigation { display: flex; justify-content: space-between; gap: 15px; }

/* ===== QUIZ RESULTS ===== */
.quiz-results { background: var(--surface); border-radius: var(--border-radius); padding: 40px; box-shadow: var(--box-shadow); }
.results-card { max-width: 600px; margin: 0 auto; text-align: center; }
.results-header { margin-bottom: 30px; }
.results-header i { font-size: 4rem; color: var(--warning); margin-bottom: 15px; }
.results-header h2 { font-size: 2rem; margin-bottom: 10px; }
.results-header p { color: var(--text-secondary); }

.score-circle { width: 200px; height: 200px; margin: 0 auto 30px; position: relative; }
.circular-chart { width: 100%; height: 100%; }
.circle-bg { stroke: var(--border-color); stroke-width: 2; fill: none; }
.circle { stroke: var(--primary-color); stroke-width: 2; fill: none; stroke-linecap: round; transition: stroke-dasharray 1s ease; }
.percentage { fill: var(--text-primary); font-size: 8px; text-anchor: middle; font-weight: 600; }

.results-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.result-stat { text-align: center; }
.result-stat .stat-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 5px; }
.result-stat .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.results-actions { display: flex; gap: 15px; justify-content: center; }

/* ===== FLASHCARDS PAGE ===== */
.deck-filters { margin-bottom: 30px; }
.filter-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-tab { padding: 8px 16px; border: 1px solid var(--border-color); border-radius: 20px; background: var(--surface); color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.filter-tab:hover, .filter-tab.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
.deck-card, .flashcard-deck { background: var(--surface); border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--box-shadow); transition: transform 0.2s, box-shadow 0.2s; }
.deck-card:hover, .flashcard-deck:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.14); }

.deck-header { padding: 20px; text-align: center; border-bottom: 1px solid var(--border-color); }
.deck-header.maths   { background: rgba(76,175,80,0.1); }
.deck-header.english { background: rgba(25,118,210,0.1); }
.deck-header.cs      { background: rgba(255,152,0,0.1); }
.deck-header i { font-size: 2.5rem; margin-bottom: 10px; }
.deck-header.maths i   { color: var(--maths); }
.deck-header.english i { color: var(--english); }
.deck-header.cs i      { color: var(--cs); }
.deck-header h3, .deck-header h4 { font-size: 1.1rem; margin-bottom: 5px; color: var(--text-primary); }
.card-count { font-size: 0.85rem; color: var(--text-secondary); }

.deck-body { padding: 20px; }
.deck-progress { margin-bottom: 15px; }
.deck-meta { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-secondary); }
.deck-footer { padding: 15px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }

/* Study Interface */
.study-interface { background: var(--surface); border-radius: var(--border-radius); padding: 30px; box-shadow: var(--box-shadow); }
.study-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.study-header h2 { font-size: 1.5rem; color: var(--text-primary); }
.study-progress { flex: 1; max-width: 300px; margin: 0 20px; }
.study-progress span { display: block; margin-bottom: 5px; font-size: 0.9rem; color: var(--text-secondary); }

.flashcard-container { max-width: 600px; margin: 0 auto 30px; perspective: 1000px; }
.flashcard { width: 100%; height: 250px; cursor: pointer; position: relative; perspective: 1200px; }
.flashcard-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.6s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; align-items: center; justify-content: center; padding: 30px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
.flashcard-front { background: var(--surface); border: 2px solid var(--border-color); color: var(--text-primary); }
.flashcard-back  { background: var(--primary-color); color: white; transform: rotateY(180deg); }

.study-controls { display: flex; gap: 15px; max-width: 500px; margin: 0 auto 20px; }
.study-tips { text-align: center; color: var(--text-secondary); font-size: 0.9rem; }
.study-tips i { margin-right: 5px; color: var(--warning); }

/* ===== PROGRESS PAGE ===== */
.progress-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
.overview-card { background: var(--surface); padding: 20px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); display: flex; align-items: center; gap: 20px; }
.overview-icon { width: 60px; height: 60px; border-radius: 50%; background: rgba(46,125,50,0.1); display: flex; align-items: center; justify-content: center; }
.overview-icon i { font-size: 1.8rem; color: var(--primary-color); }
.overview-content { flex: 1; }
.overview-label { display: block; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 5px; }
.overview-value { display: block; font-size: 1.8rem; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.overview-trend { font-size: 0.85rem; }
.overview-trend.positive { color: var(--success); }
.overview-trend i { margin-right: 3px; }

.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; margin-bottom: 30px; }
.chart-card { background: var(--surface); padding: 20px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
.chart-card h3 { margin-bottom: 20px; font-size: 1.1rem; }

.subject-performance { display: flex; flex-direction: column; gap: 15px; }
.subject-performance-item { display: flex; align-items: center; gap: 10px; }
.subject-label { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.maths   { background: var(--maths); }
.dot.english { background: var(--english); }
.dot.cs      { background: var(--cs); }
.subject-bar { flex: 1; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.subject-bar .bar { height: 100%; background: var(--primary-color); border-radius: 4px; }
.subject-percent { min-width: 50px; text-align: right; font-weight: 600; }

.quiz-history { display: flex; flex-direction: column; gap: 15px; }
.history-item { display: flex; align-items: center; gap: 10px; }
.history-info { min-width: 120px; }
.history-subject { font-weight: 600; margin-right: 10px; }
.history-subject.maths   { color: var(--maths); }
.history-subject.english { color: var(--english); }
.history-subject.cs      { color: var(--cs); }
.history-score { font-weight: 600; }
.history-bar { flex: 1; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.history-bar .bar { height: 100%; background: var(--primary-color); border-radius: 4px; }
.history-date { min-width: 80px; text-align: right; font-size: 0.85rem; color: var(--text-secondary); }

.weak-topics { background: var(--surface); padding: 20px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
.weak-topics h3 { margin-bottom: 20px; }
.topics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.topic-card { border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 15px; }
.topic-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.topic-subject { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.topic-subject.maths   { background: rgba(76,175,80,0.1);  color: var(--maths); }
.topic-subject.english { background: rgba(25,118,210,0.1); color: var(--english); }
.topic-subject.cs      { background: rgba(255,152,0,0.1);  color: var(--cs); }
.topic-difficulty { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.topic-difficulty.hard   { background: rgba(244,67,54,0.1); color: var(--error); }
.topic-difficulty.medium { background: rgba(255,152,0,0.1); color: var(--warning); }
.topic-card h4 { margin-bottom: 15px; font-size: 1rem; }

/* ===== SETTINGS PAGE ===== */
.settings-container { display: flex; gap: 30px; background: var(--surface); border-radius: var(--border-radius); padding: 30px; box-shadow: var(--box-shadow); }
.settings-sidebar { width: 200px; border-right: 1px solid var(--border-color); padding-right: 20px; }
.settings-sidebar ul { list-style: none; }
.settings-sidebar li { margin-bottom: 10px; }
.settings-sidebar a { display: block; padding: 10px; color: var(--text-secondary); text-decoration: none; border-radius: var(--border-radius); transition: var(--transition); }
.settings-sidebar li.active a, .settings-sidebar a:hover { background: rgba(46,125,50,0.1); color: var(--primary-color); }
.settings-content { flex: 1; }
.settings-section { display: none; }
.settings-section.active { display: block; }
.settings-section h3 { margin-bottom: 20px; }

.avatar-upload { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
.avatar-upload img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; }

.form-input { width: 100%; padding: 10px 15px; border: 1px solid var(--border-color); border-radius: var(--border-radius); font-size: 0.95rem; font-family: 'Inter', sans-serif; }
.goal-setting { margin-bottom: 20px; }
.goal-setting label { display: block; margin-bottom: 10px; font-weight: 500; }
.slider { width: 100%; margin-bottom: 10px; }
.goal-value { display: block; text-align: center; font-weight: 600; color: var(--primary-color); }
.number-input { width: 100px; padding: 8px; border: 1px solid var(--border-color); border-radius: var(--border-radius); font-size: 0.95rem; }

/* ===== MODAL ===== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; }
.modal.active { display: flex; animation: fadeIn 0.3s ease; }
.modal-content { background: var(--surface); border-radius: var(--border-radius); width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1.2rem; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-secondary); transition: var(--transition); }
.modal-close:hover { color: var(--error); transform: scale(1.1); }
.modal-body { padding: 20px; }
.modal-footer { padding: 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== UTILITY ===== */
.time-filter { padding: 8px 15px; border: 1px solid var(--border-color); border-radius: var(--border-radius); background: var(--surface); color: var(--text-primary); cursor: pointer; }

/* ===== MOBILE TOP BAR ===== */
.mobile-topbar { display: none; }
.hamburger { display: none; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 999; }
.sidebar-overlay.active { display: block; }

/* ===== DESKTOP: full sidebar always visible ===== */
@media (min-width: 769px) {
    .mobile-topbar { display: none !important; }
    .hamburger { display: none !important; }
    .sidebar-toggle { display: none !important; }
    .sidebar-footer .logout-btn { display: none !important; }
    .sidebar-footer { display: none !important; }
    .sidebar.collapsed { width: var(--sidebar-collapsed); }
    .sidebar.collapsed .logo span,
    .sidebar.collapsed .user-details,
    .sidebar.collapsed .streak-badge span,
    .sidebar.collapsed .sidebar-nav a span,
    .sidebar.collapsed .daily-goal,
    .sidebar.collapsed .logout-btn span { display: none; }
}

/* Auto-collapse on medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .logo span,
    .sidebar .user-details,
    .sidebar .streak-badge span,
    .sidebar .sidebar-nav a span,
    .sidebar .daily-goal,
    .sidebar .logout-btn span { display: none; }
    .main-content { margin-left: var(--sidebar-collapsed); }
    .auth-container { flex-direction: column; margin: 20px; }
    .auth-card { max-width: 100%; }
}

/* ===== MOBILE (≤768px) ===== */
@media (max-width: 768px) {
    .main-app .mobile-topbar { display: flex; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; right: 0; height: 56px; background: var(--surface); }
    .header-actions #logoutHeaderBtn { display: none; }
}

#logoutHeaderBtn, .logoutHeaderBtn { display: flex; align-items: center; gap: 5px; color: var(--error); background: transparent; }
#logoutHeaderBtn .btn-text, .logoutHeaderBtn .btn-text { display: none; font-size: 0.9rem; }
@media (min-width: 769px) {
    #logoutHeaderBtn .btn-text, .logoutHeaderBtn .btn-text { display: inline; }
}
#mobileTopbar #logoutHeaderBtn .btn-text { display: none !important; }

@media (max-width: 768px) {
    .main-app .mobile-topbar { box-shadow: 0 2px 8px rgba(0,0,0,0.10); padding: 0 16px; z-index: 900; }
    .mobile-logo { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; color: var(--primary-color); }
    .mobile-logo i { font-size: 1.3rem; }
    .hamburger { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: none; background: transparent; color: var(--text-primary); font-size: 1.3rem; cursor: pointer; transition: background 0.2s; }
    .hamburger:hover { background: var(--background); }
    .sidebar { width: 280px !important; position: fixed; top: 0; left: 0; height: 100vh; transform: translateX(-100%); transition: transform 0.3s ease; z-index: 1000; box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar .logo span, .sidebar .user-details, .sidebar .streak-badge span,
    .sidebar .sidebar-nav a span, .sidebar .daily-goal, .sidebar .logout-btn span { display: initial !important; }
    .sidebar .daily-goal { display: block !important; }
    .main-content { margin-left: 0 !important; padding-top: 70px; }
    .sidebar-toggle { display: none; }
    .page { padding: 20px; }
    .page-header { flex-direction: column; gap: 15px; align-items: flex-start; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .welcome-banner { flex-direction: column; text-align: center; gap: 20px; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group { justify-content: center; }
    .search-box { width: 100%; }
    .quiz-grid { grid-template-columns: 1fr; }
    .results-stats { grid-template-columns: 1fr; }
    .results-actions { flex-direction: column; }
    .study-controls { flex-direction: column; }
    .settings-container { flex-direction: column; }
    .settings-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); padding-right: 0; padding-bottom: 20px; }
    .settings-sidebar ul { display: flex; flex-wrap: wrap; gap: 10px; }
    .charts-grid { grid-template-columns: 1fr; }
    .progress-overview { grid-template-columns: 1fr; }
    .overview-card { flex-direction: column; text-align: center; }
    .subject-performance-item { flex-wrap: wrap; }
    .history-item { flex-wrap: wrap; }
    .history-date { text-align: left; width: 100%; }
    .auth-container { flex-direction: column; margin: 20px; }
    .auth-card { max-width: 100%; }
}

@media (max-width: 480px) {
    .auth-card { padding: 20px; }
    .auth-image { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .quiz-header { flex-direction: column; align-items: flex-start; }
    .quiz-timer { width: 100%; justify-content: center; }
    .question-navigation { flex-direction: column; }
    .question-navigation button { width: 100%; }
}

/* ===== DARK MODE ===== */
body.dark-mode {
    --background: #121212;
    --surface: #1E1E1E;
    --text-primary: #E0E0E0;
    --text-secondary: #9E9E9E;
    --border-color: #333333;
    --box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
body.dark-mode .auth-page { background: linear-gradient(135deg, #0a1628, #0d1f3c); }
body.dark-mode .auth-container { background: var(--surface); }
body.dark-mode .form-group input, body.dark-mode .form-group select, body.dark-mode .form-group textarea { background: #2a2a2a; color: var(--text-primary); border-color: var(--border-color); }
body.dark-mode .sidebar { background: #1a1a1a; box-shadow: 2px 0 10px rgba(0,0,0,0.4); }
body.dark-mode .mobile-topbar { background: #1a1a1a; }
body.dark-mode .quiz-card, body.dark-mode .flashcard-deck, body.dark-mode #studyInterface .study-interface,
body.dark-mode .stat-card, body.dark-mode .subject-card, body.dark-mode .welcome-banner,
body.dark-mode .chart-container, body.dark-mode .recent-activity, body.dark-mode .settings-container,
body.dark-mode .question-card, body.dark-mode .results-card, body.dark-mode .topic-card,
body.dark-mode .weak-topics, body.dark-mode .chart-card, body.dark-mode .overview-card,
body.dark-mode .modal-content { background: var(--surface); border-color: var(--border-color); }
body.dark-mode .flashcard-front { background: #2a2a2a; border-color: var(--border-color); color: var(--text-primary); }
body.dark-mode .filter-select, body.dark-mode .search-box input, body.dark-mode .time-filter,
body.dark-mode .form-input, body.dark-mode select, body.dark-mode input[type="text"],
body.dark-mode input[type="email"], body.dark-mode input[type="password"], body.dark-mode input[type="number"],
body.dark-mode textarea { background: #2a2a2a !important; color: var(--text-primary) !important; border-color: var(--border-color) !important; }
body.dark-mode .btn-icon { background: #2a2a2a; color: var(--text-secondary); }
body.dark-mode .option-item { background: #2a2a2a; border-color: var(--border-color); }
body.dark-mode .option-item:hover, body.dark-mode .option-item:has(input:checked) { background: rgba(46,125,50,0.2); }

/* ===== FONT SIZE MODES ===== */
body.font-small  { font-size: 13px; }
body.font-medium { font-size: 16px; }
body.font-large  { font-size: 19px; }

/* ===== DESKTOP TOP NAVBAR ===== */
.desktop-navbar { display: none; }
@media (min-width: 769px) {
    .desktop-navbar { display: flex; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; right: 0; height: 64px; background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,0.08); z-index: 1100; padding: 0 28px; }
    .desktop-navbar .nav-logo { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; color: var(--primary-color); text-decoration: none; flex-shrink: 0; }
    .desktop-navbar .nav-logo i { font-size: 1.5rem; }
    .desktop-nav-links { display: flex; align-items: center; list-style: none; gap: 4px; margin: 0; padding: 0; }
    .desktop-nav-links li a { display: flex; align-items: center; gap: 8px; padding: 8px 16px; color: var(--text-secondary); text-decoration: none; border-radius: 8px; font-weight: 500; transition: var(--transition); white-space: nowrap; }
    .desktop-nav-links li a:hover { background: rgba(46,125,50,0.08); color: var(--primary-color); }
    .desktop-nav-links li.active a { background: rgba(46,125,50,0.12); color: var(--primary-color); font-weight: 600; }
    .desktop-nav-links li a i { font-size: 1rem; }
    .nav-user-section { display: flex; align-items: center; gap: 12px; }
    .nav-user-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
    .nav-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
    .nav-logout-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: none; border-radius: 8px; background: rgba(244,67,54,0.08); color: var(--error); font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: var(--transition); }
    .nav-logout-btn:hover { background: rgba(244,67,54,0.15); }
    .main-app.active .main-content-wrapper { margin-top: 64px; }
    .main-app .sidebar { display: none !important; }
    .main-app .main-content { margin-left: 0 !important; }
}

/* ===== ADMIN DASHBOARD STYLES ===== */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.admin-stat-card { background: var(--surface); border-radius: var(--border-radius); padding: 20px; box-shadow: var(--box-shadow); display: flex; align-items: center; gap: 16px; }
.admin-stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: white; flex-shrink: 0; }
.admin-stat-icon.green  { background: var(--primary-color); }
.admin-stat-icon.blue   { background: var(--secondary-color); }
.admin-stat-icon.orange { background: var(--warning); }
.admin-stat-icon.red    { background: var(--error); }
.admin-stat-info h4   { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; }
.admin-stat-info span { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }

.admin-table-section { background: var(--surface); border-radius: var(--border-radius); padding: 24px; box-shadow: var(--box-shadow); margin-bottom: 24px; overflow-x: auto; }
.admin-table-section h3 { margin-bottom: 16px; font-size: 1.1rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--border-color); color: var(--text-secondary); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(46,125,50,0.03); }
.admin-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.admin-badge.active  { background: rgba(76,175,80,0.12);  color: var(--success); }
.admin-badge.admin   { background: rgba(25,118,210,0.12); color: var(--secondary-color); }
.admin-badge.student { background: rgba(0,0,0,0.06);      color: var(--text-secondary); }
.admin-actions-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.admin-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 12px; background: var(--background); }
.admin-search input { border: none; background: transparent; outline: none; font-size: 0.9rem; color: var(--text-primary); width: 200px; }
body.dark-mode .admin-table tr:hover td { background: rgba(46,125,50,0.07); }

/* ===== SEARCH MODAL ===== */
.search-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; align-items: flex-start; justify-content: center; padding-top: 80px; }
.search-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.search-modal-box { background: var(--surface); border-radius: 16px; width: 90%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); overflow: hidden; }
.search-input-wrap { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border-color); }
.search-input-wrap i { font-size: 1.1rem; color: var(--text-secondary); }
.search-input-wrap input { flex: 1; border: none; outline: none; font-size: 1.1rem; background: transparent; color: var(--text-primary); font-family: 'Inter', sans-serif; }
.search-input-wrap input::placeholder { color: var(--text-secondary); }
.search-kbd { background: var(--background); border: 1px solid var(--border-color); border-radius: 6px; padding: 3px 8px; font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; }
.search-results-list { max-height: 360px; overflow-y: auto; padding: 8px 0; }
.search-section-label { padding: 6px 20px; font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.07em; }
.search-result-item { display: flex; align-items: center; gap: 14px; padding: 12px 20px; cursor: pointer; transition: background 0.15s; text-decoration: none; color: var(--text-primary); }
.search-result-item:hover, .search-result-item.highlighted { background: rgba(46,125,50,0.07); }
.search-result-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; flex-shrink: 0; }
.search-result-icon.maths   { background: rgba(76,175,80,0.12);  color: var(--maths); }
.search-result-icon.english { background: rgba(25,118,210,0.12); color: var(--english); }
.search-result-icon.cs      { background: rgba(255,152,0,0.12);  color: var(--cs); }
.search-result-icon.page    { background: rgba(46,125,50,0.1);   color: var(--primary-color); }
.search-result-text strong { display: block; font-size: 0.92rem; }
.search-result-text small  { color: var(--text-secondary); font-size: 0.8rem; }
.search-empty { padding: 40px 20px; text-align: center; color: var(--text-secondary); }
.search-empty i { font-size: 2rem; margin-bottom: 10px; display: block; }

/* ===== NOTIFICATIONS PANEL ===== */
.notif-panel { display: none; position: fixed; top: 70px; right: 20px; width: 340px; background: var(--surface); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); z-index: 1500; overflow: hidden; animation: fadeIn 0.2s ease; }
.notif-panel.active { display: block; }
.notif-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.notif-panel-header h4 { font-size: 1rem; font-weight: 600; }
.notif-mark-all { font-size: 0.8rem; color: var(--primary-color); background: none; border: none; cursor: pointer; font-weight: 500; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background 0.15s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--background); }
.notif-item.unread { background: rgba(46,125,50,0.04); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-color); flex-shrink: 0; margin-top: 6px; }
.notif-item.read .notif-dot { background: transparent; }
.notif-icon-wrap { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.notif-icon-wrap.quiz   { background: rgba(76,175,80,0.12);  color: var(--success); }
.notif-icon-wrap.flash  { background: rgba(25,118,210,0.12); color: var(--secondary-color); }
.notif-icon-wrap.streak { background: rgba(255,152,0,0.12);  color: var(--warning); }
.notif-icon-wrap.tip    { background: rgba(33,150,243,0.12); color: var(--info); }
.notif-body strong { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; }
.notif-body p  { font-size: 0.82rem; color: var(--text-secondary); }
.notif-time { font-size: 0.75rem; color: var(--text-secondary); margin-top: 3px; }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--text-secondary); font-size: 0.9rem; }
.notif-badge { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--error); color: white; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
.nav-icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--background); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: var(--transition); }
.nav-icon-btn:hover { background: rgba(46,125,50,0.1); color: var(--primary-color); }
body.dark-mode .notif-item.unread { background: rgba(46,125,50,0.08); }
body.dark-mode .search-modal-box { background: var(--surface); }
