@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --cga-black: #000000;
  --cga-blue: #0000AA;
  --cga-green: #00AA00;
  --cga-cyan: #00AAAA;
  --cga-red: #AA0000;
  --cga-magenta: #AA00AA;
  --cga-brown: #AA5500;
  --cga-light-gray: #AAAAAA;
  --cga-dark-gray: #555555;
  --cga-light-blue: #5555FF;
  --cga-light-green: #55FF55;
  --cga-light-cyan: #55FFFF;
  --cga-light-red: #FF5555;
  --cga-light-magenta: #FF55FF;
  --cga-yellow: #FFFF55;
  --cga-white: #FFFFFF;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #000;
  color: #AAAAAA;
  font-family: 'Press Start 2P', monospace;
  overflow-x: hidden;
}

/* Scanline overlay */
.scanlines {
  position: relative;
}
.scanlines::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 10;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #111;
}
::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* Blinking cursor */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.blink-cursor::after {
  content: '█';
  animation: blink 1s infinite;
  color: var(--cga-light-green);
}

/* DOS button style */
.dos-btn {
  font-family: 'Press Start 2P', monospace;
  background: var(--cga-blue);
  color: var(--cga-white);
  border: 2px solid var(--cga-light-gray);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 10px;
  text-transform: uppercase;
  transition: background 0.1s;
}
.dos-btn:hover {
  background: #0000DD;
}
.dos-btn:active {
  background: #000088;
}
.dos-btn:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
  border-color: #444;
}

/* DOS dialog box */
.dos-box {
  border: 2px solid var(--cga-light-gray);
  background: #0a0a0a;
  position: relative;
}
.dos-box::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border: 1px solid #333;
  pointer-events: none;
}

/* Drop zone */
.drop-zone {
  border: 3px dashed var(--cga-cyan);
  background: rgba(0, 170, 170, 0.03);
  transition: all 0.2s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
  background: rgba(0, 170, 170, 0.1);
  border-color: var(--cga-light-cyan);
}

/* Progress bar */
.progress-bar-bg {
  background: #222;
  font-family: monospace;
  overflow: hidden;
}
.progress-bar-fill {
  background: var(--cga-green);
  height: 100%;
  transition: width 0.3s;
}

/* Tooltip */
.cell-tooltip {
  position: fixed;
  background: #111;
  border: 2px solid var(--cga-light-cyan);
  padding: 8px;
  font-size: 8px;
  z-index: 1000;
  pointer-events: none;
  max-width: 320px;
}

/* Hex dump styling */
.hex-dump {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--cga-light-green);
  background: #0a0a0a;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
}

/* Palette swatch */
.palette-swatch {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 2px;
}
.palette-swatch .swatch {
  width: 24px;
  height: 24px;
  border: 1px solid #555;
}

/* Loading blocks animation */
@keyframes loadBlocks {
  0% { content: '░░░░░░░░░░'; }
  25% { content: '▓▓░░░░░░░░'; }
  50% { content: '▓▓▓▓▓░░░░░'; }
  75% { content: '▓▓▓▓▓▓▓░░░'; }
  100% { content: '▓▓▓▓▓▓▓▓▓▓'; }
}

video {
  max-width: 100%;
}

canvas {
  image-rendering: pixelated;
}