:root {
  --dos-green: #00FF00;
  --dos-amber: #FFB000;
  --dos-cyan: #00FFFF;
  --dos-magenta: #FF00FF;
  --dos-red: #FF5555;
  --dos-yellow: #FFFF55;
  --dos-white: #AAAAAA;
  --dos-bright-white: #FFFFFF;
  --dos-blue-bg: #0000AA;
  --dos-black: #0D0D0D;
  --dos-dark: #1A1A2E;
}

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

body {
  background: var(--dos-black);
  color: var(--dos-green);
  font-family: 'VT323', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

#crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
}

#crt-overlay.flicker {
  animation: crtFlicker 0.05s infinite alternate;
}

@keyframes crtFlicker {
  0% { opacity: 0.97; }
  50% { opacity: 1; }
  100% { opacity: 0.98; }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px #ff0000; }
  50% { transform: scale(1.05); box-shadow: 0 0 25px #ff0000, 0 0 50px #ff000066; }
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes progressBlock {
  0% { width: 0%; }
  100% { width: 100%; }
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}

.pulse-rec {
  animation: pulse 1.5s ease-in-out infinite;
}

.font-dos {
  font-family: 'VT323', monospace;
}

.font-dos-title {
  font-family: 'Press Start 2P', cursive;
}

/* DOS-style box drawing borders */
.dos-border {
  border: 2px solid var(--dos-green);
  position: relative;
}

.dos-border-double {
  border: 3px double var(--dos-green);
}

.dos-border-amber {
  border: 2px solid var(--dos-amber);
}

/* Hex editor styling */
.hex-view {
  background: var(--dos-blue-bg);
  font-family: 'VT323', monospace;
  font-size: 16px;
  line-height: 1.6;
}

/* 3D beveled button */
.btn-3d {
  border-top: 3px solid #ffffff;
  border-left: 3px solid #ffffff;
  border-bottom: 3px solid #555555;
  border-right: 3px solid #555555;
  background: #C0C0C0;
  color: #000000;
  font-family: 'VT323', monospace;
  cursor: pointer;
  padding: 8px 20px;
  font-size: 20px;
  transition: all 0.05s;
}

.btn-3d:active {
  border-top: 3px solid #555555;
  border-left: 3px solid #555555;
  border-bottom: 3px solid #ffffff;
  border-right: 3px solid #ffffff;
}

.btn-3d:hover {
  background: #D4D4D4;
}

/* Tab buttons */
.tab-btn {
  background: #333;
  color: var(--dos-green);
  border: 2px solid var(--dos-green);
  padding: 6px 16px;
  cursor: pointer;
  font-family: 'VT323', monospace;
  font-size: 18px;
  transition: all 0.1s;
}

.tab-btn.active {
  background: var(--dos-green);
  color: #000;
}

.tab-btn:hover:not(.active) {
  background: #1a3a1a;
}

/* Progress bar DOS style */
.progress-track {
  background: #333;
  border: 1px solid var(--dos-green);
  height: 24px;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  background: var(--dos-green);
  height: 100%;
  transition: width 0.1s linear;
}

/* Tooltip */
.hex-tooltip {
  position: absolute;
  background: #000;
  border: 1px solid var(--dos-amber);
  color: var(--dos-amber);
  padding: 6px 10px;
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
  max-width: 300px;
  white-space: pre-wrap;
}

/* Waveform canvas */
.waveform-canvas {
  background: #0a0a0a;
  border: 1px solid var(--dos-green);
  image-rendering: pixelated;
}

/* Drop zone styling */
.drop-zone {
  border: 3px dashed var(--dos-amber);
  background: rgba(255, 176, 0, 0.05);
  transition: all 0.2s;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drop-zone.drag-over {
  background: rgba(255, 176, 0, 0.15);
  border-color: var(--dos-yellow);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: var(--dos-green);
  border: 2px solid #1a1a2e;
}

/* Color classes for hex fields */
.hex-magic { color: var(--dos-cyan); }
.hex-lastpage { color: var(--dos-yellow); }
.hex-pages { color: #55FF55; }
.hex-reloc { color: var(--dos-magenta); }
.hex-header { color: #FF8855; }
.hex-minalloc { color: #5555FF; }
.hex-maxalloc { color: #55FFFF; }
.hex-ss { color: #FFFF55; }
.hex-sp { color: #FF55FF; }
.hex-checksum { color: var(--dos-red); }
.hex-ip { color: #55FF55; }
.hex-cs { color: #FFAAAA; }
.hex-relocoff { color: #AAFFAA; }
.hex-overlay { color: #AAAAFF; }
.hex-reserved { color: #888888; }

/* Screen curvature effect */
.crt-screen {
  border-radius: 15px;
  box-shadow:
    inset 0 0 60px rgba(0, 255, 0, 0.05),
    0 0 20px rgba(0, 255, 0, 0.1);
}

@media (max-width: 768px) {
  .hex-view {
    font-size: 12px;
    line-height: 1.4;
  }
  
  .font-dos-title {
    font-size: 12px !important;
  }
}