/* Almahdi Platform — Global Styles */
/* Mobile-first, Arabic RTL layout */
/* Palette: Indigo #4F46E5 + Amber #F59E0B */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
  --red: #e74c3c;
  --red-bg: #fdf0ef;
  --yellow: #d97706;
  --yellow-bg: #fffbeb;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --primary: #4F46E5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --accent: #F59E0B;
  --accent-dark: #d97706;
  --grey: #9ca3af;
  --grey-light: #f8f9fb;
  --white: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --shadow: 0 2px 10px rgba(79, 70, 229, 0.08);
  --shadow-md: 0 4px 20px rgba(79, 70, 229, 0.12);
  --radius: 12px;
}

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

body {
  direction: rtl;
  font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
  background-color: var(--grey-light);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

/* ─── TYPOGRAPHY ─── */
h1 { font-size: 1.8rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { font-size: 0.95rem; }

/* ─── LAYOUT ─── */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 24px 16px;
}

/* ─── NAVBAR ─── */
.navbar {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
}

.navbar nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-right: 20px;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.navbar nav a:hover,
.navbar nav a.active {
  color: var(--white);
}

/* ─── CARDS ─── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  border-bottom: 2px solid var(--grey-light);
  padding-bottom: 8px;
}

/* ─── FORMS ─── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.9rem;
}

.form-control,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  direction: rtl;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

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

/* ─── BUTTONS ─── */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  min-height: 44px;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
  opacity: 0.95;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-accent:hover { opacity: 0.9; }

.btn-green {
  background-color: var(--green);
  color: var(--white);
}

.btn-green:hover { opacity: 0.9; }

.btn-red {
  background-color: var(--red);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.6);
  color: var(--white);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--white);
}

/* Secondary button — for light backgrounds (inside cards, pages) */
.btn-secondary {
  background: var(--white);
  border: 2px solid var(--border);
  color: var(--primary);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: #f5f3ff;
}

.btn-full { width: 100%; }

/* ─── SCORE COLOR CLASSES ─── */
.score-red {
  background-color: var(--red-bg);
  border-right: 4px solid var(--red);
  color: var(--red);
}

.score-yellow {
  background-color: var(--yellow-bg);
  border-right: 4px solid var(--yellow);
  color: var(--yellow);
}

.score-green {
  background-color: var(--green-bg);
  border-right: 4px solid var(--green);
  color: var(--green);
}

.score-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.score-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 4px;
}

/* ─── BADGES ─── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-grey   { background: var(--grey-light); color: var(--grey); }
.badge-today  { background: var(--accent);    color: var(--white); }

/* ─── ALERTS ─── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-error   { background: var(--red-bg);    color: var(--red);    border-right: 3px solid var(--red); }
.alert-success { background: var(--green-bg);  color: var(--green);  border-right: 3px solid var(--green); }
.alert-warning { background: var(--yellow-bg); color: var(--yellow); border-right: 3px solid var(--yellow); }

/* ─── TABLES ─── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  background: var(--grey-light);
  color: var(--primary);
  font-weight: 700;
  padding: 10px 12px;
  text-align: right;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

tr:hover td { background: #f5f3ff; }

/* ─── AUTH PAGES ─── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
}

.auth-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo h1 {
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 800;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

/* ─── LOADING SPINNER ─── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

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

/* ─── PROGRESS BAR ─── */
.progress-bar-wrapper {
  background: var(--grey-light);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar {
  height: 100%;
  border-radius: 20px;
  transition: width 0.5s ease;
}

.progress-bar.red    { background: var(--red); }
.progress-bar.yellow { background: var(--yellow); }
.progress-bar.green  { background: var(--green); }

/* ─── UTILITY ─── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-bold   { font-weight: 700; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; align-items: center; gap: 10px; }
.flex-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ─── RESPONSIVE GRID ─── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ─── EXPANDABLE SECTIONS ─── */
.expandable-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.expandable-toggle::after {
  content: '▼';
  font-size: 0.75rem;
  transition: transform 0.2s;
  color: var(--text-muted);
  margin-right: auto;
  margin-left: 8px;
}

.expandable-toggle.open::after {
  transform: rotate(180deg);
}

.expandable-content {
  display: none;
  padding-top: 8px;
}

.expandable-content.open {
  display: block;
}

/* ─── AUTH PAGE ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 20px;
}

.logo-text {
  color: var(--white);
  font-size: 2.2rem;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.logo-sub {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  margin-top: 4px;
}

.auth-card {
  max-width: 100%;
}

.auth-title {
  margin-bottom: 20px;
  color: var(--primary);
  font-weight: 800;
}

.auth-links {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-links a { color: var(--primary); text-decoration: none; font-weight: 700; }
.auth-links .divider { margin: 0 8px; }

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

/* ─── NAVBAR ADDITIONS ─── */
.nav-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
  padding: 4px 2px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--white);
}

.nav-link.active {
  border-bottom: 2px solid var(--accent);
}

/* ─── BTN SIZES ─── */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  min-height: 34px;
}

/* ─── DASHBOARD ─── */
.dashboard-header {
  padding: 28px 0 16px;
}

.dashboard-header h1 {
  margin-bottom: 4px;
  font-weight: 800;
}

/* ─── FEATURE GRID ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

@media (max-width: 360px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.18s, box-shadow 0.18s;
  border: 1.5px solid transparent;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79, 70, 229, 0.15);
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  margin-bottom: 6px;
  color: var(--primary);
  font-weight: 700;
}

.feature-card p { color: var(--text-muted); font-size: 0.85rem; }

/* ─── SECTIONS ─── */
.section {
  margin-top: 32px;
}

.section-title {
  margin-bottom: 16px;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
  font-weight: 700;
}

/* ─── PAGE HEADER ─── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 16px;
}

/* ─── TEACHER OVERVIEW BARS ─── */
.category-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.cat-name { min-width: 100px; font-weight: 700; font-size: 0.9rem; }
.cat-students { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

.bar-container {
  flex: 1;
  background: var(--grey-light);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
}

.bar {
  height: 100%;
  border-radius: 20px;
  transition: width 0.5s;
  min-width: 4px;
}

.bar.score-red   { background: var(--red);    border: none; }
.bar.score-yellow { background: var(--yellow); border: none; }
.bar.score-green { background: var(--green);  border: none; }

.cat-score {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 42px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ─── DATA TABLES ─── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--grey-light); padding: 10px 12px; text-align: right; font-size: 0.85rem; color: var(--primary); font-weight: 700; border-bottom: 2px solid var(--border); }
.data-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: #f5f3ff; }
.student-link { color: var(--primary); text-decoration: none; font-weight: 700; }
.student-link:hover { color: var(--primary-light); text-decoration: underline; }
.rank-first td { background: var(--green-bg); }

.score-value { font-weight: 700; }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* ─── COURSE CARDS ─── */
.course-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.course-info h3 { margin-bottom: 4px; color: var(--primary); }
.course-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }
.course-actions { display: flex; gap: 8px; flex-shrink: 0; }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }

/* ─── SETUP STEPS ─── */
.setup-step { margin-bottom: 24px; }
.setup-step h2 { margin-bottom: 8px; }

/* ─── MODALS ─── */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 1;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 { margin-bottom: 20px; color: var(--primary); }
.modal-actions { display: flex; gap: 12px; margin-top: 16px; }

/* ─── CURRICULUM TREE ─── */
.curriculum-category { margin-bottom: 20px; }
.cat-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cat-header h3 { flex: 1; }
.color-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.curriculum-unit { border-right: 3px solid var(--border); padding-right: 16px; margin-bottom: 12px; }
.unit-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.unit-number { background: var(--primary); color: var(--white); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.unit-header strong { flex: 1; }

.curriculum-lesson { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.lesson-number { color: var(--text-muted); font-size: 0.8rem; min-width: 20px; }

/* ─── EXAM CARDS ─── */
.exam-card { display: flex; justify-content: space-between; align-items: center; }
.exam-info h3 { margin-bottom: 4px; color: var(--primary); }
.exam-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }
.exam-actions { flex-shrink: 0; }

/* ─── EXAM RESULTS TABLE ─── */
.results-table .student-name { font-weight: 700; font-size: 1rem; }
.category-details { padding: 12px; background: var(--grey-light); border-radius: 8px; }
.cat-detail-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.9rem; }

/* ─── CATEGORY SCORE CARDS ─── */
.category-card { margin-bottom: 16px; }
.card-red    { border-right: 4px solid var(--red); }
.card-yellow { border-right: 4px solid var(--yellow); }
.card-green  { border-right: 4px solid var(--green); }

.cat-card-header { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.cat-card-header h3 { flex: 1; }
.cat-card-score { display: flex; align-items: center; gap: 8px; }
.expand-arrow { color: var(--text-muted); font-size: 0.75rem; }

.big-score { font-size: 1.4rem; font-weight: 700; }
.big-score.score-red    { color: var(--red);    background: none; border: none; }
.big-score.score-yellow { color: var(--yellow); background: none; border: none; }
.big-score.score-green  { color: var(--green);  background: none; border: none; }

.lessons-section { padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; }
.lesson-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.lesson-name { flex: 1; }
.lesson-unit { font-size: 0.8rem; }
.lesson-score { font-weight: 700; font-size: 0.85rem; }
.lesson-score.score-red    { color: var(--red);    background: none; border: none; }
.lesson-score.score-yellow { color: var(--yellow); background: none; border: none; }
.lesson-score.score-green  { color: var(--green);  background: none; border: none; }

/* ─── OVERALL SCORE ─── */
.overall-score-card {
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-bottom: 24px;
}

.overall-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}

.overall-label {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 6px;
}

.overall-course {
  font-size: 0.85rem;
  margin-top: 4px;
  opacity: 0.8;
}

.overall-score-card.score-red    { background: var(--red-bg);    color: var(--red); }
.overall-score-card.score-yellow { background: var(--yellow-bg); color: var(--yellow); }
.overall-score-card.score-green  { background: var(--green-bg);  color: var(--green); }

/* ─── EXAM RESULT CARDS (student) ─── */
.exam-result-card { margin-bottom: 16px; }
.exam-result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.exam-result-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; margin-top: 10px; }

/* ─── MOBILE ADJUSTMENTS ─── */
@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; }
  .nav-link { font-size: 0.8rem; }
  h1 { font-size: 1.4rem; }
  .score-number { font-size: 2rem; }
  .course-card { flex-direction: column; align-items: flex-start; }
  .exam-card { flex-direction: column; align-items: flex-start; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .navbar { padding: 12px 16px; }
  .dashboard-header { padding: 20px 0 12px; }
}

/* ============================================
   MOBILE NAVBAR — HAMBURGER MENU
   ============================================ */

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.nav-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: white;
  z-index: 999;
  padding: 60px 0 24px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  flex-direction: column;
  overflow-y: auto;
  direction: rtl;
}

.nav-mobile-menu .nav-link {
  display: block;
  padding: 16px 24px;
  font-size: 1rem;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}

.nav-mobile-menu .nav-link:hover {
  background: #f8f9fa;
}

.nav-mobile-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  color: #666;
}

.nav-mobile-menu.open,
.nav-mobile-overlay.open {
  display: flex;
}

/* Logout button inside mobile menu — override .btn-outline white colors
   which are designed for the dark navbar and are invisible on white background */
.nav-mobile-menu form {
  display: block;
}

.nav-mobile-menu form button {
  display: block;
  width: 100%;
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  text-align: right;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  color: var(--red);
  cursor: pointer;
  min-height: 48px;
  border-radius: 0;
}

.nav-mobile-menu form button:hover {
  background: var(--red-bg);
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }
  
  .navbar .nav-links {
    display: none !important;
  }
  
  .navbar .logout-btn {
    display: none !important;
  }
}

/* ============================================
   EDUCATIONAL PLATFORM UI IMPROVEMENTS
   ============================================ */

/* Cards — more depth and breathing room */
.card {
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* Feature grid cards on student dashboard */
.feature-card {
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

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

/* Score display — make it prominent */
.score-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
}

@media (max-width: 480px) {
  .score-number {
    font-size: 2.2rem;
  }
}

/* Buttons — more comfortable touch targets */
.btn {
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

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

/* Quiz option buttons — educational app style */
.option-btn {
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 1rem;
  text-align: right;
  width: 100%;
  min-height: 56px;
  border: 2px solid #e0e0e0;
  background: white;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-btn:hover {
  border-color: var(--primary-color, #4a90d9);
  background: #f0f7ff;
}

.option-btn.selected {
  border-color: var(--primary-color, #4a90d9);
  background: #e8f2ff;
  font-weight: 600;
}

.option-btn.correct {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #166534;
}

.option-btn.wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

/* Page headers — clear hierarchy */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 1.3rem;
  }
}

/* Study plan day cards */
.day-card {
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}

/* Performance category cards */
.cat-card {
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
}

/* Empty states — friendly and clear */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #888;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.empty-state-text {
  font-size: 1rem;
  line-height: 1.6;
}

/* ============================================
   MOBILE-SPECIFIC IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
  /* More breathing room on content */
  .container {
    padding: 0 16px;
  }
  
  /* Larger body text for readability */
  body {
    font-size: 16px;
  }
  
  /* Cards stack with comfortable spacing */
  .card {
    margin-bottom: 16px;
  }
  
  /* Full-width buttons on mobile */
  .btn-block-mobile {
    width: 100%;
  }
  
  /* Section titles */
  .section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
  }
}

/* ============================================
   TABLET IMPROVEMENTS (768px - 1024px)
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}
