/* ==========================================================================
   Save the Date — Kapriatta & Danny (July 31, 2027)
   Pure CSS • Dark-Mode Spotify "Now Playing" Inspired Layout
   ========================================================================== */

:root {
  --bg-page: #080808;
  --bg-card: #121212;
  --bg-sheet: #1E1E1E;
  --bg-sheet-hover: #282828;
  --text-primary: #FFFFFF;
  --text-secondary: #B3B3B3;
  --text-muted: #8A8A8A;
  --track-bg: #4D4D4D;
  --border-subtle: #535353;
  --accent-heart: #1DB954;
  --font-sans: "Avenir Next", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile-first full-bleed shell */
.player-shell {
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background-color: var(--bg-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    max(18px, env(safe-area-inset-top))
    24px
    max(22px, env(safe-area-inset-bottom));
  overflow: hidden;
  position: relative;
}

/* Desktop centered mobile card container */
@media (min-width: 480px) {
  body {
    background: radial-gradient(circle at 50% 20%, #1a1a1a 0%, var(--bg-page) 70%);
  }

  .player-shell {
    max-width: 420px;
    height: 100dvh;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

/* Header */
.player-header {
  text-align: center;
  flex-shrink: 0;
  padding-top: 4px;
}

.playlist-label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

/* Album Art Hero (1:1 Square) */
.album-hero {
  position: relative;
  width: min(100%, 48dvh);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background-color: #1c1c1c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
}

.album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Subtle top-to-bottom dark gradient scrim over upper 35% */
.album-scrim {
  position: absolute;
  inset: 0 0 auto 0;
  height: 35%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.34) 55%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
}

.album-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: clamp(9px, 2.4%, 15px) 12px 0;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.save-date-title {
  font-size: clamp(1.32rem, 6.2vw, 1.72rem);
  font-weight: 800;
  letter-spacing: 0.15em;
  text-indent: 0.15em;
  color: var(--text-primary);
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.save-date-subtitle {
  margin-top: 4px;
  font-size: clamp(0.8rem, 3.2vw, 0.96rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

@media (min-width: 480px) {
  .save-date-title {
    font-size: 1.65rem;
  }

  .save-date-subtitle {
    font-size: 0.92rem;
  }
}

/* Track Info Row */
.track-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}

.track-meta {
  min-width: 0;
  flex: 1;
}

.track-title {
  font-size: clamp(1rem, 4.4vw, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Minimalist Queue/Menu Icon (≡) that morphs into a 3-bar equalizer */
.track-status {
  width: 22px;
  height: 18px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.morph-bar {
  position: absolute;
  left: 2px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--text-secondary);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    bottom 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.3s ease;
}

.morph-bar.bar-1 {
  bottom: 14px;
}

.morph-bar.bar-2 {
  bottom: 8px;
}

.morph-bar.bar-3 {
  bottom: 2px;
}

/* Playing state: morph horizontal menu lines into vertical animated equalizer bars */
.player-shell.is-playing .morph-bar {
  width: 3px;
  height: 16px;
  bottom: 1px;
  background-color: var(--text-primary);
  transform-origin: bottom center;
}

.player-shell.is-playing .morph-bar.bar-1 {
  left: 3px;
  animation: eq-bounce-1 0.85s ease-in-out infinite alternate;
}

.player-shell.is-playing .morph-bar.bar-2 {
  left: 9.5px;
  animation: eq-bounce-2 0.65s ease-in-out infinite alternate;
}

.player-shell.is-playing .morph-bar.bar-3 {
  left: 16px;
  animation: eq-bounce-3 0.95s ease-in-out infinite alternate;
}

@keyframes eq-bounce-1 {
  0% { transform: scaleY(0.28); }
  50% { transform: scaleY(0.92); }
  100% { transform: scaleY(0.45); }
}

@keyframes eq-bounce-2 {
  0% { transform: scaleY(0.95); }
  50% { transform: scaleY(0.35); }
  100% { transform: scaleY(0.82); }
}

@keyframes eq-bounce-3 {
  0% { transform: scaleY(0.42); }
  50% { transform: scaleY(0.85); }
  100% { transform: scaleY(0.25); }
}

/* Proportional Date Progress Bar (Locked at 36.76%) */
.progress-section {
  flex-shrink: 0;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background-color: var(--track-bg);
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 36.76%;
  border-radius: 999px;
  background-color: var(--text-primary);
}

.progress-thumb {
  position: absolute;
  top: 50%;
  left: 36.76%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--text-primary);
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.progress-labels {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.time-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Playback Controls Row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  flex-shrink: 0;
}

.ctrl-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.14s ease, color 0.2s ease, opacity 0.2s ease;
}

.ctrl-btn:active {
  transform: scale(0.9);
}

.ctrl-btn:focus-visible,
.play-btn:focus-visible,
.calendar-pill:focus-visible,
.sheet-option:focus-visible,
.sheet-close:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.ctrl-muted {
  color: var(--text-muted);
  opacity: 0.72;
}

.ctrl-muted:hover {
  opacity: 0.95;
}

.ctrl-skip {
  color: var(--text-primary);
  opacity: 0.92;
}

.ctrl-skip:hover {
  opacity: 1;
}

/* Central Circular White Play / Pause Button (56px) */
.play-btn {
  appearance: none;
  border: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--text-primary);
  color: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.04);
}

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

.play-btn .icon-play {
  margin-left: 0;
  display: block;
}

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

.player-shell.is-playing .play-btn .icon-play {
  display: none;
}

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

/* Interactive Heart Button & Floating Heart Animation */
.ctrl-heart {
  color: var(--text-secondary);
}

.ctrl-heart.is-liked {
  color: var(--accent-heart);
}

.ctrl-heart.is-liked .heart-svg {
  fill: var(--accent-heart);
  stroke: var(--accent-heart);
  animation: heart-pop 0.35s cubic-bezier(0.22, 1.4, 0.36, 1);
}

@keyframes heart-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.floating-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.floating-heart {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 13px;
  line-height: 1;
  color: var(--accent-heart);
  pointer-events: none;
  will-change: transform, opacity;
  animation: float-up 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.1) forwards;
}

@keyframes float-up {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) translate(0, 0) scale(0.7);
  }
  50% {
    opacity: 0.9;
    transform: translate(-50%, -50%) translate(var(--drift-x, 0px), -26px) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--drift-x-end, 0px), -54px) scale(0.8);
  }
}

/* Bottom Footer Bar */
.player-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 4px;
}

.location-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.location-tag svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.calendar-pill {
  appearance: none;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.14s ease;
}

.calendar-pill:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.55);
}

.calendar-pill:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Add to Calendar Dark-Mode Bottom Sheet Modal (#1E1E1E)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.24s ease;
}

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

.modal-backdrop.is-open {
  opacity: 1;
}

.modal-sheet {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-sheet);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 10px 20px max(26px, env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.65);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-backdrop.is-open .modal-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.22);
  margin: 0 auto 14px;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.sheet-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sheet-subtitle {
  margin-top: 3px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.sheet-close {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sheet-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-option {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 12px;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.14s ease;
}

.sheet-option:hover {
  background-color: var(--bg-sheet-hover);
  border-color: rgba(255, 255, 255, 0.16);
}

.sheet-option:active {
  transform: scale(0.985);
}

.option-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.option-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.option-desc {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.option-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .morph-bar,
  .floating-heart,
  .modal-backdrop,
  .modal-sheet {
    animation: none !important;
    transition: none !important;
  }
}
