/**
 * Discover Classical Player Bar — Redesign
 * Companion to js/dc-player-bar.js
 *
 * Brand colors:
 *   Black  #242122
 *   Maroon #8C1B32
 *   Gold   #DAAC3D
 */

/* ============================================================
   Custom properties
   ============================================================ */
:root {
  --dc-gold: #DAAC3D;
  --dc-gold-dark: #C49A2E;
  --dc-crimson: #8C1B32;
  --dc-crimson-dark: #6E1528;
  --dc-cream: #F5EDDA;
  --dc-charcoal: #242122;
  --dc-player-height: 96px;
  --dc-button-size: 88px;
  --dc-bar-height: 20px;
  --dc-info-btn-size: 28px;
}

/* ============================================================
   Custom element host
   ============================================================ */
dc-player-bar {
  display: block;
  width: 100%;
  /* Use sticky positioning instead of fixed to prevent content overlap */
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--dc-cream);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--dc-charcoal);
}

/* ============================================================
   Gold bar (top edge)
   ============================================================ */
.dc-gold-bar {
  width: 100%;
  height: var(--dc-bar-height);
  background: var(--dc-gold);
}

/* ============================================================
   Inner layout — horizontal flex row
   ============================================================ */
.dc-bar-inner {
  display: flex;
  align-items: center;
  height: var(--dc-player-height);
  padding: 0 24px 0 16px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 16px;
  position: relative;
}

/* ============================================================
   Play / Pause button — large circular hit target
   ============================================================ */
.dc-play-wrap {
  position: relative;
  flex-shrink: 0;
  margin-top: -20px;
  z-index: 2;
}

.dc-btn-play-pause {
  position: relative;
  width: var(--dc-button-size);
  height: var(--dc-button-size);
  border-radius: 50%;
  border: 4px solid var(--dc-gold);
  outline: 5px solid var(--dc-cream);
  outline-offset: -1px;
  background: #ffffff;
  color: var(--dc-charcoal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  -webkit-tap-highlight-color: transparent;
}

.dc-btn-play-pause:hover {
  border-color: var(--dc-gold-dark);
  transform: scale(1.04);
}

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

/* Play icon — offset right for optical centering */
.dc-btn-play-pause .dc-icon-play {
  display: block;
  margin-left: 4px;
}

.dc-btn-play-pause .dc-icon-pause {
  display: none;
}

/* Swap icons when playing */
dc-player-bar.is-playing .dc-btn-play-pause .dc-icon-play {
  display: none;
}

dc-player-bar.is-playing .dc-btn-play-pause .dc-icon-pause {
  display: block;
}

/* ============================================================
   Info toggle — small circle on play button
   ============================================================ */
.dc-btn-info {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: var(--dc-info-btn-size);
  height: var(--dc-info-btn-size);
  border-radius: 50%;
  background: var(--dc-crimson);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  font-family: Georgia, serif;
  font-style: italic;
  transition: background-color 0.2s ease, transform 0.15s ease;
  z-index: 2;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.dc-btn-info:hover {
  background: var(--dc-crimson-dark);
  transform: scale(1.1);
}

.dc-btn-info .dc-icon-chevron {
  display: none;
}

dc-player-bar.panel-open .dc-btn-info .dc-icon-info-i {
  display: none;
}

dc-player-bar.panel-open .dc-btn-info .dc-icon-chevron {
  display: block;
}

/* ============================================================
   Content area — title + playlist link
   ============================================================ */
.dc-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
  gap: 8px;
}

.dc-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.3;
}

.dc-np-title {
  font-size: 18px;
  font-weight: normal;
  color: var(--dc-charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: opacity 0.3s ease;
}

.dc-playlist-link {
  font-family: Verdana, Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--dc-crimson);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.dc-playlist-link:hover {
  color: var(--dc-crimson-dark);
  text-decoration: underline;
}

/* ============================================================
   Donate button — right-aligned
   ============================================================ */
.dc-btn-donate {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--dc-crimson);
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 6px 18px;
  font-family: Verdana, Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.dc-btn-donate:hover {
  background: var(--dc-crimson-dark);
  transform: translateY(-1px);
}

.dc-btn-donate:active {
  transform: translateY(0);
}

/* ============================================================
   Details panel — collapsible, semi-transparent
   ============================================================ */
.dc-details-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  max-width: calc(100vw - 16px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease,
              padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9998;
  pointer-events: none;
}

dc-player-bar.panel-open .dc-details-panel {
  max-height: 400px;
  opacity: 1;
  padding: 20px;
  pointer-events: auto;
}

.dc-detail-item {
  margin-bottom: 12px;
}

.dc-detail-item:last-child {
  margin-bottom: 0;
}

.dc-detail-value {
  font-size: 15px;
  font-weight: normal;
  color: var(--dc-charcoal);
  line-height: 1.3;
}

.dc-detail-label {
  font-family: Verdana, Arial, sans-serif;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(36, 33, 34, 0.5);
  margin-top: 2px;
  line-height: 1.4;
}

/* ============================================================
   Overlay to close panel on outside click
   ============================================================ */
.dc-panel-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9997;
}

dc-player-bar.panel-open ~ .dc-panel-overlay {
  display: block;
}

/* ============================================================
   Responsive — narrow screens
   ============================================================ */
@media (max-width: 600px) {
  :root {
    --dc-player-height: 80px;
    --dc-button-size: 64px;
  }

  .dc-bar-inner {
    padding: 0 12px;
    gap: 12px;
  }

  .dc-np-title {
    font-size: 15px;
  }

  .dc-btn-donate {
    padding: 5px 14px;
    font-size: 11px;
  }

  .dc-details-panel {
    width: 240px;
  }
}
