/* ==========================================================================
   CHRIS CASTALDI — RETRO ASCII TERMINAL & CRT DESIGN SYSTEM
   Authentic Monospace Architecture, Dynamic CRT Shaders & Phosphor Themes
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme Custom Properties & Color Palettes
   -------------------------------------------------------------------------- */
:root {
  /* Matrix Green (Default) */
  --term-bg: #050a07;
  --term-surface: #0a140e;
  --term-surface-hover: #102418;
  --term-fg: #00ff66;
  --term-fg-bright: #55ff99;
  --term-fg-dim: #008833;
  --term-fg-dark: #00441a;
  --term-accent: #00ffaa;
  --term-accent-rgb: 0, 255, 170;
  --term-warn: #ffcc00;
  --term-alert: #ff3344;
  --term-border: #00aa44;
  --term-glow: rgba(0, 255, 102, 0.45);
  --term-glow-strong: rgba(0, 255, 102, 0.85);
  --term-cursor: #00ff66;
  --term-scanline: rgba(0, 0, 0, 0.35);

  --font-mono: 'Fira Code', 'VT323', 'Share Tech Mono', Consolas, Monaco, monospace;
}

/* Amber CRT Theme */
body.theme-amber {
  --term-bg: #0d0700;
  --term-surface: #1a0f00;
  --term-surface-hover: #2e1a00;
  --term-fg: #ffb000;
  --term-fg-bright: #ffd066;
  --term-fg-dim: #996a00;
  --term-fg-dark: #4d3500;
  --term-accent: #ff9900;
  --term-accent-rgb: 255, 153, 0;
  --term-warn: #ffff33;
  --term-alert: #ff4433;
  --term-border: #cc8d00;
  --term-glow: rgba(255, 176, 0, 0.45);
  --term-glow-strong: rgba(255, 176, 0, 0.85);
  --term-cursor: #ffb000;
  --term-scanline: rgba(0, 0, 0, 0.38);
}

/* Cyber Neon Cyan Theme */
body.theme-cyan {
  --term-bg: #040912;
  --term-surface: #091324;
  --term-surface-hover: #0f2140;
  --term-fg: #00f0ff;
  --term-fg-bright: #80f7ff;
  --term-fg-dim: #008899;
  --term-fg-dark: #00444d;
  --term-accent: #7000ff;
  --term-accent-rgb: 0, 240, 255;
  --term-warn: #ffd700;
  --term-alert: #ff0055;
  --term-border: #00b4cc;
  --term-glow: rgba(0, 240, 255, 0.45);
  --term-glow-strong: rgba(0, 240, 255, 0.85);
  --term-cursor: #00f0ff;
  --term-scanline: rgba(0, 0, 0, 0.35);
}

/* Synthwave / Monokai Purple Theme */
body.theme-purple {
  --term-bg: #0d0714;
  --term-surface: #170d24;
  --term-surface-hover: #26153b;
  --term-fg: #bd93f9;
  --term-fg-bright: #ff79c6;
  --term-fg-dim: #6e4f9e;
  --term-fg-dark: #372352;
  --term-accent: #50fa7b;
  --term-accent-rgb: 189, 147, 249;
  --term-warn: #f1fa8c;
  --term-alert: #ff5555;
  --term-border: #8c64c7;
  --term-glow: rgba(189, 147, 249, 0.45);
  --term-glow-strong: rgba(255, 121, 198, 0.85);
  --term-cursor: #ff79c6;
  --term-scanline: rgba(0, 0, 0, 0.35);
}

/* Ghost Monochrome White Theme */
body.theme-ghost {
  --term-bg: #0a0a0a;
  --term-surface: #141414;
  --term-surface-hover: #242424;
  --term-fg: #e0e0e0;
  --term-fg-bright: #ffffff;
  --term-fg-dim: #888888;
  --term-fg-dark: #444444;
  --term-accent: #a0a0a0;
  --term-accent-rgb: 224, 224, 224;
  --term-warn: #cccccc;
  --term-alert: #ff6666;
  --term-border: #777777;
  --term-glow: rgba(255, 255, 255, 0.35);
  --term-glow-strong: rgba(255, 255, 255, 0.75);
  --term-cursor: #ffffff;
  --term-scanline: rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   2. Reset & Baseline
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  background-color: var(--term-bg);
  color: var(--term-fg);
  font-family: var(--font-mono);
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--term-bg);
  color: var(--term-fg);
  font-family: var(--font-mono);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  text-shadow: none; /* Crisp readable monospace text without blurry glow */
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background: var(--term-fg);
  color: var(--term-bg);
  text-shadow: none;
}

/* Custom ASCII Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--term-surface);
  border-left: 1px solid var(--term-border);
}
::-webkit-scrollbar-thumb {
  background: var(--term-fg-dim);
  border: 1px solid var(--term-fg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--term-fg);
}

/* --------------------------------------------------------------------------
   3. Dynamic Background Canvas & CRT Shaders
   -------------------------------------------------------------------------- */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.68;
}

/* Crisp, Non-Intrusive CRT Scanline Overlay */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9990;
  pointer-events: none;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.12) 50%
  );
  background-size: 100% 4px;
  opacity: 0.22;
}

/* Terminal chassis lighting */
body.crt-curvature {
  overflow-x: hidden;
}
body.crt-curvature #terminal-chassis {
  box-shadow: 0 0 20px var(--term-glow);
  border-radius: 4px;
}

/* When CRT is disabled by user */
body.crt-off .crt-overlay {
  display: none !important;
}

/* --------------------------------------------------------------------------
   4. Terminal Chassis & Window Frame Layout
   -------------------------------------------------------------------------- */
.terminal-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.terminal-chassis {
  background: var(--term-surface);
  border: 2px solid var(--term-border);
  box-shadow: 0 0 25px var(--term-glow), inset 0 0 15px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
}

/* Window Title Bar */
.term-header {
  background: var(--term-fg-dark);
  border-bottom: 2px solid var(--term-border);
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  font-size: 0.88rem;
}

.term-window-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.term-btn-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--term-fg);
  box-shadow: 0 0 5px var(--term-fg);
}
.term-btn-dot.red { background: #ff4444; box-shadow: 0 0 5px #ff4444; }
.term-btn-dot.yellow { background: #ffbb00; box-shadow: 0 0 5px #ffbb00; }
.term-btn-dot.green { background: #00ff66; box-shadow: 0 0 5px #00ff66; }

.term-title {
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--term-fg-bright);
  text-align: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.5rem;
}

.term-stats-pill {
  font-size: 0.8rem;
  color: var(--term-fg-dim);
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.term-live-dot {
  width: 8px;
  height: 8px;
  background: var(--term-fg);
  border-radius: 50%;
  display: inline-block;
  animation: term-blink 1.2s infinite;
}

@keyframes term-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* --------------------------------------------------------------------------
   5. TUI Top Navigation Bar
   -------------------------------------------------------------------------- */
.tui-nav {
  background: var(--term-bg);
  border-bottom: 1px solid var(--term-border);
  padding: 0.45rem 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.tui-nav-btn {
  background: transparent;
  color: var(--term-fg);
  border: 1px solid var(--term-fg-dim);
  padding: 0.3rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  user-select: none;
}

.tui-nav-btn:hover {
  background: var(--term-surface-hover);
  border-color: var(--term-fg);
  color: var(--term-fg-bright);
  box-shadow: 0 0 8px var(--term-glow);
}

.tui-nav-btn.active {
  background: var(--term-fg);
  color: var(--term-bg);
  border-color: var(--term-fg-bright);
  font-weight: 700;
  text-shadow: none;
}

.tui-nav-btn .num-key {
  color: var(--term-warn);
  font-weight: 700;
}
.tui-nav-btn.active .num-key {
  color: #000;
}

/* Quick Tools in Nav */
.tui-nav-tools {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* --------------------------------------------------------------------------
   6. Main Terminal Content Viewport
   -------------------------------------------------------------------------- */
.term-viewport {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* ASCII Banner & Telemetry */
.ascii-banner-wrap {
  text-align: center;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.ascii-telemetry-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.85rem;
  background: var(--term-bg);
  border: 1px dashed var(--term-border);
  font-size: 0.78rem;
  color: var(--term-fg-dim);
  font-family: var(--font-mono);
}

.ascii-live-spectrum {
  color: var(--term-warn);
  font-weight: 700;
  letter-spacing: 2px;
  display: inline-block;
  min-width: 120px;
}

.ascii-live-spinner {
  display: inline-block;
  color: var(--term-accent);
  font-weight: 700;
}

.ascii-banner {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.15;
  color: var(--term-fg-bright);
  text-shadow: 0 0 10px var(--term-glow-strong);
  display: inline-block;
  white-space: pre;
  user-select: none;
  cursor: default;
  transition: color 0.2s ease;
}

@media (max-width: 768px) {
  .ascii-banner {
    font-size: 0.45rem;
  }
}
@media (max-width: 480px) {
  .ascii-banner {
    font-size: 0.32rem;
  }
}

.banner-subtext {
  font-size: 0.95rem;
  color: var(--term-fg);
  margin-top: 0.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   7. ASCII Boxes & Unicode Frames
   -------------------------------------------------------------------------- */
.ascii-box {
  background: var(--term-surface);
  border: 1px solid var(--term-border);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.ascii-box-header {
  color: var(--term-fg-bright);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px dashed var(--term-fg-dim);
  padding-bottom: 0.45rem;
}

.ascii-box-header .box-tag {
  background: var(--term-fg);
  color: var(--term-bg);
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: none;
}

/* --------------------------------------------------------------------------
   8. Neofetch / System Info Grid
   -------------------------------------------------------------------------- */
.neofetch-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
}

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

.neofetch-ascii-art {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.15;
  color: var(--term-fg-bright);
  white-space: pre;
  user-select: none;
  background: var(--term-bg);
  padding: 0.75rem 1rem;
  border: 1px dashed var(--term-border);
  display: inline-block;
}

.neofetch-portrait-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ascii-canvas-container {
  position: relative;
  background: #000;
  border: 1px solid var(--term-border);
  line-height: 1;
}

.ascii-canvas-container pre {
  font-family: var(--font-mono);
  font-size: 6px;
  line-height: 5.5px;
  letter-spacing: 0px;
  color: var(--term-fg);
  overflow: hidden;
  margin: 0;
  user-select: none;
}

.photo-preview-img {
  max-width: 220px;
  height: auto;
  border: 1px solid var(--term-border);
  filter: contrast(1.2) brightness(0.9) grayscale(0.2);
}

.neofetch-info-table {
  width: 100%;
  border-collapse: collapse;
}

.neofetch-info-table tr {
  border-bottom: 1px dotted var(--term-fg-dark);
}

.neofetch-info-table td {
  padding: 0.35rem 0.5rem;
  font-size: 0.92rem;
  vertical-align: top;
}

.neofetch-label {
  color: var(--term-fg-bright);
  font-weight: 700;
  width: 140px;
  white-space: nowrap;
}

.neofetch-val {
  color: var(--term-fg);
}

.color-swatches {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.5rem;
}
.color-swatch {
  width: 20px;
  height: 12px;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   9. Focus Highlights & Capabilities
   -------------------------------------------------------------------------- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.focus-cell {
  background: var(--term-bg);
  border: 1px solid var(--term-fg-dim);
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.focus-cell:hover {
  border-color: var(--term-fg);
  background: var(--term-surface-hover);
  box-shadow: 0 0 10px var(--term-glow);
}

.focus-cell-glyph {
  color: var(--term-warn);
  font-size: 1.1rem;
}

.focus-cell-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--term-fg-bright);
}

/* --------------------------------------------------------------------------
   10. Portfolio Projects ASCII Cards
   -------------------------------------------------------------------------- */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-tab-btn {
  background: transparent;
  color: var(--term-fg-dim);
  border: 1px solid var(--term-fg-dim);
  padding: 0.25rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab-btn:hover, .filter-tab-btn.active {
  background: var(--term-fg);
  color: var(--term-bg);
  border-color: var(--term-fg);
  font-weight: 700;
  text-shadow: none;
}

.projects-ascii-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .projects-ascii-grid {
    grid-template-columns: 1fr;
  }
}

.project-ascii-card {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
}

.project-ascii-card:hover {
  border-color: var(--term-fg-bright);
  box-shadow: 0 0 12px var(--term-glow);
  transform: translateY(-2px);
}

.proj-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  border-bottom: 1px dashed var(--term-fg-dark);
  padding-bottom: 0.4rem;
}

.proj-cat-badge {
  font-size: 0.72rem;
  background: var(--term-fg-dim);
  color: #000;
  padding: 0.1rem 0.45rem;
  font-weight: 700;
  text-transform: uppercase;
}

.proj-id-badge {
  font-size: 0.75rem;
  color: var(--term-warn);
}

.proj-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--term-fg-bright);
  margin-bottom: 0.5rem;
}

.proj-card-img-wrap {
  margin: 0.5rem 0 0.85rem 0;
  position: relative;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--term-fg-dark);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proj-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  filter: contrast(1.15) brightness(0.9);
  transition: filter 0.3s ease;
}

.proj-card-img-wrap:hover .proj-card-img {
  filter: contrast(1.3) brightness(1.1);
}

.proj-card-desc {
  font-size: 0.88rem;
  color: var(--term-fg);
  line-height: 1.5;
  margin-bottom: 0.85rem;
  flex: 1;
}

.proj-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.proj-tag {
  font-size: 0.72rem;
  color: var(--term-fg-dim);
  border: 1px solid var(--term-fg-dark);
  padding: 0.1rem 0.35rem;
}

.proj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.term-btn {
  background: transparent;
  color: var(--term-fg);
  border: 1px solid var(--term-fg);
  padding: 0.3rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.term-btn:hover {
  background: var(--term-fg);
  color: var(--term-bg);
  text-shadow: none;
  box-shadow: 0 0 8px var(--term-glow);
}

.term-btn.btn-accent {
  border-color: var(--term-warn);
  color: var(--term-warn);
}
.term-btn.btn-accent:hover {
  background: var(--term-warn);
  color: #000;
}

/* --------------------------------------------------------------------------
   11. Technical Skills Matrix (ASCII Bars)
   -------------------------------------------------------------------------- */
.skills-category-group {
  margin-bottom: 1.25rem;
}

.skills-category-title {
  color: var(--term-warn);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.skills-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.65rem;
}

.skill-bar-row {
  background: var(--term-bg);
  border: 1px solid var(--term-fg-dark);
  padding: 0.45rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skill-name {
  font-size: 0.86rem;
  color: var(--term-fg);
}

.skill-ascii-bar {
  color: var(--term-fg-bright);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   12. GitHub Repos & Video Demos
   -------------------------------------------------------------------------- */
.repos-ascii-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.repo-ascii-card {
  background: var(--term-bg);
  border: 1px solid var(--term-fg-dim);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.repo-ascii-card:hover {
  border-color: var(--term-fg);
  box-shadow: 0 0 10px var(--term-glow);
}

.repo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.repo-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--term-fg-bright);
  text-decoration: none;
}
.repo-title:hover {
  text-decoration: underline;
}

.repo-stars {
  color: var(--term-warn);
  font-size: 0.8rem;
  font-weight: 700;
}

.repo-desc {
  font-size: 0.85rem;
  color: var(--term-fg);
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

/* Video Grid */
.videos-ascii-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.video-ascii-card {
  background: var(--term-bg);
  border: 1px solid var(--term-fg-dark);
  padding: 0.65rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.video-ascii-card:hover {
  border-color: var(--term-fg);
  box-shadow: 0 0 10px var(--term-glow);
}

.video-thumb-wrap {
  position: relative;
  overflow: hidden;
  height: 140px;
  border: 1px solid var(--term-fg-dark);
  margin-bottom: 0.5rem;
}

.video-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
}

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--term-fg);
  color: var(--term-fg);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.video-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--term-fg-bright);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   13. Career Timeline & Experience
   -------------------------------------------------------------------------- */
.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 2px solid var(--term-fg-dim);
}

.timeline-item::before {
  content: '◆';
  position: absolute;
  left: -7px;
  top: 0;
  color: var(--term-fg-bright);
  background: var(--term-surface);
}

.timeline-role-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--term-fg-bright);
}

.timeline-company {
  color: var(--term-warn);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.timeline-bullets {
  list-style: none;
  margin-top: 0.4rem;
}

.timeline-bullets li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--term-fg);
  margin-bottom: 0.35rem;
  line-height: 1.45;
}

.timeline-bullets li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--term-fg-dim);
}

/* --------------------------------------------------------------------------
   14. Interactive CLI Console
   -------------------------------------------------------------------------- */
.cli-console-box {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  padding: 1rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
}

.cli-history {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.cli-log-entry {
  margin-bottom: 0.6rem;
  line-height: 1.5;
  font-size: 0.9rem;
}

.cli-prompt-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--term-surface);
  border: 1px solid var(--term-fg-dim);
  padding: 0.4rem 0.65rem;
}

.cli-prompt-label {
  color: var(--term-warn);
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.9rem;
  user-select: none;
}

.cli-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--term-fg-bright);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  text-shadow: 0 0 6px var(--term-glow);
}

.cli-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
  align-items: center;
}

.cli-chip-label {
  font-size: 0.75rem;
  color: var(--term-fg-dim);
  user-select: none;
}

.cli-chip {
  background: transparent;
  border: 1px dashed var(--term-fg-dark);
  color: var(--term-fg-dim);
  padding: 0.15rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cli-chip:hover {
  border-color: var(--term-fg);
  color: var(--term-fg-bright);
  background: var(--term-surface-hover);
}

/* --------------------------------------------------------------------------
   15. TUI Bottom Status Line & Footer
   -------------------------------------------------------------------------- */
.tui-statusbar {
  background: var(--term-fg-dark);
  border-top: 2px solid var(--term-border);
  padding: 0.4rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  user-select: none;
  gap: 0.5rem;
}

.statusbar-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.statusbar-key {
  color: var(--term-warn);
  font-weight: 700;
}

.statusbar-sysinfo {
  display: flex;
  gap: 0.85rem;
  color: var(--term-fg-dim);
}

/* --------------------------------------------------------------------------
   16. Video Modal & Lightbox
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--term-surface);
  border: 2px solid var(--term-fg);
  box-shadow: 0 0 35px var(--term-glow);
  width: 90%;
  max-width: 850px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: var(--term-fg-dark);
  border-bottom: 1px solid var(--term-fg);
  padding: 0.5rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-weight: 700;
  color: var(--term-fg-bright);
  font-size: 0.95rem;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--term-fg);
  color: var(--term-fg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-weight: 700;
}
.modal-close:hover {
  background: var(--term-fg);
  color: var(--term-bg);
}

.modal-video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
}

.modal-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   17. BIOS Boot Overlay
   -------------------------------------------------------------------------- */
#boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #020503;
  color: var(--term-fg);
  font-family: var(--font-mono);
  padding: 2.5rem 2rem 2rem 2rem;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

#boot-screen.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.boot-content-wrapper {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.boot-header-banner {
  color: var(--term-fg-bright);
  font-size: 0.85rem;
  line-height: 1.3;
  margin-bottom: 1.25rem;
  white-space: pre;
  user-select: none;
}

@media (max-width: 600px) {
  .boot-header-banner {
    font-size: 0.58rem;
  }
}

.boot-text {
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 1rem;
}

.boot-tag-ok {
  color: var(--term-fg-bright);
  font-weight: 700;
}
.boot-tag-ready {
  color: var(--term-warn);
  font-weight: 700;
}
.boot-tag-active {
  color: var(--term-accent);
  font-weight: 700;
}

.boot-progress-wrap {
  margin: 1rem 0;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--term-fg-dim);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.boot-progress-bar {
  color: var(--term-fg-bright);
  font-weight: 700;
  letter-spacing: 1px;
}

.boot-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--term-fg-dark);
}

.boot-skip-btn {
  background: transparent;
  border: 1px solid var(--term-fg);
  color: var(--term-fg);
  padding: 0.4rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.boot-skip-btn:hover {
  background: var(--term-fg);
  color: var(--term-bg);
  box-shadow: 0 0 10px var(--term-glow);
}

