/* RT History – Frontend v1.2.3
   Kompatibel mit OnAir2 Theme
   ------------------------------------------------------------------ */

/* ── Wrapper ─────────────────────────────────────────────────────── */
.rt-hist-wrap {
    overflow-x: auto;
    margin: 0 0 24px;
    font-family: inherit;
}

/* Weisser Hintergrund für den gesamten Shortcode-Bereich */
.rt-hist-search-wrap {
    background: #fff !important;
    padding: 24px 28px 28px !important;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Weisser Hintergrund für den gesamten Inhaltsbereich (Status + Nav + Tabelle) */
.rt-hist-search-wrap .rt-hist-search-status,
.rt-hist-search-wrap .rt-hist-pagination,
.rt-hist-search-wrap .rt-hist-search-results,
.rt-hist-search-wrap .rt-hist-wrap {
    background: #fff;
}
.rt-hist-search-wrap .rt-hist-search-results {
    background: #fff;
    padding: 0;
}

/* Optionaler Titel */
.rt-hist-heading {
    font-size: 1.1em !important;
    font-weight: 700 !important;
    margin: 0 0 14px !important;
    padding-bottom: 10px !important;
    border-bottom: 3px solid #c0392b !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #1a1f2e !important;
}

/* ── Tabelle ─────────────────────────────────────────────────────── */
.rt-hist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95em;
}

/* Kopfzeile: dunkler Hintergrund wie im Katalog */
.rt-hist-table thead tr {
    background: #1a1f2e;
}
.rt-hist-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: .78em;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #ffffff;
    white-space: nowrap;
    border: none;
}

/* Datenzeilen */
.rt-hist-table tbody tr {
    border-bottom: 1px solid #ebebeb;
    transition: background .15s;
}
.rt-hist-table tbody tr:last-child { border-bottom: none; }
.rt-hist-table tbody tr:hover { background: #f8f8f8; }

.rt-hist-table tbody td {
    padding: 13px 16px;
    vertical-align: middle;
    color: #2c2c2c;
    border: none;
}

/* Spalten-spezifisch */
.rt-hist-col-time {
    white-space: nowrap;
    width: 52px;
    min-width: 52px;
    font-variant-numeric: tabular-nums;
    color: #888;
    font-size: .88em;
}
.rt-hist-col-channel {
    white-space: nowrap;
    width: 120px;
    min-width: 80px;
}
.rt-hist-col-artist {
    font-weight: 600;
    color: #1a1f2e;
    min-width: 120px;
    max-width: 200px;
}
.rt-hist-col-title {
    color: #2c2c2c;
    min-width: 100px;
    max-width: 180px;
}
.rt-hist-col-composer {
    color: #555;
    font-size: .88em;
    min-width: 80px;
    max-width: 150px;
}
.rt-hist-col-album {
    color: #555;
    font-size: .88em;
    min-width: 80px;
    max-width: 140px;
}
.rt-hist-col-label {
    color: #555;
    font-size: .88em;
    min-width: 60px;
    max-width: 120px;
    white-space: nowrap;
}
.rt-hist-col-genre {
    color: #888;
    font-size: .88em;
    min-width: 80px;
}
/* Text-Overflow für lange Texte */
.rt-hist-col-artist,
.rt-hist-col-title,
.rt-hist-col-composer,
.rt-hist-col-album {
    overflow: hidden;
}

/* Kanal-Badge */
.rt-hist-channel-badge {
    display: inline-block;
    background: #1a1f2e;
    color: #fff;
    border-radius: 3px;
    padding: 2px 9px;
    font-size: .78em;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Genre-Tags */
.rt-hist-genre-tag {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    border-radius: 3px;
    padding: 2px 7px;
    font-size: .8em;
    margin-right: 3px;
}
/* Haupt-Genre (Volksmusik, Blasmusik) */
.rt-hist-genre-primary {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.rt-hist-muted { color: #bbb; }
.rt-hist-empty {
    color: #999;
    font-style: italic;
    padding: 16px 0;
}

/* ── Suchformular ────────────────────────────────────────────────── */
.rt-hist-search-wrap { margin: 0 0 24px; }
.rt-hist-search-form { margin-bottom: 12px; }

/* Labels-Zeile */
.rt-hist-form-labels {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-orient: horizontal !important;
    -webkit-box-direction: normal !important;
    -ms-flex-direction: row !important;
    flex-direction: row !important;
    gap: 10px;
    margin-bottom: 5px;
    align-items: flex-end;
}
.rt-hist-form-labels span {
    display: block !important;
    flex: 1 1 0 !important;
    font-size: .72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #6b7280;
    min-width: 0;
}
.rt-hist-form-labels span:first-child { flex: 1.4 1 0 !important; }
.rt-hist-form-labels span:last-child  { flex: 0 0 100px !important; }

/* Input-Zeile — !important gegen Theme-Overrides */
.rt-hist-form-inputs {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-orient: horizontal !important;
    -webkit-box-direction: normal !important;
    -ms-flex-direction: row !important;
    flex-direction: row !important;
    -webkit-box-align: stretch !important;
    -ms-flex-align: stretch !important;
    align-items: stretch !important;
    gap: 10px;
    width: 100%;
}

.rt-hist-form-inputs input[type="date"],
.rt-hist-form-inputs input[type="time"],
.rt-hist-form-inputs select {
    display: block !important;
    -webkit-box-flex: 1 !important;
    -ms-flex: 1 1 0 !important;
    flex: 1 1 0 !important;
    width: auto !important;   /* !important gegen Theme width:100% */
    min-width: 0 !important;
    padding: 0 10px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 6px !important;
    font-size: .95em !important;
    font-weight: 600 !important;
    background: #fff !important;
    color: #1a1f2e !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    height: 44px !important;
    margin: 0 !important;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s;
}
.rt-hist-form-inputs input[type="date"] { flex: 1.4 1 0 !important; }

.rt-hist-form-inputs input:focus,
.rt-hist-form-inputs select:focus {
    border-color: #c0392b !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(192,57,43,.15) !important;
}

.rt-hist-btn-search {
    display: block !important;
    -webkit-box-flex: 0 !important;
    -ms-flex: 0 0 100px !important;
    flex: 0 0 100px !important;
    width: 100px !important;
    height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #c0392b !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: .8em !important;
    font-weight: 700 !important;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer !important;
    font-family: inherit !important;
    white-space: nowrap;
    transition: background .15s;
    box-sizing: border-box !important;
    line-height: 44px !important;
    text-align: center;
}
.rt-hist-btn-search:hover { background: #a93226 !important; }

/* Status-Zeile */
.rt-hist-search-status {
    margin-bottom: 12px;
    font-size: .88em;
    color: #888;
    min-height: 1.5em;
}
.rt-hist-loading      { color: #aaa; }
.rt-hist-result-count { font-weight: 700; color: #1a1f2e; }

/* ── Responsive ──────────────────────────────────────────────────── */

/* Tablet (≤ 960px): Album ausblenden */
@media ( max-width: 960px ) {
    .rt-hist-col-album   { display: none !important; }
}

/* Tablet (≤ 760px): Genre + Album weg */
@media ( max-width: 760px ) {
    .rt-hist-col-genre   { display: none !important; }
}

/* Mobil (≤ 600px): nur Zeit + Künstler + Titel + Wünschen
   Composer, Label, Album, Genre, Channel alle weg */
@media ( max-width: 600px ) {
    .rt-hist-col-composer,
    .rt-hist-col-label,
    .rt-hist-col-album,
    .rt-hist-col-genre,
    .rt-hist-col-channel  { display: none !important; }

    .rt-hist-table thead th,
    .rt-hist-table tbody td { padding: 8px 6px !important; font-size: .88em !important; }

    /* Künstler + Titel: mehr Platz auf kleinen Screens */
    .rt-hist-col-artist { max-width: none !important; font-size: .9em !important; }
    .rt-hist-col-title  { max-width: none !important; font-size: .9em !important; }

    /* Wünschen: nur Stern, Text ausblenden */
    .rt-hist-wish-link span { display: none !important; }
    .rt-hist-col-wish   { width: 40px !important; min-width: 40px !important; text-align: center !important; }
}

/* ── Stunden-Navigation: reine Textlinks ─────────────────────────── */
/* Explizite Overrides gegen Theme-Stile (OnAir2 setzt border/bg auf nav/div) */
.rt-hist-pagination,
.rt-hist-pagination div,
.rt-hist-pagination nav {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
}

.rt-hist-page-nav {
    display: flex !important;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px !important;
    margin-top: 4px !important;
    font-size: .9em;
    flex-wrap: wrap;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.rt-hist-page-link {
    color: #c0392b;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: color .12s;
    cursor: pointer;
}
.rt-hist-page-link:hover { color: #a93226; text-decoration: underline; }

.rt-hist-page-disabled {
    color: #c8c8c8;
    font-weight: 400;
    white-space: nowrap;
    cursor: default;
}

/* Aktuelle Stunde mittig */
.rt-hist-page-current {
    font-weight: 700;
    color: #1a1f2e;
    font-size: 1em;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

@media ( max-width: 480px ) {
    .rt-hist-page-nav     { gap: 10px; font-size: .82em; }
    .rt-hist-page-current { font-size: .95em; }
}

/* Fehlermeldung */
.rt-hist-error {
    color: #b32d2e;
    font-size: .9em;
    font-weight: 600;
}

/* Leere Tabellenzeilen (Jingle, Moderation etc.) */
.rt-hist-row-empty td { opacity: .55; }
.rt-hist-row-empty-text {
    font-style: italic;
    color: #9ca3af;
    font-size: .88em;
    font-weight: 400;
}



/* ── Schnellwahl-Chips unter dem Formular ────────────────────────── */
.rt-hist-quick-times {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.rt-hist-quick-chip {
    display: inline-block !important;
    padding: 4px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 20px !important;
    font-size: .78em;
    font-weight: 600;
    color: #555 !important;
    background: #f8f8f8 !important;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    font-family: inherit;
    white-space: nowrap;
    user-select: none;
    margin: 0;
    line-height: 1.6;
    box-sizing: border-box;
}
.rt-hist-quick-chip:hover,
.rt-hist-quick-chip.rt-hist-chip-active {
    background: #1a1f2e;
    border-color: #1a1f2e;
    color: #fff;
}

/* ── Wünschen-Spalte ─────────────────────────────────────────────── */
.rt-hist-col-wish {
    width: 100px;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}
/* Wish-Link: Inline-Styles im JS sind primär, CSS als Fallback */
.rt-hist-wish-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px;
    color: #c0392b;
    text-decoration: none !important;
    font-size: .85em;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
}
.rt-hist-wish-link:hover { color: #a93226; }

/* Stern: Theme darf SVG-Grösse NICHT überschreiben */
.rt-hist-wish-link svg,
.rt-hist-wish-link svg[width="16"] {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0;
    display: inline-block !important;
    vertical-align: middle;
}
.rt-hist-wish-link .wish-star {
    fill: none;
    stroke: #c0392b;
    stroke-width: 2;
    stroke-linejoin: round;
    transition: fill .15s;
}
.rt-hist-wish-link:hover .wish-star {
    fill: #c0392b;
}
/* Leere Zeilen: kein Link */
.rt-hist-row-empty .rt-hist-wish-link { display: none !important; }

/* ── RTF Künstler-Links ───────────────────────────────────────────── */
.rt-hist-artist-link {
    text-decoration: none;
    font-weight: inherit;
    transition: color .12s;
}
/* Formation: Radio Tell Rot */
.rt-hist-link-formation {
    color: #c0392b;
}
.rt-hist-link-formation:hover {
    color: #a93226;
    text-decoration: underline;
}
/* Person: dezentes Dunkelblau */
.rt-hist-link-person {
    color: #2563a8;
}
.rt-hist-link-person:hover {
    color: #1a4a80;
    text-decoration: underline;
}

/* ── Album-Cover-Spalte ───────────────────────────────────────────── */
.rt-hist-table th.rt-hist-col-cover,
.rt-hist-table td.rt-hist-col-cover {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    padding: 4px 4px !important;
    text-align: center !important;
    vertical-align: middle !important;
}
/* Popup nicht abschneiden */
.rt-hist-table td.rt-hist-col-cover {
    overflow: visible !important;
}
/* Sicherstellen dass die Tabelle selbst overflow:visible hat */
.rt-hist-wrap,
.rt-hist-table {
    overflow: visible !important;
}

/* ═══════════════════════════════════════════════════════════════════
   RT SHOW BANNER  [rt_show_banner]  — Hell, Skin-Akzent
   ═══════════════════════════════════════════════════════════════════ */
.rt-show-banner {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border: 1px solid rgba(0,0,0,0.08);
}

.rt-show-banner__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #f0eeea;
  filter: blur(24px) brightness(1.05) saturate(0.7) opacity(0.25);
  transform: scale(1.1);
}

.rt-show-banner__accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--rt-skin, #C0272D);
  z-index: 2;
}

.rt-show-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.60);
  z-index: 1;
  pointer-events: none;
}

.rt-show-banner__content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px 24px;
  gap: 18px;
  z-index: 3;
}

.rt-show-banner__thumb {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,0.10);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.rt-show-banner__thumb--empty {
  background: rgba(0,0,0,0.06);
  display: block;
}

.rt-show-banner__meta {
  flex: 1;
  min-width: 0;
}

.rt-show-banner .rt-show-banner__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.rt-show-banner .rt-show-banner__live {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #C0272D !important;
}

.rt-show-banner .rt-show-banner__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C0272D;
  animation: rt-show-dot 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

.rt-show-banner .rt-show-banner__type {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--rt-skin, #C0272D) 12%, transparent);
  color: color-mix(in srgb, var(--rt-skin, #C0272D) 85%, #000);
  border: 1px solid color-mix(in srgb, var(--rt-skin, #C0272D) 35%, transparent);
}

.rt-show-banner .rt-show-banner__title {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  line-height: 1.2 !important;
  margin: 0 0 5px 0 !important;
  padding: 0 !important;
  border: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.rt-show-banner .rt-show-banner__desc {
  font-size: 13px !important;
  color: #555555 !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 600px) {
  .rt-show-banner__content { padding: 16px; gap: 14px; }
  .rt-show-banner__thumb { width: 68px; height: 68px; }
  .rt-show-banner .rt-show-banner__title { font-size: 17px !important; }
  .rt-show-banner .rt-show-banner__desc { -webkit-line-clamp: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   RT SHOW WIDGET  [rt_show_widget]  — Hell, Skin-Akzent
   ═══════════════════════════════════════════════════════════════════ */
.rt-show-widget {
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border: 1px solid rgba(0,0,0,0.08);
  position: relative;
}

.rt-show-widget__img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  object-position: center top;
}

.rt-show-widget__img--empty {
  height: 120px;
  background: #f0eeea;
}

.rt-show-widget__accent {
  height: 3px;
  background: var(--rt-skin, #C0272D);
}

.rt-show-widget__body {
  padding: 10px 14px 14px;
  background: #ffffff;
}

.rt-show-widget__live {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #C0272D !important;
  margin-bottom: 4px;
}

.rt-show-widget__title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  line-height: 1.25 !important;
  margin: 0 0 4px 0 !important;
  padding: 0 !important;
  border: none !important;
}

.rt-show-widget__desc {
  font-size: 12px !important;
  color: #666666 !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}

@keyframes rt-show-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.5); }
}

@supports not (background: color-mix(in srgb, red 20%, transparent)) {
  .rt-show-banner .rt-show-banner__type {
    background: rgba(192,39,45,0.10);
    color: #9a1f24;
    border-color: rgba(192,39,45,0.25);
  }
}
