/* ============================================================
   Music Showcase Player — Frontend Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Jost:wght@300;400;500;600&display=swap');

/* CSS Variable defaults (overridden by plugin settings via inline style) */
:root {
  --msp-bg:              #f5f0e8;
  --msp-left-bg:         #c9a87c;
  --msp-left-bg-end:     #8b6040;
  --msp-accent:          #9a7c4a;
  --msp-text-primary:    #2c2416;
  --msp-text-secondary:  #7a6a52;
  --msp-track-hover:     #ede7d9;
  --msp-btn-pri-bg:      #9a7c4a;
  --msp-btn-pri-text:    #ffffff;
  --msp-btn-out-border:  #2c2416;
  --msp-btn-out-text:    #2c2416;
  --msp-divider:         #e0d5c3;
  --msp-track-num:       #b8a88a;
  --msp-max-width:       900px;
  --msp-left-width:      42%;
}

/* ── Wrapper ── */
.msp-player {
  display: flex;
  background: var(--msp-bg);
  max-width: var(--msp-max-width);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 6px 48px rgba(0,0,0,.10);
  font-family: 'Jost', 'Segoe UI', sans-serif;
  position: relative;
}

/* ── LEFT PANEL ── */
.msp-left {
  width: var(--msp-left-width);
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(145deg, var(--msp-left-bg) 0%, var(--msp-left-bg-end) 100%);
  min-height: 380px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px 24px;
  box-sizing: border-box;
}

/* Blurred backdrop echoing the current track's art — fills the panel so it's
   never empty, instead of a flat gradient */
.msp-bg-blur {
  position: absolute;
  inset: -24px;
  background-size: cover;
  background-position: center;
  filter: blur(30px) brightness(.6) saturate(1.15);
  transform: scale(1.15);
  transition: opacity .35s ease;
  z-index: 0;
}

.msp-bg-blur.is-fading { opacity: 0; }

/* Brand-tinted scrim so the blurred photo still reads as part of the theme */
.msp-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, var(--msp-left-bg) 0%, var(--msp-left-bg-end) 100%);
  opacity: .45;
  z-index: 1;
}

/* Album art container — fixed-size box, centered instead of full-bleed */
.msp-art-wrap {
  position: relative;
  z-index: 2;
  width: 190px;
  height: 190px;
  max-width: 68%;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0,0,0,.30);
}

.msp-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .35s ease, transform .35s ease;
}

.msp-art-img.is-fading {
  opacity: 0;
  transform: scale(1.03);
}

/* Overlay with big play button */
.msp-art-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.14);
  z-index: 2;
}

.msp-big-play {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.80);
  background: rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s ease;
  padding: 0 0 0 4px;
}

.msp-big-play:hover {
  background: rgba(255,255,255,.28);
  transform: scale(1.07);
}

.msp-big-play svg {
  width: 28px;
  height: 28px;
}

.msp-big-play .msp-i-pause { display: none; }

.msp-player.is-playing .msp-big-play .msp-i-play  { display: none; }
.msp-player.is-playing .msp-big-play .msp-i-pause { display: block; }

/* Video wrapper */
.msp-vid-wrap {
  display: none;
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 10;
}

.msp-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msp-player.has-video .msp-vid-wrap { display: block; }
.msp-player.has-video .msp-art-wrap,
.msp-player.has-video .msp-track-count { z-index: 0; opacity: 0; }

/* Track count label — gives the panel a purpose instead of empty space below the art */
.msp-track-count {
  position: relative;
  z-index: 2;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
}

/* ── RIGHT PANEL ── */
.msp-right {
  flex: 1;
  min-width: 0;
  padding: 40px 38px 36px;
  display: flex;
  flex-direction: column;
}

/* Header */
.msp-header {
  margin-bottom: 22px;
}

.msp-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .20em;
  color: var(--msp-accent);
  margin: 0 0 10px;
  text-transform: uppercase;
}

.msp-label-dash {
  display: inline-block;
  width: 26px;
  height: 1.5px;
  background: var(--msp-accent);
  flex-shrink: 0;
}

.msp-featured-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 400;
  color: var(--msp-text-primary);
  margin: 0 0 6px;
  line-height: 1.08;
  letter-spacing: -.01em;
}

.msp-year-genre {
  font-size: 10.5px;
  letter-spacing: .14em;
  font-weight: 500;
  color: var(--msp-accent);
  margin: 0 0 12px;
  text-transform: uppercase;
}

.msp-desc {
  font-size: 13.5px;
  line-height: 1.70;
  color: var(--msp-text-secondary);
  margin: 0;
  font-weight: 300;
}

/* ── Track list ── */
.msp-tracks {
  flex: 1;
}

.msp-track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--msp-divider);
  border-radius: 4px;
  cursor: pointer;
  transition: background .14s ease;
  user-select: none;
  outline: none;
}

.msp-track:last-child { border-bottom: none; }

.msp-track:hover,
.msp-track.is-active  { background: var(--msp-track-hover); }

.msp-track:focus-visible {
  outline: 2px solid var(--msp-accent);
  outline-offset: -2px;
}

/* Track number */
.msp-num {
  font-size: 11px;
  color: var(--msp-track-num);
  font-weight: 400;
  width: 20px;
  text-align: right;
  flex-shrink: 0;
  letter-spacing: .04em;
  transition: opacity .14s;
}

.msp-track.is-active .msp-num { opacity: 0; }

/* Row play button */
.msp-row-play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--msp-accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 0 0 2px;
  transition: transform .15s ease, filter .15s ease;
  position: relative;
}

.msp-row-play:hover {
  transform: scale(1.10);
  filter: brightness(1.12);
}

.msp-row-play svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.msp-row-play .msp-i-pause { display: none; padding: 0; }

/* Active + playing state */
.msp-track.is-active.is-playing .msp-row-play .msp-i-play  { display: none; }
.msp-track.is-active.is-playing .msp-row-play .msp-i-pause { display: block; }

/* Track info */
.msp-info {
  flex: 1;
  font-size: 13.5px;
  color: var(--msp-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.msp-name { font-weight: 400; }

.msp-subtitle {
  color: var(--msp-text-secondary);
  font-weight: 300;
}

/* Duration */
.msp-dur {
  font-size: 12.5px;
  color: var(--msp-text-secondary);
  font-weight: 300;
  flex-shrink: 0;
  letter-spacing: .03em;
}

/* ── Action buttons ── */
.msp-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.msp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: 'Jost', sans-serif;
  transition: all .18s ease;
  text-transform: uppercase;
  line-height: 1;
}

.msp-btn-pri {
  background: var(--msp-btn-pri-bg);
  color: var(--msp-btn-pri-text);
}

.msp-btn-pri:hover {
  filter: brightness(1.10);
  color: var(--msp-btn-pri-text);
  text-decoration: none;
}

.msp-btn-out {
  background: transparent;
  color: var(--msp-btn-out-text);
  border: 1.5px solid var(--msp-btn-out-border);
}

.msp-btn-out:hover {
  background: var(--msp-btn-out-border);
  color: var(--msp-bg);
  text-decoration: none;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .msp-player { flex-direction: column; }

  .msp-left {
    width: 100% !important;
    min-height: 220px;
    padding: 24px 20px;
  }

  .msp-art-wrap { width: 140px; height: 140px; }

  .msp-vid-wrap { min-height: 220px; }

  .msp-right { padding: 26px 20px 24px; }

  .msp-actions {
    flex-direction: column;
    gap: 8px;
  }

  .msp-btn { width: 100%; }
}

@media (max-width: 400px) {
  .msp-right { padding: 20px 16px 20px; }
  .msp-featured-title { font-size: 26px; }
}
