@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #0f172a;
  --accent: #10b981;
  --accent-hover: #059669;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(226, 232, 240, 0.8);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --sidebar-width: 260px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 30px rgba(79, 70, 229, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.06);
  --font-kh: 'Ang DaunTeav', 'Kantumruy Pro', sans-serif;
  --font-en: 'Times New Roman', Times, serif;
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

body {
  font-family: var(--font-kh), var(--font-en), sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.85;
  /* Roomy line-height for Khmer script */
  -webkit-font-smoothing: antialiased;
}

/* Apply Khmer font and normal spacing to Khmer text blocks */
h1,
h2,
h3,
h4,
h5,
h6,
.brand,
.kh-font,
select,
input,
button,
textarea {
  font-family: var(--font-kh), var(--font-en), sans-serif;
  letter-spacing: normal;
  /* Connected Khmer characters */
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: var(--primary-hover);
}

/* Container */
.container {
  width: min(1200px, calc(100% - 2.5rem));
  margin: 0 auto;
}

/* Header & Navbar */
header.app-header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand span {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a:not(.btn) {
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links a:not(.btn):hover {
  color: var(--primary);
}

.nav-links .user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  background: rgba(79, 70, 229, 0.08);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  color: var(--primary);
  font-weight: 600;
}

/* Hero Section */
.hero {
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.hero-tag {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: normal;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--secondary);
  font-weight: 600;
  /* Soft semi-bold */
  line-height: 1.35;
  /* Friendly space between lines */
  margin-bottom: 1.5rem;
  letter-spacing: normal;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  /* Friendly padding */
  border-radius: 12px;
  /* Soft friendly rounded corner */
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
  letter-spacing: normal;
  /* Connected Khmer characters */
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  /* Vibrant Indigo-Blue Gradient */
  color: white !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  /* Color Matching Glow */
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  /* Physics Lift and Zoom */
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
  /* Press down feedback */
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--secondary) !important;
  border: 1px solid rgba(79, 70, 229, 0.15);
  /* Friendly colored border */
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.btn-secondary:hover {
  background: #ffffff;
  border-color: rgba(79, 70, 229, 0.35);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.1);
}

.btn-secondary:active {
  transform: translateY(1px) scale(0.98);
}

.btn-accent {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-accent:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.btn-accent:active {
  transform: translateY(1px) scale(0.98);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  /* Rose-Red Gradient */
  color: white !important;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.4);
}

.btn-danger:active {
  transform: translateY(1px) scale(0.98);
}

.btn-outline-white {
  background: transparent;
  color: white !important;
  border: 2px solid white;
}

.btn-outline-white:hover {
  background: white;
  color: var(--secondary) !important;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.btn-outline-white:active {
  transform: translateY(1px) scale(0.98);
}

/* Cards & Section Layouts */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  color: var(--secondary);
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 4px;
  background: var(--primary);
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.2);
}

.card-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h3 {
  font-size: 1.35rem;
  color: var(--secondary);
  margin-bottom: 0.8rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 1.5rem;
}

/* Grade selector cards on homepage */
.grade-card {
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
  border: 2px solid var(--card-border);
}

.grade-card.grade-9 {
  border-top: 5px solid #3b82f6;
}

.grade-card.grade-12 {
  border-top: 5px solid var(--primary);
}

.grade-card h2 {
  font-size: 2rem;
  color: var(--secondary);
  margin: 1rem 0;
}

.grade-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 999px;
  background: #bfdbfe;
  color: #1e40af;
}

.grade-card.grade-12 .grade-badge {
  background: #c7d2fe;
  color: #3730a3;
}

/* Auth Pages (Login & Register) */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}

.auth-card {
  width: min(480px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 3rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.auth-header h1 {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-muted);
}

/* Form elements */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: white;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

/* Password visibility toggle */
.password-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.password-wrapper .form-control {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  z-index: 5;
  outline: none;
  transition: color 0.2s, transform 0s !important;
}

.password-toggle:hover {
  color: var(--primary);
  transform: translateY(-50%) scale(1.1) !important;
  transition: color 0.2s, transform 0.2s !important;
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.9) !important;
}


.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
}

.form-check input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Flash alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf5;
  color: var(--accent);
  border: 1px solid #a7f3d0;
}

/* Student Dashboard */
.dashboard-wrapper {
  padding: 3rem 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

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

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-header h1 {
  font-size: 2.2rem;
  color: var(--secondary);
}

.history-card {
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.history-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.score-badge {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.4rem 1rem;
  border-radius: 999px;
}

.score-badge.high {
  background: #d1fae5;
  color: #065f46;
}

.score-badge.mid {
  background: #fef3c7;
  color: #92400e;
}

.score-badge.low {
  background: #fee2e2;
  color: #991b1b;
}

/* Exam Layout */
.exam-wrapper {
  padding: 3rem 0;
  max-width: 800px;
  margin: 0 auto;
}

.exam-sticky-bar {
  position: sticky;
  top: 75px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  z-index: 10;
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--secondary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.1rem;
}

.timer-pill.warning {
  background: var(--danger);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.05);
  }
}

.question-card {
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.question-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.question-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--card-border);
}

.option-list {
  display: grid;
  gap: 0.8rem;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  background: #f8fafc;
}

.option-label:hover {
  background: rgba(79, 70, 229, 0.04);
  border-color: #cbd5e1;
}

.option-label input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.option-label.selected {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  font-weight: 600;
}

/* Results Review page styling */
.result-header-card {
  background: white;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  margin-bottom: 2rem;
}

.circular-progress {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--percentage) * 1%), #e2e8f0 0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  position: relative;
}

.circular-progress::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: white;
}

.circular-progress-val {
  position: relative;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--secondary);
}

.review-answer-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
}

.review-answer-box.correct {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.review-answer-box.incorrect {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.explanation-box {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.95rem;
}

.explanation-title {
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.4rem;
}

/* Admin Sidebar Layout */
.admin-container {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0b0f19 0%, #1e293b 100%);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.25rem;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
}

.admin-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2.5rem;
  background: #f1f5f9;
  /* Light grey background to make cards pop */
}

@media (max-width: 768px) {
  .admin-sidebar {
    width: 70px;
    padding: 2rem 0.5rem;
  }

  .admin-sidebar .sidebar-logo span,
  .admin-sidebar .nav-item span {
    display: none;
  }

  .admin-content {
    margin-left: 70px;
    padding: 1.5rem;
  }
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  padding-left: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #f8fafc;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  height: 100%;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.25rem;
  color: #94a3b8;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.25s ease;
}

.nav-item svg {
  color: #64748b;
  transition: all 0.25s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.nav-item:hover svg {
  color: #94a3b8;
}

.nav-item.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.nav-item.active svg {
  color: var(--primary);
}

/* Premium Top Header */
.admin-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
  gap: 1.5rem;
}

.welcome-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--secondary);
}

.welcome-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 1.5px solid var(--card-border);
  border-radius: 9999px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  width: 240px;
  transition: all 0.3s ease;
}

.header-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  width: 280px;
}

.header-search svg {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.header-search input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
  font-family: var(--font-en);
  background: transparent;
}

.header-badge {
  width: 42px;
  height: 42px;
  background: white;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.25s ease;
}

.header-badge:hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  border: 1px solid var(--card-border);
  border-radius: 9999px;
  padding: 0.35rem 1rem 0.35rem 0.35rem;
  box-shadow: var(--shadow-sm);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
}

.profile-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Premium KPI Stat Cards */
.stat-card {
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.stat-icon-wrapper {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrapper.blue-theme {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

.stat-icon-wrapper.green-theme {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.stat-icon-wrapper.yellow-theme {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.stat-icon-wrapper.red-theme {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--secondary);
  margin-top: 0.15rem;
  font-family: var(--font-en);
  line-height: 1.2;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  margin-top: 1.5rem;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.admin-table th {
  background: #f8fafc;
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--secondary);
  border-bottom: 1px solid var(--card-border);
}

table.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.95rem;
}

table.admin-table tr:last-child td {
  border-bottom: none;
}

table.admin-table tr:hover {
  background: #f8fafc;
}

/* Math preview box */
.math-preview {
  margin-top: 0.5rem;
  padding: 1rem;
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-md);
  background: rgba(79, 70, 229, 0.02);
  min-height: 50px;
}

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

/* Responsive utilities */
@media (max-width: 600px) {
  .nav-links {
    display: none;
    /* simple toggle or hide for basic responsive */
  }
}

/* Glowing LED Announcement Ticker */
.led-ticker-wrapper {
  width: 100%;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 0.3rem 0;
  overflow: hidden;
}

.led-ticker-container {
  max-width: 1200px;
  width: calc(100% - 2.5rem);
  margin: 0 auto;
  background: #020617;
  /* Extra dark digital bezel */
  border: 1px solid #1e293b;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.9), 0 0 5px rgba(245, 158, 11, 0.15);
  /* Soft outer glow */
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  height: 26px;
  display: flex;
  align-items: center;
}

.led-ticker-text {
  font-family: var(--font-kh);
  font-size: 0.85rem;
  font-weight: 700;
  color: #f59e0b;
  /* Amber LED light */
  text-shadow: 0 0 4px #f59e0b, 0 0 8px #d97706;
  /* Neon glow */
  white-space: nowrap;
  position: absolute;
  will-change: transform;
  animation: led-marquee-scroll 28s linear infinite;
  padding-left: 100%;
}

@keyframes led-marquee-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(-100%, 0, 0);
  }
}