/* ═══════════════════════════════════════════════════════════
   play.christradio.de — Stylesheet
   Design: Sacred Editorial (christradio.de Design-System)
   Palette: Midnight Blue · Warm Gold · Ivory · Cream
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300&family=Cormorant+SC:wght@400;600&display=swap');

/* ─── Custom Properties ─────────────────────────── */
:root {
  --midnight:   #0c1825;
  --deep:       #112233;
  --panel:      #162840;
  --gold:       #c8a84b;
  --gold-light: #dfc07a;
  --gold-dark:  #9a7a2e;
  --gold-dim:   rgba(200, 168, 75, 0.18);
  --cream:      #f4ede0;
  --ivory:      #faf6ef;
  --text:       #d8cfc3;
  --muted:      #7a8fa8;
  --border:     rgba(200, 168, 75, 0.22);
  --shadow:     0 12px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(200, 168, 75, 0.18);

  --r-sm: 4px;
  --r:    6px;
  --r-lg: 10px;

  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 300;
  background-color: var(--midnight);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.75;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 24px);
  overscroll-behavior: none;
}

/* Noise / Grain Overlay (wie christradio.de) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
}

/* ─── Header ─────────────────────────────────────── */
.app-header {
  background: rgba(12, 24, 37, 0.88);
  border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top, 12px) + 14px) clamp(1.5rem, 5vw, 3rem) 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-cross {
  font-size: 1.8rem;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 20px rgba(200, 168, 75, 0.5);
  flex-shrink: 0;
}

.app-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ivory);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.app-subtitle {
  font-family: 'Cormorant SC', serif;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ─── Main Layout ───────────────────────────────── */
.main-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── Now Playing Card ──────────────────────────── */
.now-playing-card {
  background: linear-gradient(145deg, var(--deep) 0%, var(--panel) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 28px 22px;
  box-shadow: var(--shadow), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

/* Goldener Top-Strich */
.now-playing-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}

/* Leuchten hinten */
.now-playing-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(200, 168, 75, 0.08) 0%, transparent 55%);
  pointer-events: none;
}

/* ─── Ornaments ─────────────────────────────────── */
.ornament {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

.ornament-diamond {
  color: var(--gold);
  font-size: 0.5rem;
  opacity: 0.7;
}

/* ─── Station Info ──────────────────────────────── */
.station-info {
  text-align: center;
  width: 100%;
}

.label-small {
  font-family: 'Cormorant SC', serif;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
  margin-bottom: 8px;
}

.station-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ivory);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.station-url {
  font-family: 'Crimson Pro', serif;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
  word-break: break-all;
  font-weight: 300;
}

/* ─── Visualizer ─────────────────────────────────── */
.visualizer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
  opacity: 0;
  transition: opacity var(--transition);
}

.visualizer.active {
  opacity: 1;
}

.bar {
  display: block;
  width: 5px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
  transform-origin: bottom;
  animation: none;
  height: 4px;
}

.visualizer.active .bar { animation: bounce 0.9s ease-in-out infinite; }
.visualizer.active .bar:nth-child(1) { animation-delay: 0s;    animation-duration: 0.85s; }
.visualizer.active .bar:nth-child(2) { animation-delay: 0.12s; animation-duration: 0.72s; }
.visualizer.active .bar:nth-child(3) { animation-delay: 0.24s; animation-duration: 0.95s; }
.visualizer.active .bar:nth-child(4) { animation-delay: 0.05s; animation-duration: 0.80s; }
.visualizer.active .bar:nth-child(5) { animation-delay: 0.30s; animation-duration: 1.00s; }
.visualizer.active .bar:nth-child(6) { animation-delay: 0.18s; animation-duration: 0.68s; }
.visualizer.active .bar:nth-child(7) { animation-delay: 0.36s; animation-duration: 0.90s; }

@keyframes bounce {
  0%, 100% { height: 4px; }
  50%       { height: 24px; }
}

/* ─── Transport Controls ────────────────────────── */
.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.btn-transport {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
  fill: currentColor;
}

.btn-transport:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
}

.btn-transport:active {
  transform: scale(0.92);
}

.btn-transport svg path {
  fill: currentColor;
}

.btn-play-pause {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: linear-gradient(145deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--midnight);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 22px rgba(200, 168, 75, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-play-pause:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 30px rgba(200, 168, 75, 0.6);
}

.btn-play-pause:active {
  transform: scale(0.96);
}

.btn-play-pause svg path {
  fill: var(--midnight);
}

.btn-play-pause .icon-loading {
  animation: spin 1s linear infinite;
  color: var(--midnight);
}

.btn-play-pause .icon-loading circle {
  stroke: var(--midnight);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hidden { display: none !important; }

/* ─── Volume ─────────────────────────────────────── */
.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 4px;
}

.vol-icon {
  fill: var(--muted);
  flex-shrink: 0;
}

.vol-icon path {
  fill: var(--muted);
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) var(--val, 80%), rgba(255,255,255,0.1) var(--val, 80%), rgba(255,255,255,0.1) 100%);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 2px 8px rgba(200, 168, 75, 0.5);
  cursor: pointer;
  transition: transform var(--transition);
}

.volume-slider::-webkit-slider-thumb:active {
  transform: scale(1.25);
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  cursor: pointer;
}

/* ─── Status Message ─────────────────────────────── */
.status-message {
  text-align: center;
  font-family: 'Cormorant SC', serif;
  font-size: 0.75rem;
  color: var(--gold);
  min-height: 1.2em;
  letter-spacing: 0.12em;
  font-weight: 400;
  transition: opacity var(--transition);
}

/* ─── Station List Section ──────────────────────── */
.station-list-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ivory);
  letter-spacing: -0.01em;
}

.btn-add {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.btn-add:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  transform: rotate(90deg);
}

.btn-add svg path {
  fill: currentColor;
}

/* ─── Station List Items ─────────────────────────── */
.station-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.station-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
}

/* Goldener Hover-Strich oben */
.station-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.station-item:hover {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--panel) 0%, rgba(22, 44, 70, 0.9) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.station-item:hover::before {
  opacity: 1;
}

.station-item:active {
  transform: scale(0.985) translateY(0);
}

.station-item.active {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(200, 168, 75, 0.2);
}

.station-item.active::before {
  opacity: 1;
}

.station-item-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: rgba(200, 168, 75, 0.08);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.station-item-icon svg path {
  fill: var(--gold);
}

.station-item-text {
  flex: 1;
  min-width: 0;
}

.station-item-name {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-item-url {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 300;
  margin-top: 2px;
  font-family: 'Crimson Pro', serif;
}

.station-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-icon-sm {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.btn-icon-sm:hover {
  color: var(--cream);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon-sm.delete:hover {
  color: #e07070;
  border-color: rgba(224, 112, 112, 0.35);
}

.btn-icon-sm svg path {
  fill: currentColor;
}

/* ─── Empty Hint ─────────────────────────────────── */
.empty-hint {
  text-align: center;
  color: var(--muted);
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  line-height: 1.65;
  padding: 24px 0;
  font-weight: 300;
  font-style: italic;
}

/* ─── Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 24, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 500;
  padding: 0 0 env(safe-area-inset-bottom, 0);
  animation: fadeIn 180ms ease-out;
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  background: linear-gradient(160deg, var(--deep) 0%, var(--panel) 100%);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 28px 28px 32px;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 -16px 56px rgba(0, 0, 0, 0.6);
  animation: slideUp 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

/* Goldener Top-Strich am Modal */
.modal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}

@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ivory);
  text-align: center;
  letter-spacing: -0.01em;
}

.form-label {
  font-family: 'Cormorant SC', serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: -8px;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  color: var(--cream);
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  resize: vertical;
}

.form-input::placeholder {
  color: var(--muted);
  font-weight: 300;
}

.form-input:focus {
  border-color: var(--gold);
  background: var(--gold-dim);
}

/* ─── URL Warning ───────────────────────────────── */
.url-warning {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: rgba(224, 112, 80, 0.1);
  border: 1px solid rgba(224, 112, 80, 0.35);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-family: 'Crimson Pro', serif;
  font-size: 0.88rem;
  color: #e8a090;
  line-height: 1.45;
  font-weight: 300;
  animation: fadeSlideIn 200ms ease-out;
}

.url-warning[hidden] { display: none !important; }

.url-warning svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.url-warning svg path { fill: #e8a090; }

.url-warning strong {
  color: #f0b8a8;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* ─── Buttons ────────────────────────────────────── */
.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  font-family: 'Cormorant SC', serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
  border: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--midnight);
  box-shadow: 0 4px 16px rgba(200, 168, 75, 0.35);
}

.btn-primary:hover {
  background: var(--gold-light);
  box-shadow: 0 6px 22px rgba(200, 168, 75, 0.55);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn-secondary:hover {
  border-color: rgba(200, 168, 75, 0.4);
  color: var(--cream);
  background: var(--gold-dim);
}

/* ─── PWA Install Banner ─────────────────────────── */
.install-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--deep) 0%, var(--panel) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  animation: fadeSlideIn 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.install-banner[hidden] { display: none !important; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.install-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--gold-dim);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.install-banner-icon svg path { fill: var(--gold); }

.install-banner-text {
  flex: 1;
  min-width: 0;
}

.install-banner-title {
  font-family: 'Crimson Pro', serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--cream);
  line-height: 1.2;
}

.install-banner-sub {
  font-family: 'Crimson Pro', serif;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 300;
}

.install-banner-sub strong {
  color: var(--gold);
  font-weight: 600;
}

.install-banner-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: none;
  background: var(--gold);
  color: var(--midnight);
  font-family: 'Cormorant SC', serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 10px rgba(200, 168, 75, 0.35);
}

.install-banner-btn:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(200, 168, 75, 0.5);
}

.install-banner-btn:active {
  transform: scale(0.96);
}

.install-banner-close {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.install-banner-close:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.06);
}

.install-banner-close svg path { fill: currentColor; }

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(200, 168, 75, 0.2); border-radius: 2px; }

/* ─── Focus Visible ──────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ─── Media Queries ──────────────────────────────── */
@media (min-width: 600px) {
  .now-playing-card { padding: 34px 36px 26px; }
  .modal-card {
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    margin-bottom: 48px;
  }
  .modal-overlay {
    align-items: center;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bar, .icon-loading, .btn-play-pause, .btn-add {
    animation: none !important;
    transition: none !important;
  }
}
