/* =============================================================================
   TREFFPUNKT INFOSCREEN — Radio-Player (Drawer + FAB + Mini-Bar)
   ============================================================================
   Wird sowohl vom Display (app/index.html) als auch von der Landing
   (treffpunkt-infoscreen.de/index.html) eingebunden — gleicher Code, eine
   Quelle der Wahrheit.

   Eigene CSS-Variablen mit Fallbacks: macht den Player robust gegen
   unterschiedlich benannte Brand-Variablen in den beiden Host-Seiten.
   ============================================================================ */

.radio-fab,
.radio-drawer,
.radio-minibar,
.radio-pause-hint {
  /* Radio-spezifische Variablen mit Fallbacks für unterschiedliche Hosts */
  --radio-accent:      var(--accent, #e63946);
  --radio-accent-dark: var(--accent-warm, var(--accent-dark, #c5283d));
  --radio-text:        var(--text, #1f3a2d);
  --radio-text-mute:   var(--text-mute, #88a092);
  --radio-bg:          #ffffff;
  --radio-bg-soft:     var(--bg-mid, var(--bg-alt, #f4f8f5));
  --radio-bg-item:     var(--bg-card, #e8efe9);
  --radio-border:      rgba(0, 0, 0, 0.06);
  --radio-dark-bg:     rgba(31, 58, 45, 0.96);
  position: fixed;
  z-index: 10000;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
}

/* Floating-Action-Button unten rechts */
.radio-fab {
  bottom: 18px;
  right: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--radio-accent);
  color: #fff;
  border: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.28);
  font-size: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  padding: 0;
}
.radio-fab:hover  { transform: scale(1.06); background: var(--radio-accent-dark); }
.radio-fab:active { transform: scale(0.96); }
.radio-fab.hidden { display: none; }

/* Drawer */
.radio-drawer {
  left: 0; right: 0; bottom: 0;
  max-height: 70vh;
  background: var(--radio-bg);
  color: var(--radio-text);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 32px rgba(0,0,0,0.18);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.radio-drawer.open { transform: translateY(0); }

.radio-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--radio-border);
  background: var(--radio-bg-soft);
}
.radio-drawer-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--radio-text);
  letter-spacing: -0.2px;
}
.radio-drawer-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  color: var(--radio-text-mute);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.radio-tabs {
  display: flex;
  padding: 0 18px;
  border-bottom: 1px solid var(--radio-border);
  background: var(--radio-bg);
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Scrollbar auf schmalen Geräten dezent */
  scrollbar-width: thin;
}
.radio-tabs::-webkit-scrollbar { height: 2px; }
.radio-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--radio-text-mute);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.radio-tab.active {
  color: var(--radio-accent);
  border-bottom-color: var(--radio-accent);
}
.radio-tab-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,0.08);
  color: var(--radio-text-mute);
  font-size: 11px;
  font-weight: 700;
}

.radio-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
  background: var(--radio-bg);
}
.radio-list-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--radio-text-mute);
  font-size: 14px;
  font-weight: 400;
}
.radio-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.radio-item:hover     { background: var(--radio-bg-soft); }
.radio-item.playing   { background: rgba(230, 57, 70, 0.06); }
.radio-item-cover {
  width: 46px; height: 46px;
  border-radius: 8px;
  background: var(--radio-bg-item);
  object-fit: cover;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 20px;
  color: var(--radio-text-mute);
}
.radio-item-meta { flex: 1; min-width: 0; }
.radio-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--radio-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.radio-item-sub {
  font-size: 12px;
  color: var(--radio-text-mute);
  margin-top: 2px;
}
.radio-item-icon {
  font-size: 18px;
  color: var(--radio-text-mute);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.radio-item.playing .radio-item-icon { color: var(--radio-accent); }

/* Mini-Bar (bleibt unten wenn Drawer minimiert + Track läuft) */
.radio-minibar {
  left: 12px; right: 12px; bottom: 12px;
  background: var(--radio-dark-bg);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.radio-minibar.visible { display: flex; }
.radio-minibar-cover {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  display: grid; place-items: center;
  font-size: 18px;
}
.radio-minibar-meta { flex: 1; min-width: 0; cursor: pointer; }
.radio-minibar-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.radio-minibar-sub {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 1px;
}
.radio-minibar-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: background 0.15s;
  padding: 0;
}
.radio-minibar-btn:hover { background: rgba(255,255,255,0.12); }

/* External-Bar: Links zu externen Web-Streams (z.B. Volksmusikradio).
   Bewusst NICHT als iframe — nur Link in neuem Tab. Steht im Drawer-Footer,
   dezent abgesetzt damit klar ist: das ist "raus aus unserer App". */
.radio-ext-bar {
  border-top: 1px solid var(--radio-border);
  background: var(--radio-bg-soft);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 100px;
  overflow-y: auto;
}
.radio-ext-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--radio-text);
  font-size: 13px;
  transition: background 0.12s;
}
.radio-ext-link:hover { background: rgba(0,0,0,0.05); }
.radio-ext-icon {
  width: 18px;
  text-align: center;
  color: var(--radio-accent);
  font-weight: 700;
}
.radio-ext-label { flex: 1; font-weight: 600; }
.radio-ext-host {
  color: var(--radio-text-mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Lizenz-Zeile am Drawer-Fuß — bewusst sehr klein, aber sichtbar.
   Doppelfunktion: GEMA-Transparenz nach außen + Vertrauen beim Gast,
   dass keine Schwarz-Pirate-Musik läuft. */
.radio-license {
  border-top: 1px solid var(--radio-border);
  padding: 8px 18px;
  font-size: 11px;
  color: var(--radio-text-mute);
  text-align: center;
  background: var(--radio-bg);
}
.radio-license a {
  color: var(--radio-text-mute);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.radio-license a:hover { color: var(--radio-accent); }

/* Video-Pause-Hinweis: wenn Werbespot Audio übernimmt */
.radio-pause-hint {
  bottom: 86px; right: 18px;
  background: rgba(31, 58, 45, 0.92);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 9999;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.radio-pause-hint.visible { display: block; }
