/* style.css - Fido 1960s Transistor Radio Styling */

:root {
  --bg-color: #121314;
  --chassis-color: #242628;
  --panel-bg: #d8d7d2; /* Lighter warm grey panel background */
  --cream-accent: #f5e3ba; /* Custard cream with warm yellow cast */
  --cream-dim: #d0bd96; /* Warm dim cream */
  --radio-orange: #df5634;
  --radio-orange-glow: rgba(223, 86, 52, 0.4);
  --analog-green: #1a5e42; /* Dark green for high readability on light grey */
  --analog-green-glow: rgba(26, 94, 66, 0.3);
  --border-color: #b0afaa; /* Darker border for light cards */
  --text-primary: #f5e3ba; /* Main theme accent stays cream outside cards */
  --text-secondary: #585651; /* Darker secondary text color */
  --glass-color: rgba(30, 32, 34, 0.95);
  
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

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

body {
  background-color: var(--bg-color);
  font-family: var(--font-heading);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  overflow-y: auto;
}

/* Transistor Radio Chassis */
.radio-chassis {
  position: relative;
  width: 1240px;
  max-width: 95vw;
  background: radial-gradient(circle at 50% 0%, #E63E26 0%, #B32615 100%); /* Bakelite Fiesta Red */
  border: 8px solid #8B1B0E; /* Colored Bakelite Bezel */
  border-radius: 24px;
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.8),
    inset 0 3px 6px rgba(255, 255, 255, 0.35),
    inset 0 -6px 12px rgba(0, 0, 0, 0.4);
  padding: 25px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

/* Custom Ingestion: Cream Tab Share Button */
#btn-tab-audio {
  background: linear-gradient(180deg, var(--cream-accent) 0%, var(--cream-dim) 100%) !important;
  color: var(--bg-color) !important;
  border-color: var(--cream-accent) !important;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}
#btn-tab-audio:hover {
  background: linear-gradient(180deg, #ffffff 0%, var(--cream-accent) 100%) !important;
  border-color: #ffffff !important;
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}
#btn-tab-audio:active {
  background: var(--cream-dim) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}

/* Landscape Dashboard Layout */
.dashboard-row {
  display: flex;
  gap: 25px;
  align-items: stretch;
  width: 100%;
}

.controls-column-group {
  display: flex;
  gap: 20px;
  flex: 1.2;
  min-width: 580px;
}

.visuals-column-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1.0;
  min-width: 500px;
  justify-content: space-between;
}

.dashboard-sidebar-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #18191a; /* Explicit dark text inside cards */
}

/* Override Ingestion panel when nested inside dashboard card */
.dashboard-sidebar-card .ingest-panel {
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
}

.dashboard-sidebar-card .radio-header {
  background-color: #121314; /* Dark inset tuner plate */
  border-radius: 8px;
  padding: 10px 15px;
  margin-bottom: 12px;
  border: 1px solid #2d2f32;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Subtle metal grille pattern behind the radio controls */
.grille-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.02;
  background-image: radial-gradient(var(--cream-accent) 1px, transparent 1px);
  background-size: 8px 8px;
  pointer-events: none;
  z-index: 1;
}

.radio-chassis > * {
  position: relative;
  z-index: 2;
}

/* Header Panel styling */
.radio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 15px;
}

.brand-group {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--cream-accent);
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--cream-accent);
  margin-top: 4px;
  font-weight: bold;
}

/* VU Meter Canvas Area */
.vu-meter-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #121314;
  border: 3px solid var(--border-color);
  border-radius: 8px;
  padding: 4px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

#vu-canvas {
  display: block;
}

.vu-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Source Ingestion Panel */
.ingest-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.panel-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--cream-accent);
  background-color: #1a1a1a; /* Dark Dymo label styling */
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 12px;
  font-weight: bold;
  border: 1px solid #2d2f32;
  display: inline-block;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.button-group {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
}

/* Buttons style (transistor radio push buttons) */
.retro-btn {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cream-dim);
  background: linear-gradient(180deg, #323537 0%, #202223 100%);
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.retro-btn:hover {
  color: var(--cream-accent);
  background: linear-gradient(180deg, #3c3f41 0%, #282a2b 100%);
  border-color: #4a4d52;
}

.retro-btn:active {
  background: #18191a;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  transform: translateY(1px);
}

.retro-btn.active {
  color: var(--bg-color);
  background: linear-gradient(180deg, var(--cream-accent) 0%, var(--cream-dim) 100%);
  border-color: var(--cream-accent);
  box-shadow: 
    0 0 10px rgba(235, 220, 197, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.file-label {
  display: inline-flex;
  margin: 0;
}

/* Status Indicator Bar */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #121314;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  border: 1px solid #222325;
}

.status-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #4e5052;
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
  transition: all 0.2s ease;
}

.status-light.idle {
  background-color: #e0ac36;
  box-shadow: 0 0 8px rgba(224, 172, 54, 0.8);
}

.status-light.active {
  background-color: var(--analog-green);
  box-shadow: 0 0 8px var(--analog-green-glow);
}

.status-light.bypassed {
  background-color: var(--radio-orange);
  box-shadow: 0 0 8px var(--radio-orange-glow);
}

.status-text {
  color: var(--text-secondary);
  font-weight: bold;
}

.status-light.active + .status-text {
  color: var(--analog-green);
}

.status-light.bypassed + .status-text {
  color: var(--radio-orange);
}

.source-info {
  margin-left: auto;
  color: var(--text-secondary);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Visualizer Glass Screen */
.display-screen-container {
  position: relative;
  background-color: var(--glass-color);
  border: 4px solid #0f1011;
  border-radius: 12px;
  box-shadow: 
    inset 0 5px 15px rgba(0, 0, 0, 0.9),
    0 4px 10px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.glass-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 5;
}

.screen-border {
  position: relative;
  display: flex;
  flex-direction: column;
}

#visualizer-canvas {
  width: 100%;
  height: 340px;
  display: block;
}

.screen-hud {
  position: absolute;
  bottom: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(89, 156, 133, 0.65);
  pointer-events: none;
  z-index: 4;
}

.bypass-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(223, 86, 52, 0.95);
  color: white;
  font-weight: bold;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  letter-spacing: 3px;
  padding: 10px 20px;
  border-radius: 6px;
  border: 2px solid white;
  box-shadow: 0 0 20px rgba(223, 86, 52, 0.8);
  display: none;
  z-index: 6;
  pointer-events: none;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0.96); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.04); opacity: 1; }
}

/* Control Matrix Grid */
.control-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.control-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  color: #18191a; /* Dark text inside cards */
}

/* Retro Slide Toggle Switch */
.toggle-switch-wrapper {
  display: flex;
  align-items: center;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #121314;
  transition: .2s;
  border-radius: 24px;
  border: 1.5px solid var(--border-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Metal toggle knob */
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 2.5px;
  background: linear-gradient(180deg, var(--cream-accent) 0%, var(--cream-dim) 100%);
  border: 1px solid #111;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: rgba(223, 86, 52, 0.25);
  border-color: var(--radio-orange);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(25px);
  background: linear-gradient(180deg, var(--cream-accent) 0%, var(--cream-dim) 100%);
  box-shadow: 0 0 5px rgba(235, 220, 197, 0.6);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Platter slip event HUD text */
.belt-slip-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.belt-slip-status.active {
  color: var(--radio-orange);
  animation: flash 0.4s infinite alternate;
}

@keyframes flash {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

.panel-header {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--cream-accent);
  background-color: #1a1a1a; /* Dark Dymo label styling */
  border-radius: 4px;
  padding: 6px 12px;
  margin-bottom: 20px;
  border: 1px solid #2d2f32;
  text-align: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.control-row:last-of-type {
  margin-bottom: 0;
}

.control-label-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.control-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--analog-green);
}

.control-description {
  font-size: 0.75rem;
  color: #333333; /* High-contrast dark charcoal */
  line-height: 1.4;
  margin-top: 4px;
}

/* Vintage Sliders Styling */
.slider-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #121314;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

/* Chrome/Safari Slider Thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--cream-accent) 0%, var(--cream-dim) 100%);
  border: 1px solid #1a1a1a;
  cursor: pointer;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.4);
  transition: background 0.15s ease;
  position: relative;
}

/* Custom indicator line on the knob (like vintage tuner lines) */
input[type="range"]::-webkit-slider-thumb::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 2px;
  width: 2px;
  height: 20px;
  background-color: var(--radio-orange);
}

input[type="range"]:disabled::-webkit-slider-thumb {
  background: linear-gradient(180deg, var(--cream-accent) 0%, var(--cream-dim) 100%);
  opacity: 0.35;
  cursor: not-allowed;
}

/* Firefox Slider Thumb */
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--cream-accent) 0%, var(--cream-dim) 100%);
  border: 1px solid #1a1a1a;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

input[type="range"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.slider-track-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #444444; /* Dark grey for visibility on light grey cards */
  margin-top: 4px;
  padding: 0 2px;
}

/* Radio Select Cards */
.inline-row {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.radio-selector {
  display: flex;
  gap: 6px;
  background-color: #1a1a1a; /* Dark inset bezel */
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.radio-option {
  cursor: pointer;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-card {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: bold;
  padding: 6px 14px;
  border-radius: 4px;
  color: #888888; /* Frosted look when off */
  background: rgba(255, 255, 255, 0.15); /* Translucent cap */
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.radio-option:hover .radio-card {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.radio-option input[type="radio"]:checked + .radio-card {
  background: linear-gradient(180deg, #ffb03a 0%, #e67e00 100%); /* Lit Amber Acrylic */
  color: #000000; /* Black text */
  border-color: #ff9c1a;
  box-shadow: 
    0 0 12px rgba(255, 140, 0, 0.85), /* Warm Bloom */
    inset 0 1.5px 2px rgba(255, 255, 255, 0.5); /* Inner light glow */
}

.radio-option input[type="radio"]:disabled + .radio-card {
  opacity: 0.15;
  background: rgba(255, 255, 255, 0.05);
  color: #555555;
  border-color: transparent;
  box-shadow: none;
  cursor: not-allowed;
}

/* Extensibility indicator */
.extensibility-rack {
  margin-top: 15px;
  background-color: #121314;
  border: 1px dashed #3e4145;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.rack-slot {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.slot-status {
  color: #555;
  font-weight: bold;
}

/* Momentary Big Red Button Footer */
.radio-footer {
  display: flex;
  justify-content: center;
  padding-top: 10px;
  border-top: 2px solid var(--border-color);
}

/* 3D Spring-Loaded Red Button */
.blink-btn {
  position: relative;
  background: #a8a6a1; /* matching border color for light theme */
  border: 4px solid #8b1b0e; /* red chassis housing outline */
  border-radius: 50px;
  padding: 0;
  cursor: pointer;
  outline: none;
  width: 320px;
  height: 52px;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0,0,0,0.3);
  transition: filter 250ms;
}

.blink-btn-cap {
  display: block;
  position: absolute;
  top: -4px;
  left: -2px;
  right: -2px;
  bottom: 0px;
  border-radius: 50px;
  background: linear-gradient(180deg, var(--panel-bg) 0%, #c4c2be 100%);
  box-shadow: 
    inset 0 1px 2px rgba(255,255,255,0.6),
    0 3px 0 #a8a6a1;
  transition: transform 100ms;
}

.blink-btn-text {
  display: block;
  position: relative;
  z-index: 10;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 1px;
  color: #18191a; /* Dark text */
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  transform: translateY(-2px);
  transition: transform 100ms;
  user-select: none;
}

.blink-btn:hover {
  filter: brightness(1.1);
}

.blink-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(1) brightness(0.6);
}

/* Sinks down on press */
.blink-btn:active:not(:disabled) .blink-btn-cap {
  transform: translateY(2px);
  box-shadow: 
    inset 0 1px 2px rgba(255,255,255,0.2),
    0 1px 0 #a8a6a1;
}

.blink-btn:active:not(:disabled) .blink-btn-text {
  transform: translateY(0px);
}

/* Responsive adjustment */
@media (max-width: 1200px) {
  .dashboard-row {
    flex-direction: column-reverse; /* Put controls under screen on small displays */
  }
  .controls-column-group {
    min-width: 100%;
  }
  .visuals-column-group {
    min-width: 100%;
  }
  .radio-chassis {
    width: 100%;
    max-width: 95vw;
  }
}

@media (max-width: 768px) {
  .controls-column-group {
    flex-direction: column;
  }
}

/* Modal notice for tab audio muting */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--panel-bg);
  border: 3px solid var(--radio-orange);
  border-radius: 16px;
  width: 480px;
  max-width: 90%;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.2);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-header {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--radio-orange);
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 8px;
}

.modal-body {
  font-size: 0.85rem;
  color: #18191a; /* Legible black text */
  line-height: 1.6;
}

.modal-body ol {
  margin: 12px 0 12px 20px;
}

.modal-body li {
  margin-bottom: 6px;
}

.modal-subtext {
  font-size: 0.75rem;
  color: #4a4a4a; /* High contrast dark charcoal */
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
  margin-top: 10px;
}

#modal-close-btn {
  margin-top: 10px;
  width: 140px;
  align-self: center;
  background: linear-gradient(180deg, var(--cream-accent) 0%, var(--cream-dim) 100%);
  color: var(--bg-color);
  border-color: var(--cream-accent);
}

