/* ==========================================================================
   LA CASA DEL TRUCO // DARKBYTE TACTICAL INTEL
   Consultor & Certificador de Identidad Venezuela (16-Bit Pixel Art HUD)
   100% Responsive (Mobile & Desktop)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Share+Tech+Mono&display=swap');

:root {
  --crt-bg: #091a2c;
  --terminal-green: #f4e8c1;
  --terminal-dim: #1e3a5f;
  --terminal-dark: #0f2b48;
  --terminal-amber: #e5c158;
  --terminal-red: #ef4444;
  --terminal-cyan: #38bdf8;
  --scanline-color: rgba(15, 43, 72, 0.15);
  --phosphor-glow: none;
  --amber-glow: none;
  
  --font-pixel: 'IBM Plex Mono', monospace;
  --font-terminal: 'IBM Plex Mono', 'VT323', monospace;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

body {
  background-color: #dce1e6;
  background-image: none;
  color: #14213d;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0 0 32px 0;
  margin: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Universal Sticky Header on ConsultorVE (IBM 80s) */
.lcdt-nav {
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #0f2b48;
  border-bottom: 2px solid #1e3a5f;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  position: sticky;
  top: 0;
  z-index: 9999;
}
.lcdt-nav-brand {
  color: #f4e8c1;
  font-weight: 700;
  letter-spacing: 1px;
  margin-right: 6px;
}
.lcdt-nav a {
  color: #e5c158;
  text-decoration: none;
  border: 1px solid #1e3a5f;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.08);
}
.lcdt-nav a:hover {
  background: #1e3a5f;
  color: #fff;
}
.lcdt-nav a.active {
  background: #f4e8c1;
  color: #0f2b48;
  border-color: #e5c158;
  font-weight: bold;
}
.lcdt-nav-spacer { flex: 1; }
.lcdt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

/* CRT Screen Frame Container */
.crt-bezel {
  width: calc(100% - 32px);
  max-width: 1240px;
  background: #0f2b48;
  border: 10px solid #1e3a5f;
  border-radius: 20px;
  box-shadow: 
    0 0 0 3px #080c09,
    0 20px 50px rgba(0, 0, 0, 0.95),
    inset 0 0 30px rgba(0, 0, 0, 0.8);
  position: relative;
  padding: 12px;
  margin: 36px auto 24px auto;
  box-sizing: border-box;
}

.crt-bezel::before {
  content: "LA CASA DEL TRUCO • DARKBYTE INTEL SYSTEM • TACTICAL TERMINAL";
  position: absolute;
  top: -22px;
  left: 20px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #5b7561;
  letter-spacing: 2px;
  text-shadow: 0 1px 2px #000;
}

.crt-screws {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334437;
  box-shadow: inset 1px 1px 2px #000;
}
.screw-tl { top: -6px; left: -6px; }
.screw-tr { top: -6px; right: -6px; }
.screw-bl { bottom: -6px; left: -6px; }
.screw-br { bottom: -6px; right: -6px; }

/* CRT Curved Screen & Scanlines */
.crt-monitor {
  background-color: var(--crt-bg);
  border-radius: 14px;
  border: 2px solid #1e3a5f;
  box-shadow: inset 0 0 60px rgba(0, 40, 10, 0.85);
  position: relative;
  overflow: hidden;
  padding: 18px;
}

/* Scanlines overlay */
.crt-monitor::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 6px 100%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.85;
}

.scanline-sweep {
  width: 100%;
  height: 90px;
  position: absolute;
  left: 0;
  top: -90px;
  background: linear-gradient(to bottom, rgba(51, 255, 102, 0), rgba(51, 255, 102, 0.08) 50%, rgba(51, 255, 102, 0));
  pointer-events: none;
  animation: crtScan 8s linear infinite;
  z-index: 99;
}

@keyframes crtScan {
  0% { top: -90px; }
  100% { top: 100%; }
}

/* ==========================================================================
   TOP BAR: FREQUENCY & SYSTEM STATUS
   ========================================================================== */
.top-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 2px dashed var(--terminal-dim);
  padding-bottom: 12px;
  margin-bottom: 16px;
  gap: 12px;
}

.top-brand-badge {
  display: flex;
  align-items: center;
}

.fsociety-tag {
  background: var(--terminal-dark);
  border: 1px solid var(--terminal-green);
  color: var(--terminal-green);
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 6px 10px;
  letter-spacing: 1px;
  box-shadow: var(--phosphor-glow);
}

.system-title {
  text-align: center;
  flex: 1;
  min-width: 260px;
}

.main-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--terminal-green);
  text-shadow: var(--phosphor-glow);
  margin-bottom: 4px;
}

.sub-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--terminal-amber);
  letter-spacing: 1px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tactical-btn-small {
  background: #09200f;
  color: var(--terminal-green);
  border: 2px solid #1e3a5f;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.1s;
}

.tactical-btn-small:hover {
  background: var(--terminal-green);
  color: #000;
  box-shadow: var(--phosphor-glow);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--terminal-green);
}

.blinking-dot {
  width: 8px;
  height: 8px;
  background: var(--terminal-green);
  border-radius: 50%;
  box-shadow: var(--phosphor-glow);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ==========================================================================
   LAYOUT GRID
   ========================================================================== */
.tactical-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
}

/* ==========================================================================
   LEFT PANEL: OPERATIVE CODEC (DARKBYTE & LA CASA DEL TRUCO)
   ========================================================================== */
.codec-box {
  background: rgba(8, 28, 12, 0.75);
  border: 2px solid #1e3a5f;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portrait-wrapper {
  position: relative;
  border: 2px solid var(--terminal-green);
  box-shadow: var(--phosphor-glow);
  background: #000;
  overflow: hidden;
}

.operative-avatar {
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.15) brightness(1.05);
}

.portrait-overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 20, 5, 0.9);
  border-top: 1px solid var(--terminal-dim);
  padding: 6px 8px;
  font-family: var(--font-pixel);
  font-size: 8px;
  display: flex;
  justify-content: space-between;
}

/* Audio visualizer bars */
.audio-visualizer {
  display: flex;
  align-items: flex-end;
  height: 24px;
  gap: 3px;
  background: #000;
  border: 1px solid var(--terminal-dark);
  padding: 3px 5px;
}

.eq-bar {
  flex: 1;
  background: var(--terminal-green);
  height: 30%;
  transition: height 0.15s ease;
}

.badge-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #051408;
  border: 1px solid var(--terminal-dim);
  padding: 8px;
}

.badge-img {
  width: 44px;
  height: 44px;
  border: 1px solid var(--terminal-green);
  border-radius: 4px;
}

.badge-info {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--terminal-amber);
}

/* Dialog Box */
.dialog-box {
  background: #000;
  border: 2px solid #1e3a5f;
  padding: 10px;
  min-height: 90px;
  font-size: 17px;
  line-height: 1.25;
}

.dialog-speaker {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--terminal-amber);
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--terminal-dark);
  padding-bottom: 4px;
}

.dialog-text {
  color: #c9ffd5;
  white-space: pre-wrap;
}

/* ==========================================================================
   RIGHT PANEL: CONSOLE & CERTIFIER DOSSIER
   ========================================================================== */
.intel-console {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Search Box */
.search-card {
  background: rgba(6, 22, 10, 0.8);
  border: 2px solid #1e3a5f;
  padding: 14px;
}

.search-header {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--terminal-green);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.type-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.type-btn {
  background: #09200f;
  color: var(--terminal-green);
  border: 2px solid #1e3a5f;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 38px;
}

.type-btn.active, .type-btn:hover {
  background: var(--terminal-green);
  color: #000;
  box-shadow: var(--phosphor-glow);
}

.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.input-wrapper {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  background: #000;
  border: 2px solid var(--terminal-green);
  box-shadow: inset 0 0 10px rgba(51, 255, 102, 0.2);
  padding: 0 10px;
  min-height: 48px;
}

.input-prefix {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--terminal-amber);
  margin-right: 6px;
}

.cedula-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--terminal-green);
  font-family: var(--font-terminal);
  font-size: 28px;
  letter-spacing: 2px;
  text-shadow: var(--phosphor-glow);
}

.btn-transmit {
  background: #0b3d17;
  color: var(--terminal-green);
  border: 2px solid var(--terminal-green);
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: var(--phosphor-glow);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  min-height: 48px;
}

.btn-transmit:hover {
  background: var(--terminal-green);
  color: #000;
  transform: translateY(-1px);
}

/* Quick preset pills */
.preset-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #7da585;
  flex-wrap: wrap;
}

.preset-pill {
  background: #051408;
  color: var(--terminal-amber);
  border: 1px solid #1a4d25;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: all 0.1s;
}

.preset-pill:hover {
  border-color: var(--terminal-amber);
  box-shadow: var(--amber-glow);
}

/* ==========================================================================
   DOSSIER RESULT CARD & STAMP
   ========================================================================== */
.dossier-card {
  background: rgba(3, 15, 6, 0.92);
  border: 2px solid #1e3a5f;
  padding: 16px;
  position: relative;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.dossier-card.verified {
  border-color: var(--terminal-green);
  box-shadow: 0 0 20px rgba(51, 255, 102, 0.15);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--terminal-dark);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.dossier-ref {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--terminal-amber);
  margin-bottom: 4px;
}

.dossier-name {
  font-size: clamp(22px, 4vw, 30px);
  color: #fff;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Certified Stamp Animation */
.tactical-stamp {
  position: absolute;
  top: 24px;
  right: 24px;
  border: 4px solid var(--terminal-green);
  padding: 6px 14px;
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: bold;
  color: var(--terminal-green);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  transform: rotate(-10deg) scale(2);
  opacity: 0;
  pointer-events: none;
  background: rgba(3, 30, 10, 0.9);
  box-shadow: var(--phosphor-glow);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 50;
}

.tactical-stamp.stamp-active {
  opacity: 0.95;
  transform: rotate(-10deg) scale(1);
}

.stamp-sub {
  font-size: 7px;
  letter-spacing: 1px;
  color: var(--terminal-amber);
  margin-top: 3px;
}

/* Dossier Fields Grid */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.field-item {
  background: #000;
  border: 1px solid var(--terminal-dark);
  padding: 8px 10px;
}

.field-label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: #72a37b;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.field-val {
  font-size: 22px;
  color: var(--terminal-green);
}

/* Section Boxes */
.details-section {
  background: #000;
  border: 1px solid var(--terminal-dark);
  padding: 12px;
  margin-bottom: 12px;
}

.sec-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--terminal-amber);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

.sec-badge {
  color: var(--terminal-green);
}

.sec-badge.alert {
  color: var(--terminal-amber);
}

.sec-content {
  font-size: 19px;
  line-height: 1.35;
  color: #c0dec6;
}

/* Action Bar Bottom */
.action-bar {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 2px dashed var(--terminal-dark);
  flex-wrap: wrap;
}

.btn-action {
  background: #051408;
  color: var(--terminal-green);
  border: 1px solid var(--terminal-dim);
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.1s;
  min-height: 38px;
}

.btn-action:hover {
  background: var(--terminal-green);
  color: #000;
  box-shadow: var(--phosphor-glow);
}

/* Scanner Animation */
.scanner-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 15, 5, 0.94);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  z-index: 40;
}

.scanner-overlay.active {
  display: flex;
}

.radar-circle {
  width: 80px;
  height: 80px;
  border: 2px solid var(--terminal-green);
  border-radius: 50%;
  position: relative;
  box-shadow: var(--phosphor-glow);
  overflow: hidden;
}

.radar-sweep {
  position: absolute;
  width: 50%;
  height: 50%;
  top: 0;
  right: 0;
  background: linear-gradient(45deg, rgba(51, 255, 102, 0.8), transparent 70%);
  transform-origin: bottom left;
  animation: radarSpin 1.2s linear infinite;
}

@keyframes radarSpin {
  100% { transform: rotate(360deg); }
}

.scanner-text {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--terminal-green);
  letter-spacing: 1.5px;
  text-align: center;
  padding: 0 10px;
  animation: blink 0.8s infinite;
}

/* Footer ticker */
.footer-bar {
  margin-top: 14px;
  border-top: 2px solid var(--terminal-dark);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #55775c;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLETS)
   ========================================================================== */
@media (max-width: 880px) {
  body {
    padding: 0 0 20px 0;
  }
  .crt-bezel {
    width: calc(100% - 12px);
    margin: 20px auto 16px auto;
  }

  .crt-bezel {
    border-width: 6px;
    border-radius: 14px;
    padding: 6px;
  }

  .crt-bezel::before {
    display: none;
  }

  .crt-monitor {
    padding: 12px;
  }

  .tactical-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .codec-box {
    max-width: 100%;
  }

  .portrait-wrapper {
    max-width: 260px;
    margin: 0 auto;
  }

  .top-status-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .codec-freq {
    justify-content: center;
  }

  .top-controls {
    justify-content: center;
  }

  .input-row {
    flex-direction: column;
  }

  .btn-transmit {
    width: 100%;
    justify-content: center;
  }

  .fields-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tactical-stamp {
    position: static;
    transform: none !important;
    margin-bottom: 12px;
    display: inline-block;
  }

  .action-bar {
    flex-direction: column;
  }

  .btn-action {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .fields-grid {
    grid-template-columns: 1fr;
  }

  .type-buttons {
    flex-direction: column;
  }

  .type-btn {
    width: 100%;
    text-align: center;
  }

  .preset-row {
    flex-direction: column;
    align-items: stretch;
  }

  .preset-pill {
    text-align: center;
    padding: 6px;
  }
}
