/* ==========================================================================
   CST303 COMPUTER NETWORKS - INTERACTIVE 3D LEARNING DASHBOARD
   Design System: Futuristic Liquid Glassmorphism & Iridescent Glass
   Author: Jane Rose | Assistant Professor, Department of Computer Science and Engineering
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Roboto+Mono:wght@300;400;500;600;700&display=swap');

:root {
  /* Default Dark Theme: Midnight Slate & Iridescent Cyan/Violet */
  --bg-primary: #080c16;
  --bg-secondary: #0d1424;
  --bg-gradient: radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.12) 0%, transparent 40%),
                 radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 45%),
                 linear-gradient(180deg, #070a13 0%, #0c1220 100%);
  
  --glass-bg: rgba(15, 23, 42, 0.68);
  --glass-bg-hover: rgba(30, 41, 59, 0.82);
  --glass-card-bg: rgba(17, 27, 49, 0.65);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-hover: rgba(56, 189, 248, 0.35);
  --glass-blur: blur(16px);
  --glass-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.45);
  --glass-glow: 0 0 24px rgba(56, 189, 248, 0.18);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-purple: #c084fc;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #f43f5e;
  
  --iridescent-gradient: linear-gradient(135deg, #38bdf8 0%, #a855f7 50%, #ec4899 100%);
  --iridescent-border: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(168, 85, 247, 0.4), rgba(236, 72, 153, 0.4));
  
  --sidebar-width: 290px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-heading: 'Exo 2', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  /* Light Theme: Frosted Pearl Mist & Soft Prismatic Glass */
  --bg-primary: #f0f4f9;
  --bg-secondary: #e6eef8;
  --bg-gradient: radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
                 radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 45%),
                 linear-gradient(180deg, #f4f8fc 0%, #e8f0fa 100%);
  
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-hover: rgba(255, 255, 255, 0.92);
  --glass-card-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(148, 163, 184, 0.25);
  --glass-border-hover: rgba(14, 165, 233, 0.45);
  --glass-blur: blur(18px);
  --glass-shadow: 0 10px 30px 0 rgba(15, 23, 42, 0.08);
  --glass-glow: 0 0 20px rgba(14, 165, 233, 0.15);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --accent-cyan: #0284c7;
  --accent-purple: #9333ea;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;

  --iridescent-gradient: linear-gradient(135deg, #0284c7 0%, #7e22ce 50%, #db2777 100%);
  --iridescent-border: linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(126, 34, 206, 0.3), rgba(219, 39, 119, 0.3));
}

/* Base Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  font-family: var(--font-heading);
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
}

code, pre, .font-mono {
  font-family: var(--font-mono);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Glass Utility Classes */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
}

.glass-card {
  background: var(--glass-card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow), var(--glass-glow);
}

.iridescent-text {
  background: var(--iridescent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.iridescent-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Layout Architecture */
#app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Styles */
#sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 1.4rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--iridescent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-scroller {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0.75rem 0.75rem 0.3rem;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.22) 0%, rgba(168, 85, 247, 0.16) 100%);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.12);
  font-weight: 600;
}

[data-theme="light"] .nav-item.active {
  color: #0f172a;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.15) 0%, rgba(126, 34, 206, 0.12) 100%);
  border-color: rgba(2, 132, 199, 0.3);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active svg {
  opacity: 1;
  color: var(--accent-cyan);
}

.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.75rem;
}

.prof-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.prof-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.85rem;
}

.prof-meta .name {
  font-weight: 600;
  color: var(--text-main);
}
.prof-meta .title {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Main Content Area */
#main-viewport {
  margin-left: var(--sidebar-width);
  flex: 1;
  /* Without this, the flex item grows to the min-content width of wide
     children (tab rows, canvases, tables) and the page scrolls sideways. */
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Top App Header */
#top-header {
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.menu-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.45rem;
  cursor: pointer;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumbs .sep {
  opacity: 0.4;
}

.breadcrumbs .active-crumb {
  color: var(--text-main);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  width: 250px;
  transition: var(--transition);
}

[data-theme="light"] .search-box {
  background: rgba(255, 255, 255, 0.8);
}

.search-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
  width: 290px;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
  width: 100%;
  font-family: inherit;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--glass-bg-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

/* Page Section Containers */
.dashboard-content {
  flex: 1;
  padding: 2.5rem;
  max-width: 1450px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}

.view-section {
  display: none;
  animation: fadeIn 0.35s ease forwards;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Section Elements */
.hero-banner {
  border-radius: var(--radius-lg);
  padding: 3rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(168, 85, 247, 0.12) 60%, rgba(236, 72, 153, 0.08) 100%),
              var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: var(--glass-shadow);
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0.8rem 0 1rem;
  letter-spacing: -0.03em;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.stat-item {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.stat-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.68rem 1.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-primary {
  background: var(--iridescent-gradient);
  color: #fff;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.5);
}

.btn-glass {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--text-main);
  backdrop-filter: var(--glass-blur);
}

.btn-glass:hover {
  background: var(--glass-bg-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-2px);
}

/* Section Header Structure */
.section-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  max-width: 650px;
}

/* 3D Canvas Visualizer Containers */
.canvas-container {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at center, rgba(14, 27, 54, 0.9) 0%, rgba(5, 9, 20, 0.95) 100%);
  border: 1px solid var(--glass-border);
}

[data-theme="light"] .canvas-container {
  background: radial-gradient(circle at center, rgba(230, 240, 255, 0.9) 0%, rgba(210, 225, 245, 0.95) 100%);
}

.canvas-controls {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 16, 30, 0.75);
  backdrop-filter: blur(14px);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

[data-theme="light"] .canvas-controls {
  background: rgba(255, 255, 255, 0.85);
}

.canvas-overlay-tag {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 10;
  background: rgba(10, 16, 30, 0.7);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Interactive Tabs */
.tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

/* Grids & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* Main panel + side panel (knowledge graph, NetPulse lab) */
.split-main-aside {
  display: grid;
  grid-template-columns: 3fr 1.2fr;
  gap: 1.5rem;
}

.split-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.split-main-aside > *,
.split-two > * {
  min-width: 0;
}

.split-two pre {
  overflow-x: auto;
}

/* Wide tables scroll inside their card instead of being cut off */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll .custom-table {
  min-width: 560px;
}

/* KaTeX output in worked solutions */
.solution-box .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
}

.solution-box p {
  margin: 0.5rem 0;
}

.solution-box .md-list {
  padding-left: 1.4rem;
  margin: 0.4rem 0;
}

.solution-box .md-list li {
  margin: 0.2rem 0;
}

.tex-fallback {
  white-space: pre-wrap;
  color: var(--accent-amber);
}

.md-table-wrap {
  overflow-x: auto;
  margin: 0.8rem 0;
}

.md-table {
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 100%;
}

.md-table th,
.md-table td {
  border: 1px solid var(--glass-border);
  padding: 0.45rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.md-table th {
  background: rgba(255, 255, 255, 0.05);
}

/* Exam Solver Specific */
.exam-q-card {
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--accent-cyan);
}

.exam-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-weight: 600;
  font-family: var(--font-mono);
}

.marks-badge {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

.solution-box {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
}

[data-theme="light"] .solution-box {
  background: rgba(240, 244, 250, 0.8);
}

.solution-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.solution-toggle-btn:hover {
  border-color: var(--accent-cyan);
}

/* Game Interface Elements */
.game-board {
  min-height: 480px;
  background: var(--glass-card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.score-counter {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

/* Knowledge Graph Container */
#knowledge-graph-canvas {
  width: 100%;
  height: 600px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle, rgba(14, 23, 44, 0.95) 0%, rgba(8, 12, 22, 1) 100%);
  border: 1px solid var(--glass-border);
}

[data-theme="light"] #knowledge-graph-canvas {
  background: radial-gradient(circle, rgba(245, 250, 255, 0.95) 0%, rgba(225, 235, 248, 1) 100%);
}

/* Tool & Salary Tables */
.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.custom-table th {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.9rem 1.2rem;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
}

.custom-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.88rem;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* App Footer */
#app-footer {
  margin-top: auto;
  padding: 2.2rem 2.5rem;
  border-top: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  text-align: center;
  position: relative;
  z-index: 10;
}

.footer-author-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.footer-sub-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Print Stylesheet */
@media print {
  #sidebar, #top-header, .header-actions, .canvas-controls, .btn, .no-print {
    display: none !important;
  }
  #main-viewport {
    margin-left: 0 !important;
    width: 100% !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .glass-card, .solution-box {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
  }
  .exam-q-card {
    page-break-inside: avoid;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #main-viewport {
    margin-left: 0;
  }
  .menu-toggle-btn {
    display: flex;
  }
  .grid-2, .grid-3, .grid-4,
  .split-main-aside, .split-two {
    grid-template-columns: 1fr;
  }
  .dashboard-content {
    padding: 1.5rem;
  }
  .hero-title {
    font-size: 2.1rem;
  }
  .search-box {
    width: 160px;
  }
  .search-box:focus-within {
    width: 200px;
  }
}

/* Phones: keep the sticky header inside the viewport */
@media (max-width: 600px) {
  #top-header {
    padding: 0 1rem;
    gap: 0.5rem;
  }
  .header-left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.6rem;
  }
  .breadcrumbs {
    min-width: 0;
  }
  .breadcrumbs > span:not(.active-crumb) {
    display: none;
  }
  .breadcrumbs .active-crumb {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-right {
    flex-shrink: 0;
    gap: 0.5rem;
  }
  .search-box,
  .search-box:focus-within {
    width: 130px;
    padding: 0.4rem 0.7rem;
  }
  .dashboard-content {
    padding: 1rem;
  }
  .hero-banner {
    padding: 1.5rem;
  }
  .hero-title {
    font-size: 1.7rem;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .glass-card {
    padding: 1.1rem;
  }
  .canvas-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .game-board {
    padding: 1rem;
  }
}
