/**
 * Family Radio - Streaming Radio Player Styles
 */

{% scope_css %}

/* ========================================
   FEATURE FLAGS
   ======================================== */

/* Up Next on desktop: flex = show, none = hide */
.radio-bar__up-next { display: flex; }

/* ========================================
   Radio Bar Container
   ======================================== */

.radio-bar {
  --radio-primary: #66d8ff;
  --radio-primary-hover: #4dc9ff;
  --radio-bg: #242021;
  --radio-bg-light: #2d2829;
  --radio-text: #ffffff;
  --radio-text-muted: #868686;
  --radio-border: #3a3536;
  --radio-hover: rgba(102, 216, 255, 0.1);
  --radio-active: rgba(102, 216, 255, 0.2);
  --radio-shadow: rgba(0, 0, 0, 0.3);

  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  padding: 1.25rem 1.5rem;
  background: linear-gradient(to bottom, #2d2829 0%, #242021 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 2px solid var(--radio-border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);

  min-height: 96px;
  color: var(--radio-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ========================================
   Left Group — Now Playing + Up Next
   ======================================== */

.radio-bar__left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.radio-bar__now-playing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-shrink: 0;
}

.radio-bar__artwork {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--radio-border);
  flex-shrink: 0;
}

.radio-bar__info {
  flex: 1;
  min-width: 0;
}

.radio-bar__label {
  margin: 0 0 0.25rem 0;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--radio-primary);
}

.radio-bar__title {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--radio-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radio-bar__artist {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--radio-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================
   Up Next
   ======================================== */

.radio-bar__up-next {
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.radio-bar__caret-left {
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.radio-bar__next-artwork {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  opacity: 0.6;
  flex-shrink: 0;
}

.radio-bar__next-content {
  flex: 1;
  min-width: 0;
}

.radio-bar__next-info {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--radio-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   Center Controls
   ======================================== */

.radio-bar__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-shrink: 0;
}

.radio-bar__play,
.radio-bar__expand,
.radio-bar__volume {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: var(--radio-hover);
  color: var(--radio-text);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

.radio-bar__play svg,
.radio-bar__expand svg,
.radio-bar__volume svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  pointer-events: none;
}

.radio-bar__play {
  width: 64px;
  height: 64px;
  background: var(--radio-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(102, 216, 255, 0.3);
}

.radio-bar__play svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}

.radio-bar__play:hover {
  background: var(--radio-primary-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(102, 216, 255, 0.4);
}

.radio-bar__expand:hover,
.radio-bar__volume:hover {
  background: var(--radio-active);
}

.radio-bar__play:active,
.radio-bar__expand:active,
.radio-bar__volume:active {
  transform: scale(0.95);
}

.radio-bar__volume-container {
  position: relative;
}

.radio-bar__volume-container::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.radio-bar__volume-dropdown {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  display: none;
  padding: 1rem 0.75rem;
  background: var(--radio-bg);
  border: 1px solid var(--radio-border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.radio-bar__volume-container:hover .radio-bar__volume-dropdown {
  display: block;
}

.radio-bar__volume-slider-container {
  height: 120px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-bar__volume-slider {
  width: 110px;
  height: 4px;
  transform: rotate(-90deg);
  -webkit-appearance: none;
  appearance: none;
  background: var(--radio-hover);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.radio-bar__volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--radio-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.radio-bar__volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

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

/* ========================================
   Right Column — Station Selector + Close
   ======================================== */

.radio-bar__right {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 1;
}

.radio-bar__minimize {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(102, 216, 255, 0.15);
  border: 1px solid rgba(102, 216, 255, 0.35);
  color: var(--radio-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.radio-bar__minimize:hover {
  background: rgba(102, 216, 255, 0.25);
  border-color: rgba(102, 216, 255, 0.6);
  color: #fff;
}

.radio-bar__minimize svg {
  flex-shrink: 0;
}

/* ========================================
   Station Selector
   ======================================== */

.radio-bar__station-selector {
  position: relative;
  flex-shrink: 0;
}

.radio-bar__station-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 9999px;
  background: var(--radio-hover);
  color: var(--radio-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.radio-bar__station-button:hover {
  background: var(--radio-active);
}

.radio-bar__station-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--radio-border);
}

.radio-bar__dropdown-icon {
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.radio-bar__dropdown {
  position: absolute;
  bottom: 100%;
  right: 1.5rem;
  margin-bottom: 0.5rem;
  display: none;
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--radio-bg);
  border: 1px solid var(--radio-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.radio-bar__dropdown.open {
  display: block;
}

.radio-bar__station-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.radio-bar__station-item {
  margin: 0;
  padding: 0;
}

.radio-bar__station-item-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--radio-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.radio-bar__station-item-button:hover {
  background: var(--radio-hover);
}

.radio-bar__station-item-button.active {
  background: var(--radio-active);
  font-weight: 700;
}

.radio-bar__station-item-button img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* ========================================
   Mobile Station Chevron
   ======================================== */

.radio-bar__station-chevron {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--radio-hover);
  color: var(--radio-text);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.radio-bar__station-chevron:hover {
  background: var(--radio-active);
}

/* ========================================
   Restore / Listen Live Tab
   ======================================== */

.radio-bar__restore {
  position: fixed;
  bottom: 0;
  right: 24px;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  border: none;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(to bottom, #2d2829 0%, #242021 100%);
  border-top: 2px solid #3a3536;
  border-left: 1px solid #3a3536;
  border-right: 1px solid #3a3536;
  color: #66d8ff;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

.radio-bar__restore:hover {
  background: #2d2829;
}

.radio-bar__restore svg {
  flex-shrink: 0;
  fill: #66d8ff;
}

/* ========================================
   Loading Indicator
   ======================================== */

.radio-bar__loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(36, 32, 33, 0.9);
  border-radius: 8px;
  pointer-events: none;
}

.radio-bar__spinner {
  color: var(--radio-primary);
}

/* ========================================
   Responsive — Tablet + Mobile (max 1024px)
   ======================================== */

@media (max-width: 1024px) {
  .radio-bar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.5rem 0.5rem;
    padding: 0.75rem 1rem;
    min-height: auto;
  }
  .radio-bar__up-next {
    display: none;
  }
  .radio-bar__left {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    gap: 0;
  }
  .radio-bar__controls {
    grid-column: 2;
    grid-row: 1;
    gap: 0.5rem;
    justify-self: center;
  }
  .radio-bar__right {
    position: relative;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    flex: none;
    gap: 0.35rem;
  }
  .radio-bar__station-selector {
    display: none;
  }
  .radio-bar__station-chevron {
    display: flex;
  }
  .radio-bar__artwork {
    width: 48px;
    height: 48px;
  }
  .radio-bar__title { font-size: 0.875rem; }
  .radio-bar__artist { font-size: 0.75rem; }
  .radio-bar__play { width: 52px; height: 52px; }
  .radio-bar__volume { width: 40px; height: 40px; }
  .radio-bar__volume-dropdown {
    left: auto;
    right: 0;
    transform: none;
  }
}

/* ========================================
   Accessibility
   ======================================== */

button:focus-visible {
  outline: 2px solid var(--radio-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .radio-bar { border-top: 2px solid var(--radio-text); }
  .radio-bar__play { border: 2px solid var(--radio-bg); }
}

{% end_scope_css %}