/* ==========================================================================
   CONNECT DUMP ANALYSER - Functional Modern UI with Dark Mode
   Priority: Readability, Clarity, Data-First Design
   ========================================================================== */

/* ---------- CSS VARIABLES (Light/Dark Theme) ---------- */
:root {
  /* Light mode - Clean, high-contrast slate palette */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Design tokens (keeps UI consistent and intentional) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --surface-1: var(--bg-secondary);
  --surface-2: var(--bg-tertiary);

  --border-strong: rgba(15, 23, 42, 0.12);

  --elev-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --elev-2: 0 10px 30px rgba(15, 23, 42, 0.12);

  /* Functional accent colors */
  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-live: #16a34a;
  --accent-live-bg: #dcfce7;
  --accent-archive: #ea580c;
  --accent-archive-bg: #fff7ed;
  --accent-warning: #d97706;
  --accent-danger: #dc2626;
  --accent-lab: #9333ea;

  /* Text on accent surfaces (must stay high-contrast) */
  --on-accent: #ffffff;

  /* Focus ring (subtle, functional) */
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.16);

  /* Data colors - high visibility */
  --code-color: #1d4ed8;
  --link-color: #2563eb;
  --room-color: #c2410c;
  --room-color-bg: rgba(194, 65, 12, 0.10);

  /* Seat availability - clear distinction */
  --seat-available-bg: #dcfce7;
  --seat-available-text: #166534;
  --seat-available-border: #86efac;
  --seat-full-bg: #fee2e2;
  --seat-full-text: #991b1b;
  --seat-full-border: #fca5a5;

  /* Table - clean data presentation */
  --table-header-bg: #f1f5f9;
  --table-row-alt: #f8fafc;
  --table-border: #e2e8f0;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
}

/* Dark mode - Easy on eyes, high contrast for visibility */
[data-theme="dark"] {
  --bg-primary: #0c1222;
  --bg-secondary: #151f32;
  --bg-tertiary: #1e2d47;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #8b9cb8;
  --border-color: #3d4f6a;
  --border-light: #243147;

  --surface-1: var(--bg-secondary);
  --surface-2: var(--bg-tertiary);

  --border-strong: rgba(241, 245, 249, 0.14);

  --elev-1: 0 1px 3px rgba(0,0,0,0.35);
  --elev-2: 0 14px 34px rgba(0,0,0,0.45);

  /* Accent colors - bright for visibility */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #60a5fa;
  --accent-live: #22c55e;
  --accent-live-bg: #0d331a;
  --accent-archive: #f97316;
  --accent-archive-bg: #2a1508;
  --accent-lab: #c084fc;

  --on-accent: #ffffff;
  --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.30);

  /* Data colors - distinct and vibrant */
  --code-color: #38bdf8;       /* Sky blue - pops on dark */
  --link-color: #60a5fa;       /* Blue - clear links */
  --room-color: #fbbf24;       /* Amber - warm contrast */
  --room-color-bg: rgba(251, 191, 36, 0.12);

  /* Seats - high visibility distinction */
  --seat-available-bg: #0d3320;
  --seat-available-text: #4ade80;
  --seat-available-border: #22c55e;
  --seat-full-bg: #3a0f0f;
  --seat-full-text: #f87171;
  --seat-full-border: #ef4444;

  /* Table - subtle row distinction */
  --table-header-bg: #1a2840;
  --table-row-alt: #121c2e;
  --table-border: #3d4f6a;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  padding: 10px;
  transition: background 0.2s, color 0.2s;
}

/* ---------- CONTAINER ---------- */
.container {
  width: 100%;
  max-width: 100%;
  background: var(--bg-secondary);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 16px 20px;
  overflow: hidden;
  transition: background 0.2s;
}

/* ---------- SITE HEADER ---------- */
.site-header {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  width: 100%;
}

.header-title {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.version-number {
  font-size: 0.65rem;
  color: #fff;
  font-weight: 700;
  background: var(--accent-primary);
  padding: 3px 8px;
  border-radius: 4px;
  vertical-align: middle;
}

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

.author-footer a {
  color: var(--link-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.author-footer a:hover {
  text-decoration: underline;
}

/* Status indicator - next to search */
.data-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 16px;
  width: fit-content;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Theme toggle slider */
.theme-switch {
  position: relative;
  width: 56px;
  height: 28px;
  flex-shrink: 0;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e2e8f0;
  border-radius: 28px;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
}

.theme-switch .slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.theme-switch input:checked + .slider {
  background: #334155;
}

.theme-switch input:checked + .slider::before {
  transform: translateX(28px);
}

.theme-switch .sun,
.theme-switch .moon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  transition: opacity 0.3s ease;
  color: #64748b;
}

.theme-switch input:checked + .slider .sun,
.theme-switch input:checked + .slider .moon {
  color: #94a3b8;
}

.theme-switch .sun {
  left: 5px;
  opacity: 1;
}

.theme-switch .moon {
  right: 5px;
  opacity: 0.5;
}

.theme-switch input:checked + .slider .sun {
  opacity: 0.4;
}

.theme-switch input:checked + .slider .moon {
  opacity: 1;
}

/* Help button */
.help-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.help-button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-tertiary);
}

/* Legacy status container hidden */
.status-container {
  display: none;
}

/* ---------- SEMESTER BUTTONS ---------- */
.button-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.semester-button {
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.semester-button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.semester-button.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

/* ---------- SEARCH & STATUS WRAPPER ---------- */
.search-status-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 16px;
  max-width: 700px;
  flex-wrap: wrap;
}

/* ---------- SEARCH ---------- */
.search-container {
  flex: 1;
  min-width: 300px;
  max-width: 460px;
  position: relative;
}

#searchInput {
  width: 100%;
  padding: 10px 40px 10px 14px;
  font-size: 0.95rem;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.15s;
}

#searchInput:focus {
  border-color: var(--accent-primary);
}

#searchInput::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  right: 38px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 20px;
}

.clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 4px;
}

.clear-search.visible {
  display: block;
}

.clear-search:hover {
  color: var(--accent-danger);
}

/* ---------- TABLE WRAPPER ---------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 2px solid var(--table-border);
  border-radius: 8px;
  margin-bottom: 14px;
  transition: border-color 0.2s, transform 0.2s;
  transform-origin: top left;
}

/* Zoom levels for mobile - 5 incremental sizes */
/* Level 1: Smallest */
.table-responsive.zoom-1 table { font-size: 0.6rem; }
.table-responsive.zoom-1 th { font-size: 0.5rem; padding: 6px 3px; }
.table-responsive.zoom-1 td { font-size: 0.6rem; padding: 5px 3px; }

/* Level 2: Small */
.table-responsive.zoom-2 table { font-size: 0.7rem; }
.table-responsive.zoom-2 th { font-size: 0.6rem; padding: 7px 3px; }
.table-responsive.zoom-2 td { font-size: 0.7rem; padding: 6px 3px; }

/* Level 3: Normal (default) */
.table-responsive.zoom-3 table { font-size: 0.8rem; }
.table-responsive.zoom-3 th { font-size: 0.68rem; padding: 8px 4px; }
.table-responsive.zoom-3 td { font-size: 0.8rem; padding: 7px 4px; }

/* Level 4: Large */
.table-responsive.zoom-4 table { font-size: 0.9rem; }
.table-responsive.zoom-4 th { font-size: 0.78rem; padding: 9px 5px; }
.table-responsive.zoom-4 td { font-size: 0.9rem; padding: 8px 5px; }

/* Level 5: Largest */
.table-responsive.zoom-5 table { font-size: 1rem; }
.table-responsive.zoom-5 th { font-size: 0.88rem; padding: 10px 6px; }
.table-responsive.zoom-5 td { font-size: 1rem; padding: 9px 6px; }

/* ---------- TABLE - Data-First Design ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.95rem;
}

thead {
  background: var(--table-header-bg);
  border-bottom: 2px solid var(--table-border);
}

th {
  padding: 12px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  white-space: nowrap;
  vertical-align: middle;
}

td {
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Zebra striping */
tbody tr:nth-child(even) {
  background: var(--table-row-alt);
}

/* ---------- COLUMN WIDTHS (11 columns) ---------- */
/* 1: Code, 2: SEC, 3: Faculty, 4: Faculty Info, 5: Schedule,
   6: Lab, 7: Avail, 8: Booked, 9: Cap, 10: Exam, 11: Room */

th:nth-child(1), td:nth-child(1) { width: 9%; }   /* Code */
th:nth-child(2), td:nth-child(2) { width: 5%; }   /* SEC */
th:nth-child(3), td:nth-child(3) { width: 7%; }   /* Faculty */
th:nth-child(4), td:nth-child(4) { width: 14%; text-align: left; } /* Faculty Info */
th:nth-child(5), td:nth-child(5) { width: 11%; }  /* Schedule */
th:nth-child(6), td:nth-child(6) { width: 11%; }  /* Lab */
th:nth-child(7), td:nth-child(7) { width: 7%; }   /* Available */
th:nth-child(8), td:nth-child(8) { width: 7%; }   /* Booked */
th:nth-child(9), td:nth-child(9) { width: 7%; }   /* Capacity */
th:nth-child(10), td:nth-child(10) { width: 14%; } /* Exam */
th:nth-child(11), td:nth-child(11) { width: 8%; }  /* Room */

/* Faculty Info header centered */
th:nth-child(4) { text-align: center; }

/* Center-align non-TBA faculty info while keeping match blocks readable */
.faculty-info-normal {
  display: block;
  width: 100%;
  text-align: center;
  font-weight: 600;
}

/* Code column - emphasized */
td:nth-child(1) {
  font-weight: 700;
  color: var(--code-color);
  font-size: 0.9rem;
}

/* Faculty initial - bold */
td:nth-child(3) {
  font-weight: 700;
}

/* Room column - distinct color */
td:nth-child(11) {
  font-weight: 700;
  color: var(--room-color);
}

/* ---------- SORTABLE HEADERS ---------- */
th.sortable {
  cursor: pointer;
  position: relative;
  padding-right: 16px;
  user-select: none;
}

.sort-icon {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.55;
}

.sort-icon::before {
  content: "⇅";
}

th.sortable.sorted .sort-icon {
  opacity: 1;
  color: var(--accent-primary);
}

th.sortable.sorted {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

th.sortable.sorted[data-direction="asc"] .sort-icon::before {
  content: "↑";
}

th.sortable.sorted[data-direction="desc"] .sort-icon::before {
  content: "↓";
}

/* ---------- SEAT BADGES - High Visibility ---------- */
.seats-available {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--seat-available-bg);
  color: var(--seat-available-text);
  border: 1px solid var(--seat-available-border);
}

.seats-full {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--seat-full-bg);
  color: var(--seat-full-text);
  border: 1px solid var(--seat-full-border);
}

/* ---------- EXAM DATE ---------- */
.exam-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9rem;
}

.exam-date-day {
  font-weight: 700;
}

.exam-date-time {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- ROOM INFO ---------- */
.room-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.class-room {
  font-weight: 600;
}

.lab-room {
  color: var(--accent-lab);
  font-size: 0.85em;
  font-weight: 500;
}

[data-theme="dark"] .tba-info {
  color: #fbbf24;
}

/* ---------- TBA MATCH INFO ---------- */
.tba-info {
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.9rem;
}

.semester-group {
  margin-bottom: 6px;
}

.section-history-match,
.time-match,
.room-match {
  background: var(--bg-tertiary);
  padding: 5px 8px;
  border-radius: 4px;
  margin-bottom: 3px;
  font-size: 0.85rem;
  border-left: 3px solid;
}

.section-history-match { border-color: var(--accent-primary); }
.time-match { border-color: var(--accent-live); }
.room-match { border-color: var(--accent-warning); }

.semester-tag {
  display: inline-block;
  font-size: 0.75rem;
  background: var(--border-color);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 600;
}

.room-number {
  font-weight: 700;
  color: var(--room-color);
  background: var(--room-color-bg);
  padding: 2px 5px;
  border-radius: 3px;
}

/* ---------- PAGINATION ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.pagination button {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination span {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  min-width: 110px;
  text-align: center;
}

/* Mobile pagination */
.mobile-pagination {
  display: none;
}

.page-numbers {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.page-number {
  min-width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.page-number:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.page-number.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

/* ---------- BACK TO TOP ---------- */
.back-to-top {
  position: fixed;
  bottom: 65px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  box-shadow: var(--shadow-md);
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent-primary-hover);
}

/* ---------- ZOOM CONTROLS ---------- */
/* Desktop: hidden. Only visible on mobile via media query below */
.zoom-controls {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: none; /* Hidden on desktop */
  gap: 6px;
  z-index: 100;
}

.zoom-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.zoom-button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.info-modal {
  background: var(--bg-secondary);
  border-radius: 12px;
  max-width: 480px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-right: 30px;
}

.modal-section {
  margin-bottom: 14px;
}

.modal-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 6px;
}

.modal-section p,
.modal-section ul {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-section ul {
  padding-left: 18px;
}

.modal-section li {
  margin-bottom: 5px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--accent-danger);
  color: #fff;
}

.acknowledgements {
  background: var(--bg-tertiary);
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 14px;
  border: 1px solid var(--border-color);
}

.acknowledgements summary {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.acknowledgements-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.acknowledgements-content a {
  color: var(--link-color);
  text-decoration: none;
}

.acknowledgements-content a:hover {
  text-decoration: underline;
}

/* ---------- LOADER SPINNER ---------- */
.loader {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

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

/* ---------- RESPONSIVE: TABLET ---------- */
@media (max-width: 1024px) {
  body {
    padding: 8px;
  }

  .container {
    padding: 14px 16px;
  }

  table {
    font-size: 0.9rem;
  }

  th {
    font-size: 0.75rem;
    padding: 10px 6px;
  }

  td {
    padding: 8px 6px;
    font-size: 0.9rem;
  }
}

/* ---------- RESPONSIVE: MOBILE ---------- */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  body {
    padding: 6px;
  }

  .container {
    padding: 12px;
    border-radius: 8px;
  }

  .site-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  h1 {
    font-size: 1.25rem;
  }

  .author-footer {
    font-size: 0.8rem;
  }

  .semester-button {
    padding: 7px 12px;
    font-size: 0.85rem;
  }

  .mobile-pagination {
    display: block;
    margin-bottom: 10px;
  }

  .zoom-controls {
    display: flex; /* Show on mobile */
  }

  .pagination {
    display: none;
  }

  table {
    font-size: 0.8rem;
    table-layout: auto;
    min-width: 800px;
  }

  th {
    font-size: 0.68rem;
    padding: 8px 4px;
    white-space: nowrap;
  }

  td {
    padding: 7px 4px;
    font-size: 0.8rem;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }

  .seats-available,
  .seats-full {
    padding: 3px 7px;
    font-size: 0.78rem;
  }
}

/* ---------- RESPONSIVE: SMALL MOBILE ---------- */
@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .header-top {
    gap: 10px;
  }

  h1 {
    font-size: 1.1rem;
  }

  .version-number {
    font-size: 0.55rem;
    padding: 2px 5px;
  }

  .author-footer {
    font-size: 0.75rem;
  }

  .help-button {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .theme-switch {
    width: 48px;
    height: 24px;
  }

  .theme-switch .slider::before {
    height: 16px;
    width: 16px;
  }

  .theme-switch input:checked + .slider::before {
    transform: translateX(24px);
  }

  .theme-switch .sun,
  .theme-switch .moon {
    font-size: 10px;
  }

  .site-header .data-status {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .semester-button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  table {
    font-size: 0.72rem;
  }

  th {
    font-size: 0.62rem;
    padding: 6px 3px;
    letter-spacing: 0;
  }

  td {
    padding: 5px 3px;
    font-size: 0.72rem;
  }

  .seats-available,
  .seats-full {
    padding: 2px 5px;
    font-size: 0.7rem;
  }
}

/* ---------- GITHUB ICON ---------- */
.github-icon {
  font-size: 1em;
  vertical-align: middle;
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ---------- SELECTION ---------- */
::selection {
  background: var(--accent-primary);
  color: #fff;
}

/* ---------- FOCUS STYLES ---------- */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ---------- PRINT ---------- */
@media print {
  body {
    background: #fff;
    padding: 0;
  }

  .container {
    box-shadow: none;
    border-radius: 0;
  }

  .help-button,
  .theme-toggle,
  .zoom-controls,
  .back-to-top,
  .pagination,
  .mobile-pagination,
  .search-container,
  .status-container {
    display: none !important;
  }

  table {
    font-size: 10pt;
  }
}
