/* Tricorder MK-II - Handheld + 80s Grid */
:root {
  --tron-orange: #ff9900;
  --tron-amber: #ffcc66;
  --tron-dark: #ff6600;
  --space-black: #000000;
  --dark-gray: #111111;
  --metal: #444455;
  --glow-orange: rgba(255, 153, 0, 0.4);
  --device-width: 450px;
  --device-border: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--space-black);
  font-family: 'Orbitron', 'Rajdhani', monospace;
  color: #fff;
  min-height: 100vh;
  background-image: 
    linear-gradient(0deg, transparent 39px, rgba(255, 153, 0, 0.05) 40px),
    linear-gradient(90deg, transparent 39px, rgba(255, 153, 0, 0.05) 40px);
  background-size: 40px 40px;
}

/* === DEVICE CONTAINER - Handheld === */
.tricorder-device {
  max-width: var(--device-width);
  margin: 20px auto;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
  border: var(--device-border) solid var(--metal);
  border-radius: 20px;
  box-shadow: 
    0 0 50px var(--glow-orange),
    inset 0 0 30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  position: relative;
}

/* === DEVICE HEADER === */
.device-header {
  background: linear-gradient(90deg, var(--tron-dark) 0%, var(--tron-orange) 50%, var(--tron-dark) 100%);
  padding: 15px 20px;
  border-bottom: 3px solid var(--metal);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.device-title {
  color: var(--space-black);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--glow-orange);
}

.device-subtitle {
  color: var(--space-black);
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.8;
}

.device-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tron-orange);
  box-shadow: 0 0 15px var(--glow-orange);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === SCREEN BEZEL === */
.screen-bezel {
  background: #000;
  border: 4px solid #222;
  border-top: none;
  border-bottom: none;
  padding: 0;
  position: relative;
}

/* === GRID VISUALIZER - 80s Style === */
.grid-visualizer {
  height: 300px;
  background: radial-gradient(ellipse at bottom, #1a0a00 0%, #000000 70%);
  overflow: hidden;
  position: relative;
  perspective: 600px;
  perspective-origin: 50% 100%;
}

.grid-floor {
  position: absolute;
  bottom: -100px;
  left: -50%;
  width: 200%;
  height: 400px;
  background-image: 
    linear-gradient(0deg, transparent 39px, var(--tron-orange) 40px),
    linear-gradient(90deg, transparent 39px, var(--tron-orange) 40px);
  background-size: 40px 40px;
  transform: rotateX(60deg);
  animation: move-forward 3s infinite linear;
  opacity: 0.6;
}

@keyframes move-forward {
  0% { transform: rotateX(60deg) translateY(0); }
  100% { transform: rotateX(60deg) translateY(40px); }
}

.grid-sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(180deg, #000000 0%, #1a0a00 100%);
  z-index: 1;
}

/* === VIDEO OVERLAY === */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.video-overlay.active {
  opacity: 0.7;
}

.video-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === SCREEN CONTROLS === */
.screen-controls {
  background: #111;
  border-top: 3px solid var(--metal);
  border-bottom: 3px solid var(--metal);
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.screen-btn {
  background: var(--dark-gray);
  border: 2px solid var(--tron-orange);
  border-radius: 4px;
  color: var(--tron-orange);
  padding: 8px 12px;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.screen-btn:hover {
  background: var(--tron-orange);
  color: var(--space-black);
  box-shadow: 0 0 15px var(--glow-orange);
}

.screen-btn:active {
  transform: scale(0.95);
}

.screen-btn.active {
  background: var(--tron-orange);
  color: var(--space-black);
}

/* === FADER BANK - Compact === */
.fader-bank {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: #0a0a0a;
  border-bottom: 3px solid var(--metal);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fader-bank::-webkit-scrollbar {
  height: 6px;
}

.fader-bank::-webkit-scrollbar-track {
  background: #000;
}

.fader-bank::-webkit-scrollbar-thumb {
  background: var(--tron-orange);
  border-radius: 3px;
}

.fader-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 38px;
  flex-shrink: 0;
}

.fader-label {
  color: var(--tron-amber);
  font-size: 7px;
  letter-spacing: 1px;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 40px;
  text-align: center;
}

.fader-track {
  width: 32px;
  height: 100px;
  background: #000;
  border: 2px solid var(--metal);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.fader-thumb {
  width: 26px;
  height: 20px;
  background: linear-gradient(180deg, var(--tron-orange) 0%, var(--tron-dark) 100%);
  border-radius: 3px;
  position: absolute;
  left: 3px;
  cursor: ns-resize;
  box-shadow: 0 0 15px var(--glow-orange);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fader-thumb::after {
  content: '▬';
  color: var(--space-black);
  font-size: 12px;
  font-weight: bold;
}

.fader-value {
  color: var(--tron-orange);
  font-size: 9px;
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 8px var(--glow-orange);
  width: 38px;
  text-align: center;
  white-space: nowrap;
}

/* === BOTTOM CONTROLS === */
.bottom-controls {
  background: #111;
  padding: 15px 20px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* === DROP ZONE - Integrated === */
.drop-zone {
  border: 2px dashed var(--metal);
  margin: 15px 20px;
  padding: 20px;
  text-align: center;
  border-radius: 8px;
  background: rgba(255, 153, 0, 0.05);
  transition: all 0.3s;
  cursor: pointer;
}

.drop-zone:hover {
  border-color: var(--tron-orange);
  background: rgba(255, 153, 0, 0.1);
}

.drop-zone:active {
  border-color: var(--tron-orange);
  box-shadow: 0 0 30px var(--glow-orange);
}

.drop-icon {
  font-size: 36px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px var(--glow-orange));
}

.drop-text {
  color: var(--tron-orange);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.drop-subtext {
  color: var(--tron-amber);
  font-size: 8px;
  letter-spacing: 1px;
}

/* === COMPACT MODE === */
.tricorder-device.compact .grid-visualizer {
  height: 200px;
}

.tricorder-device.compact .fader-track {
  height: 80px;
}

.tricorder-device.compact .fader-label {
  height: 30px;
  font-size: 6px;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .tricorder-device {
    margin: 10px;
    border-width: 6px;
  }
  
  .device-header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .grid-visualizer {
    height: 250px;
  }
}

/* === FILE INPUT === */
#audio-input, #video-input {
  display: none;
}
