/* ===== EventClock Production features (countdown, tally, cues, kiosk, DST, analog) ===== */

#prod-tally-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 8px;
  pointer-events: none;
  transition: background 0.25s ease, height 0.25s ease;
}
#prod-tally-strip.state-off { background: transparent; height: 0; }
#prod-tally-strip.state-standby { background: #22c55e; box-shadow: 0 0 24px rgba(34, 197, 94, 0.55); }
#prod-tally-strip.state-onair {
  background: #ef4444;
  height: 12px;
  box-shadow: 0 0 32px rgba(239, 68, 68, 0.7);
  animation: tally-pulse 1s ease-in-out infinite;
}
@keyframes tally-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

#prod-tally-badge {
  position: fixed;
  top: calc(var(--app-header-h, 72px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 91;
  font-family: 'FranceTVBrownTT-Regular', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: clamp(14px, 2vw, 22px);
  padding: 6px 18px;
  border-radius: 4px;
  pointer-events: none;
  display: none;
}
#prod-tally-badge.visible { display: block; }
#prod-tally-badge.state-standby {
  color: #052e16;
  background: rgba(34, 197, 94, 0.92);
}
#prod-tally-badge.state-onair {
  color: #fff;
  background: rgba(239, 68, 68, 0.95);
}

#prod-countdown-panel {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 88;
  min-width: min(320px, 92vw);
  max-width: 420px;
  background: rgba(10, 12, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 16px 12px;
  color: #fff;
  font-family: 'FranceTVBrownTT-Regular', system-ui, sans-serif;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
#prod-countdown-panel.visible { display: block; }
#prod-countdown-panel.fullscreen-mode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10040 !important;
  background: rgba(0, 0, 0, 0.94);
}
#prod-countdown-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}
#prod-countdown-name {
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 700;
  margin-bottom: 8px;
}
#prod-countdown-value {
  font-variant-numeric: tabular-nums;
  font-size: clamp(36px, 7vw, 72px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
}
#prod-countdown-panel.standby #prod-countdown-value { color: #4ade80; }
#prod-countdown-panel.onair #prod-countdown-value { color: #f87171; }
#prod-countdown-panel.overdue #prod-countdown-value { color: #fbbf24; }
#prod-countdown-meta {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.65;
}

#prod-cues-rail {
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 87;
  display: none;
  flex-direction: column;
  gap: 6px;
  max-width: min(280px, 80vw);
  max-height: 40vh;
  overflow: auto;
}
#prod-cues-rail.visible { display: flex; }
.prod-cue-chip {
  background: rgba(20, 24, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: #eee;
  font-size: 12px;
  font-family: 'FranceTVBrownTT-Regular', system-ui, sans-serif;
}
.prod-cue-chip.fired {
  opacity: 0.45;
  transform: scale(0.96);
}
.prod-cue-chip .cue-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}
.prod-cue-chip.active .cue-time { color: #67e8f9; }
.prod-cue-chip.standby .cue-time { color: #4ade80; }
.prod-cue-chip.onair .cue-time { color: #f87171; }

#prod-stopwatch-panel {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 87;
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(10, 12, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 14px;
  color: #fff;
  font-family: 'FranceTVBrownTT-Regular', system-ui, sans-serif;
  backdrop-filter: blur(8px);
}
#prod-stopwatch-panel.visible { display: flex; }
#prod-stopwatch-value {
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  min-width: 110px;
  text-align: center;
}
#prod-stopwatch-panel button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}

#prod-dst-banner {
  position: fixed;
  top: calc(var(--app-header-h, 72px) + 18px);
  left: max(12px, env(safe-area-inset-left));
  z-index: 86;
  max-width: min(420px, 90vw);
  background: rgba(120, 53, 15, 0.92);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fff7ed;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: 'FranceTVBrownTT-Regular', system-ui, sans-serif;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
#prod-dst-banner.visible { display: block; }
#prod-dst-banner button {
  margin-left: 8px;
  background: transparent;
  border: none;
  color: #fde68a;
  cursor: pointer;
  font-size: 14px;
}

/* Analog overlays inside clock columns */
.clock-svg-third { position: relative; }
.prod-analog-face {
  position: absolute;
  inset: 8%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.95;
}
.prod-analog-face.hidden { display: none !important; }
body.prod-analog-only .clock-svg-third > svg:not(.prod-analog-face) {
  opacity: 0.08;
}

/* Kiosk / display / locked modes */
body.prod-kiosk #app-controls,
body.prod-display #app-controls,
body.prod-kiosk #settings-btn,
body.prod-display #settings-popup,
body.prod-display #settings-overlay,
body.prod-display #info-btn,
body.prod-display #stats-btn,
body.prod-display #devlog-btn {
  display: none !important;
}
body.prod-kiosk,
body.prod-display {
  cursor: none;
}
body.prod-kiosk.prod-show-cursor,
body.prod-display.prod-show-cursor {
  cursor: auto;
}

@media (max-width: 768px) {
  #prod-countdown-panel {
    left: 8px;
    right: 8px;
    min-width: 0;
    max-width: none;
  }
  #prod-cues-rail {
    max-height: 28vh;
  }
}
