/* ============================================
   PROTO-TOWN BROADCAST — Desert Channel
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Warm desert tan palette */
  --bg-dark: #d4c4a8;
  --bg-medium: #c9b697;
  --bg-warm: #beaa90;
  --surface: #b8a286;
  --border: #a89274;
  --border-light: #c4b49e;

  /* Text */
  --text-primary: #2e1f1a;
  --text-secondary: #5a3d34;
  --text-muted: #8c6e64;
  --text-accent: #7a2e1a;

  /* Accents */
  --rust: #b8432a;
  --rust-glow: #d4503a;
  --green-live: #2d8a4e;
  --green-dim: #1a5c32;
  --amber: #b07830;
  --amber-glow: #c88a3a;

  /* Fonts */
  --font-mono: 'IBM Plex Mono', 'Courier Prime', 'Courier New', monospace;

  /* Sizing */
  --status-bar-h: 36px;
  --footer-h: 40px;
  --window-max-w: 860px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-mono);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  /* Full-bleed background image */
  background-image: url('../assets/images/joshua-3.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--amber-glow);
}

.hidden {
  display: none !important;
}

.separator {
  color: var(--text-muted);
  margin: 0 0.5rem;
}

/* --- Status Bar (top) --- */
.status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--status-bar-h);
  background: var(--bg-medium);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 100;
}

.status-left, .status-right {
  display: flex;
  align-items: center;
}

.station-id {
  color: var(--text-accent);
  font-weight: 700;
}

.status-label {
  color: var(--text-secondary);
}

/* Live indicator */
.stream-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--green-live);
  font-weight: 700;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-live);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--green-live); }
  50% { opacity: 0.4; box-shadow: none; }
}

.clock {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* --- Broadcast Container --- */
.broadcast-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--status-bar-h) + 1.5rem) 1rem calc(var(--footer-h) + 1.5rem);
}

/* --- Broadcast Window (stays dark for contrast) --- */
.broadcast-window {
  width: 100%;
  max-width: var(--window-max-w);
  background: #2a2420;
  border: 1px solid #3d342c;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.35),
    0 0 60px rgba(196, 93, 62, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Window title bar */
.window-title-bar {
  height: 32px;
  background: linear-gradient(180deg, #3d362e 0%, #352f28 100%);
  border-bottom: 1px solid #4a3f36;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
}



.window-title {
  font-size: 0.7rem;
  font-weight: 500;
  color: #b0a48e;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.window-controls-right {
  display: flex;
  align-items: center;
}

/* Signal bars */
.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.signal-bars .bar {
  width: 3px;
  background: #4ade80;
  border-radius: 1px;
}

.bar-1 { height: 3px; }
.bar-2 { height: 5px; }
.bar-3 { height: 8px; }
.bar-4 { height: 11px; }

/* --- Video Wrapper --- */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #0d0b0a;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* CRT Overlay — pointer-events: none lets clicks through to the iframe
   (needed for mobile/Safari where autoplay isn't supported) */
.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(10, 9, 8, 0.15) 100%
  );
  z-index: 2;
}

/* Scanlines */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  animation: scanline-scroll 8s linear infinite;
}

@keyframes scanline-scroll {
  0%   { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* Vignette */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.3);
}

/* --- Info Strip (below video) --- */
.info-strip {
  height: 28px;
  background: #1a1714;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.info-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rec-indicator {
  color: #c45d3e;
  font-weight: 700;
  animation: blink 1.2s step-end infinite;
}

.feed-label {
  color: #7a6d5e;
}

.date-display {
  color: #7a6d5e;
  font-variant-numeric: tabular-nums;
}


/* --- Radio Player Panel (compact single bar) --- */
.radio-panel {
  width: 100%;
  max-width: var(--window-max-w);
  margin-top: 0.75rem;
}

.radio-bar {
  height: 36px;
  background: #2a2420;
  border: 1px solid #3d342c;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.6rem;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.radio-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-icon {
  color: #d4a254;
  font-size: 0.75rem;
}

.radio-title-text {
  color: #b0a48e;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.radio-status {
  color: #7a6d5e;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  transition: color 0.3s;
}

.radio-panel.is-playing .radio-status {
  color: #d4a254;
}

/* Play button — retro beveled */
.radio-play-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 10px;
  background: #3a3228;
  border-radius: 2px;
  border-top: 1.5px solid #5a5048;
  border-left: 1.5px solid #5a5048;
  border-bottom: 1.5px solid #151210;
  border-right: 1.5px solid #151210;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #b0a48e;
  transition: color 0.2s;
  outline: none;
}

.radio-play-btn:hover {
  color: #d4a254;
}

.radio-play-btn:active {
  border-top-color: #151210;
  border-left-color: #151210;
  border-bottom-color: #5a5048;
  border-right-color: #5a5048;
}

.radio-panel.is-playing .radio-play-btn {
  color: #d4a254;
}

.radio-play-icon {
  font-size: 0.7rem;
  line-height: 1;
}

.radio-play-label {
  font-size: 0.55rem;
}

/* Volume slider */
.radio-volume-label {
  color: #7a6d5e;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.radio-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 3px;
  background: #3a3228;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.radio-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 1px;
  background: #7a6d5e;
  border-top: 1px solid #9a8e7e;
  border-left: 1px solid #9a8e7e;
  border-bottom: 1px solid #2a2420;
  border-right: 1px solid #2a2420;
  cursor: pointer;
}

.radio-volume::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 1px;
  background: #7a6d5e;
  border-top: 1px solid #9a8e7e;
  border-left: 1px solid #9a8e7e;
  border-bottom: 1px solid #2a2420;
  border-right: 1px solid #2a2420;
  cursor: pointer;
}

/* --- Footer --- */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
  background: var(--bg-medium);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 100;
}

.footer-left {
  display: flex;
  align-items: center;
}

.footer-coord {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --- Mobile Responsive --- */
@media (max-width: 640px) {
  :root {
    --status-bar-h: 32px;
    --footer-h: 36px;
  }

  html {
    font-size: 13px;
  }

  .status-label {
    display: none;
  }

  .broadcast-container {
    padding: calc(var(--status-bar-h) + 0.75rem) 0.5rem calc(var(--footer-h) + 0.75rem);
  }

  .broadcast-window {
    border-radius: 4px;
  }

  .window-title {
    font-size: 0.6rem;
  }

  .radio-panel {
    margin-top: 0.5rem;
  }

  .radio-bar {
    height: 32px;
  }

  .radio-status,
  .radio-title-text {
    display: none;
  }

  .footer-coord {
    display: none;
  }
}

@media (max-width: 380px) {
  .window-title {
    display: none;
  }

  .info-strip {
    font-size: 0.55rem;
  }
}

/* --- Thoughts Button & Modal --- */
.hero-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
  max-width: var(--window-max-w);
  margin-bottom: 0.75rem;
}

.thoughts-btn-hero {
  display: block;
  padding: 0.6rem 1.5rem;
  background: #2a2420;
  border: 1px solid #3d342c;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #b0a48e;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: color 0.2s, border-color 0.2s;
}

.thoughts-btn-hero:hover {
  color: #d4a254;
  border-color: #5a4d40;
}

.thoughts-btn-hero:active {
  box-shadow:
    0 1px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.thoughts-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-accent);
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}

.thoughts-btn:hover {
  color: var(--amber-glow);
}

.thoughts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.thoughts-window {
  width: 100%;
  max-width: 600px;
  background: #2a2420;
  border: 1px solid #3d342c;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.thoughts-title-bar {
  height: 32px;
  background: linear-gradient(180deg, #3d362e 0%, #352f28 100%);
  border-bottom: 1px solid #4a3f36;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
}

.thoughts-title {
  font-size: 0.7rem;
  font-weight: 500;
  color: #b0a48e;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.thoughts-close-btn {
  background: #4a4038;
  border-top: 1.5px solid #6b6058;
  border-left: 1.5px solid #6b6058;
  border-bottom: 1.5px solid #1a1612;
  border-right: 1.5px solid #1a1612;
  width: 18px;
  height: 18px;
  border-radius: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  color: #9a8e7e;
  cursor: pointer;
}

.thoughts-close-btn:active {
  border-top-color: #1a1612;
  border-left-color: #1a1612;
  border-bottom-color: #6b6058;
  border-right-color: #6b6058;
}

.thoughts-body {
  padding: 1.5rem;
  color: #b0a48e;
  font-size: 0.8rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
  max-height: 70vh;
  overflow-y: auto;
}

.thoughts-body p {
  margin-bottom: 1rem;
}

.thoughts-body p:last-child {
  margin-bottom: 0;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* --- Selection --- */
::selection {
  background: var(--rust);
  color: #fff;
}
