/* ==========================================================================
   RETRO CRT TERMINAL STYLES (terminal-styles.css)
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Fira Code", "Space Mono", "Courier New", monospace;
}

:root {
  /* Default: Amber Glow */
  --bg-color: #12100a;
  --text-color: #ffaa00;
  --text-dim: rgba(255, 170, 0, 0.65);
  --text-bright: #ffcc00;
  --text-highlight: #ffe066;
  --text-error: #ff5252;
  --border-color: rgba(255, 170, 0, 0.35);
  --terminal-bg: #1a160d;
  --prompt-color: #ffaa00;
  --header-bg: #0c0a06;
  --success-color: #00ff66;
}

/* Theme: Matrix Cyber Green */
.theme-matrix {
  --bg-color: #040e06;
  --text-color: #00ff66;
  --text-dim: rgba(0, 255, 102, 0.65);
  --text-bright: #66ff99;
  --text-highlight: #b3ffcc;
  --text-error: #ff5252;
  --border-color: rgba(0, 255, 102, 0.35);
  --terminal-bg: #07190b;
  --prompt-color: #00ff66;
  --header-bg: #020803;
  --success-color: #00ff66;
}

/* Theme: Dracula */
.theme-dracula {
  --bg-color: #1e1f29;
  --text-color: #bd93f9;
  --text-dim: rgba(189, 147, 249, 0.65);
  --text-bright: #ff79c6;
  --text-highlight: #f1fa8c;
  --text-error: #ff5555;
  --border-color: rgba(189, 147, 249, 0.35);
  --terminal-bg: #282a36;
  --prompt-color: #ff79c6;
  --header-bg: #191a21;
  --success-color: #50fa7b;
}

/* Theme: Solarized */
.theme-solarized {
  --bg-color: #00212b;
  --text-color: #2aa198;
  --text-dim: rgba(42, 161, 152, 0.65);
  --text-bright: #268bd2;
  --text-highlight: #b58900;
  --text-error: #cb4b16;
  --border-color: rgba(42, 161, 152, 0.35);
  --terminal-bg: #002b36;
  --prompt-color: #268bd2;
  --header-bg: #00171f;
  --success-color: #859900;
}

/* Theme: Nord */
.theme-nord {
  --bg-color: #242933;
  --text-color: #88c0d0;
  --text-dim: rgba(136, 192, 208, 0.65);
  --text-bright: #81a1c1;
  --text-highlight: #ebcb8b;
  --text-error: #bf616a;
  --border-color: rgba(136, 192, 208, 0.35);
  --terminal-bg: #2e3440;
  --prompt-color: #81a1c1;
  --header-bg: #1c2027;
  --success-color: #a3be8c;
}

body {
  background-color: #000;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  cursor: url('assets/icons/cricket-ball-cursor.svg?v=3') 12 12, auto;
}

a, button, .term-ctrl-btn, .theme-option, .close-modal-btn, .btn-circle {
  cursor: url('assets/icons/cricket-ball-pointer.svg?v=3') 12 12, pointer !important;
}

.terminal {
  width: 96vw;
  height: 94vh;
  background-color: var(--bg-color);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(0, 0, 0, 0.85);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* CRT Scanlines Overlay */
.terminal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.3) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.35;
  z-index: 20;
}

/* CRT Edge Glow & Curvature */
.terminal::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 19;
}

/* Terminal Header */
.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--header-bg);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 30;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.btn-circle {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  cursor: pointer;
}

.btn-close { background: #ff5f56; }
.btn-minimize { background: #ffbd2e; }
.btn-maximize { background: #27c93f; }

.terminal-title {
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.terminal-controls {
  display: flex;
  gap: 8px;
}

.term-ctrl-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.term-ctrl-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

/* Console Scroll Area */
.terminal-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

.terminal-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.5rem;
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1.6;
}

.input-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.prompt {
  color: var(--prompt-color);
  font-weight: 700;
  white-space: nowrap;
}

#command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
}

/* Output Formatting */
.output-command-echo {
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

.output-block {
  margin-bottom: 1.2rem;
}

.term-ascii {
  color: var(--text-bright);
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: pre;
  margin-bottom: 1rem;
  font-weight: 700;
}

.term-highlight {
  color: var(--text-highlight);
  font-weight: 700;
}

.term-success {
  color: var(--success-color);
  font-weight: 700;
}

.term-error {
  color: var(--text-error);
}

.term-table {
  width: 100%;
  max-width: 650px;
  margin: 0.6rem 0;
  border-collapse: collapse;
}

.term-table td {
  padding: 4px 12px 4px 0;
  vertical-align: top;
}

.term-table td:first-child {
  color: var(--text-highlight);
  font-weight: 700;
  width: 140px;
}

/* Snake Game Container */
.snake-game-container {
  display: inline-block;
  border: 2px solid var(--border-color);
  background: #000;
  margin: 0.8rem 0;
  padding: 10px;
  text-align: center;
}

#snake-canvas {
  background: #050505;
  border: 1px solid var(--border-color);
  display: block;
}

/* Terminal Footer */
.terminal-footer {
  background-color: var(--header-bg);
  border-top: 1px solid var(--border-color);
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  position: relative;
  z-index: 30;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-gui-link {
  color: var(--text-highlight);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
}

.footer-gui-link:hover {
  text-decoration: underline;
}

/* Theme Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-content {
  background: var(--terminal-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  color: var(--text-color);
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.close-modal-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
}

.theme-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-highlight);
}

.theme-preview {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #fff;
}

.amber-preview { background: #ffaa00; }
.matrix-preview { background: #00ff66; }
.dracula-preview { background: #bd93f9; }
.solarized-preview { background: #2aa198; }
.nord-preview { background: #88c0d0; }
