/* Retro Terminal Styling System */
:root {
  --terminal-amber: hsl(215, 25%, 80%);
  --terminal-amber-dim: hsl(215, 15%, 55%);
  --terminal-amber-glow: rgba(148, 163, 184, 0.12);
  --bg-color: hsl(220, 25%, 7%);
  --window-bg: rgba(15, 20, 28, 0.85);
  --window-border: rgba(148, 163, 184, 0.22);
  --header-bg: rgba(22, 28, 38, 0.9);
  --font-mono: 'Fira Code', 'Courier New', Courier, monospace;

  /* Tasteful ANSI/CLI Color Accents */
  --ansi-blue: hsl(205, 100%, 65%);
  --ansi-cyan: hsl(180, 75%, 55%);
  --ansi-green: hsl(120, 65%, 60%);
  --ansi-yellow: hsl(45, 100%, 60%);
  --ansi-red: hsl(0, 80%, 65%);
  --ansi-magenta: hsl(290, 75%, 65%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--terminal-amber);
  font-family: var(--font-mono);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
  padding: 2rem 1rem;
  text-shadow: 0 0 5px var(--terminal-amber-glow);
}

/* CRT scanlines live in /crt.css now. They used to be a single fixed sheet
   at z-index 9999 painted over the whole page, glyphs included; they are
   now layered behind the text, with the ASCII wordmark as the one
   deliberate exception. Do not re-add an overlay here. */

/* CRT Screen Flicker */
@keyframes crt-flicker {
  0% { opacity: 0.98; }
  50% { opacity: 1; }
  100% { opacity: 0.99; }
}

.screen {
  animation: crt-flicker 0.15s infinite;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Terminal Window Frame */
.terminal-window {
  background: var(--window-bg);
  border: 1px solid var(--window-border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--terminal-amber-glow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

/* Window Top Header Bar */
.terminal-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--window-border);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

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

.window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--terminal-amber);
}

.window-dot.close { background-color: rgba(255, 100, 100, 0.2); }
.window-dot.minimize { background-color: rgba(255, 200, 100, 0.2); }
.window-dot.maximize { background-color: rgba(100, 255, 100, 0.2); }

.window-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--terminal-amber);
  opacity: 0.8;
  letter-spacing: 0.05em;
}

.window-stats {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Terminal Console Body Content */
.terminal-body {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Monospace ASCII Art Header */
.ascii-art {
  font-size: 0.98rem;
  line-height: 1.1;
  white-space: pre;
  margin-bottom: 2rem;
  overflow-x: auto;
  letter-spacing: -0.05em;
  color: var(--ansi-cyan);
}

/* Navigation Menu Tab Buttons */
.nav-tabs {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--window-border);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--terminal-amber-dim);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.3rem;
  transition: all 0.2s ease;
  text-shadow: none;
  white-space: nowrap;
}

.tab-btn:hover, .tab-btn.active {
  color: var(--ansi-blue);
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.tab-btn::before {
  content: "[ ";
  opacity: 0.5;
}

.tab-btn::after {
  content: " ]";
  opacity: 0.5;
}

/* Tab Content Wrappers */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  line-height: 1.6;
  animation: tabFadeIn 0.3s ease-out;
}

.tab-content.active {
  display: flex;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Heading Layouts inside Terminal */
.cli-title {
  font-size: 1.3rem;
  font-weight: 700;
  border-bottom: 1px dashed var(--window-border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cli-title i {
  font-size: 1.1rem;
}

/* File List Layout (Home Page Links) */
.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1rem 0;
}

.file-item {
  border: 1px solid var(--window-border);
  border-radius: 8px;
  padding: 1.25rem;
  background: rgba(148, 163, 184, 0.02);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.file-item:hover {
  background: rgba(56, 189, 248, 0.04);
  border-color: var(--ansi-blue);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.file-header {
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-desc {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Custom Terminal Utilities (Tools Page) */
.tool-box {
  border: 1px solid var(--window-border);
  border-radius: 8px;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
}

.tool-input {
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--window-border);
  border-radius: 4px;
  padding: 0.5rem;
  color: var(--terminal-amber);
  font-family: var(--font-mono);
  font-size: 1rem;
  flex-grow: 1;
  outline: none;
}

.tool-input:focus {
  border-color: var(--ansi-blue);
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.25);
}

.tool-btn {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--window-border);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  color: var(--ansi-blue);
  font-family: var(--font-mono);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: var(--ansi-blue);
  color: var(--bg-color);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.tool-output {
  border-top: 1px dashed var(--window-border);
  padding-top: 1rem;
  white-space: pre-wrap;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* MTG Proxy Configuration Panel Grid */
.mtg-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.mtg-config-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mtg-config-item label {
  font-size: 0.85rem;
  font-weight: 600;
}

/* MTG Preview Grid */
.mtg-preview-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.mtg-page-preview {
  border: 1px dashed var(--window-border);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  position: relative;
}

.mtg-page-title {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.mtg-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  max-width: 450px;
  margin: 0 auto;
}

.mtg-preview-card {
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  background: #111;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}

.mtg-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Log Output / Journal styling */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.log-entry {
  display: flex;
  gap: 1rem;
  border-left: 2px solid var(--terminal-amber-dim);
  padding-left: 0.75rem;
}

.log-time {
  color: var(--terminal-amber-dim);
  flex-shrink: 0;
}

.log-text {
  opacity: 0.95;
}

/* Music Videos Playlist Grid */
.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1rem 0;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border: 1px solid var(--window-border);
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

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

/* Minecraft Status Panel */
.mc-status-panel {
  border: 1px solid var(--window-border);
  border-radius: 8px;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mc-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--window-border);
  padding-bottom: 0.75rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--terminal-amber-dim);
  box-shadow: 0 0 5px var(--terminal-amber-glow);
}

.status-dot.online {
  background-color: #55ff55;
  box-shadow: 0 0 8px rgba(85, 255, 85, 0.5);
}

.status-dot.offline {
  background-color: #ff5555;
  box-shadow: 0 0 8px rgba(255, 85, 85, 0.5);
}

/* Interactive Command Prompt Line */
.cli-prompt-line {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px dashed var(--window-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.cli-cursor {
  width: 10px;
  height: 1.2rem;
  background: var(--terminal-amber);
  display: inline-block;
  animation: blink 1s step-end infinite;
  box-shadow: 0 0 5px var(--terminal-amber-glow);
}

@keyframes blink {
  from, to { background-color: transparent; }
  50% { background-color: var(--terminal-amber); }
}

/* Footer Credits */
footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  width: 100%;
  letter-spacing: 0.05em;
}

footer p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.5rem;
}

.footer-icons a {
  color: var(--terminal-amber-dim);
  text-decoration: none;
  font-size: 1.15rem;
  transition: color 0.2s ease, transform 0.2s ease, filter 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.footer-icons a:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

/* Brand colors on hover */
.ico-github:hover {
  color: #e6edf3;
}
.ico-youtube:hover {
  color: #ff4e4e;
}
.ico-makerworld:hover {
  color: #42e3b4;
}
.ico-kofi:hover {
  color: #ff5e5b;
}

/* Horizontal line dividers */
hr {
  border: 0;
  border-top: 1px dashed var(--window-border);
  margin: 1rem 0;
}

/* Custom Scrollbar for Retro Aesthetics */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: var(--terminal-amber-dim);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--terminal-amber);
}

/* Favorites Tab Grid */
.fav-wip-note {
  border: 1px dashed var(--ansi-yellow);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: rgba(234, 179, 8, 0.05);
  color: var(--ansi-yellow);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fav-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ansi-cyan);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px dashed var(--window-border);
  padding-bottom: 0.25rem;
}

.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fav-item {
  border: 1px solid var(--window-border);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(148, 163, 184, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.fav-item:hover {
  background: rgba(56, 189, 248, 0.04);
  border-color: var(--ansi-blue);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.12);
}

.fav-header {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fav-header-name {
  color: var(--ansi-yellow);
  text-decoration: none;
  transition: all 0.2s ease;
}

.fav-header-name:hover {
  color: var(--ansi-blue);
  text-decoration: underline;
}

.fav-links {
  display: flex;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.fav-link {
  color: var(--ansi-blue);
  text-decoration: none;
  transition: opacity 0.2s;
}

.fav-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.fav-desc {
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1.4;
  color: var(--terminal-amber);
}

/* Responsive Art Scales */
@media (max-width: 768px) {
  body { padding: 1rem 0.5rem; }
  .terminal-body { padding: 1rem; }
  .ascii-art { font-size: 0.6rem; }
  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    gap: 0.75rem;
  }
  .tab-btn { font-size: 0.82rem; }
}

@media (max-width: 480px) {
  .nav-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .tab-btn { font-size: 0.8rem; }
}
