/* Mixed Method Dynamic Music Player (Horizontal Capsule by Default, Compact Full View on Click) */
@keyframes au0{0%,100%{transform:translate(0%,0%) scale(1)}40%{transform:translate(-7%,10%) scale(1.05)}70%{transform:translate(5%,-5%) scale(.96)}}
@keyframes au1{0%,100%{transform:translate(0%,0%) scale(1)}35%{transform:translate(8%,-6%) scale(1.04)}75%{transform:translate(-5%,8%) scale(.98)}}
@keyframes au2{0%,100%{transform:translate(0%,0%) scale(1)}45%{transform:translate(-6%,-8%) scale(1.03)}65%{transform:translate(7%,6%) scale(1.01)}}
@keyframes au3{0%,100%{transform:translate(0%,0%) scale(1)}30%{transform:translate(6%,7%) scale(.97)}60%{transform:translate(-8%,-5%) scale(1.04)}}
@keyframes au4{0%,100%{transform:translate(0%,0%) scale(1)}50%{transform:translate(-4%,5%) scale(1.05)}80%{transform:translate(6%,-7%) scale(.98)}}

@keyframes miWave {
  0% { height: 3px; }
  100% { height: 11px; }
}

/* Top row, in the gap between the nav links and the rope
   (2026-11-15, Price's feedback "iss area me krnaa h", pointing at
   (740, 22)). The nav links pill ends at x 590 and the rope toggle starts
   at x 1248 (1366px screen), so the island sits at left:606px — 16px
   clear of the links, its centre at ~747, covering the point Price
   marked. The sky spot (top:140px) was not where he wanted it, and the
   top-right corner (right:16px) covered the rope's string. The mobile
   rule below (max-width:860px) still drops it under the header. */
.music-island-container {
  position: fixed;
  top: 12px;
  left: 606px;
  right: auto;
  transform: none;
  z-index: 150;
  pointer-events: auto;
  font-family: Switzer, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Aurora Glow */
.mi-aurora {
  position: absolute;
  inset: -10px -16px;
  border-radius: 30px;
  filter: blur(16px) saturate(1.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: -1;
}

.music-island:hover ~ .mi-aurora,
.music-island.mi-playing ~ .mi-aurora {
  opacity: 0.55;
}

.music-island.expanded ~ .mi-aurora {
  opacity: 0.7;
}

.mi-blob {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: normal;
  opacity: 0.5;
  will-change: transform;
}
.mi-b0 { width: 70%; height: 85%; top: -35%; left: -5%; animation: au0 8s ease-in-out infinite; }
.mi-b1 { width: 65%; height: 75%; top: -25%; left: 45%; animation: au1 11s ease-in-out infinite -3.2s; }
.mi-b2 { width: 60%; height: 70%; top: -15%; left: 20%; animation: au2 9.5s ease-in-out infinite -1.5s; }
.mi-b3 { width: 55%; height: 80%; top: -30%; left: 65%; animation: au3 7s ease-in-out infinite -4.8s; }
.mi-b4 { width: 50%; height: 65%; top: -10%; left: -15%; animation: au4 10s ease-in-out infinite -2.1s; }

/* ── The Dynamic Frame (Horizontal Capsule by default, Expandable on click) ── */
.music-island {
  position: relative;
  background: rgba(10, 11, 16, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #ffffff;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  box-sizing: border-box;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease,
              padding 0.35s ease;
}

/* ── 1. DEFAULT HORIZONTAL STATE ── */
.music-island:not(.expanded) {
  width: auto;
  min-width: 260px;
  max-width: 335px;
  height: 38px;
  border-radius: 999px;
  padding: 4px 8px 4px 5px;
  display: flex;
  align-items: center;
}

.music-island:not(.expanded):hover {
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.65), 0 0 0 1.2px rgba(255, 255, 255, 0.2);
}

.music-island:not(.expanded) .mi-full-view {
  display: none !important;
}

.music-island.expanded .mi-bar-view {
  display: none !important;
}

.mi-bar-view {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* Clickable meta trigger */
.mi-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.mi-bar-left:hover {
  opacity: 0.88;
}

.mi-cover-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.mi-cover {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  display: block;
}

.mi-live-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #34d399;
  border: 1.5px solid #0a0b10;
  box-shadow: 0 0 5px #34d399;
}

.mi-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  min-width: 75px;
  max-width: 125px;
}

.mi-title {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.mi-artist {
  font-size: 8.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Equalizer Waveform */
.mi-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 13px;
  flex-shrink: 0;
}

.mi-wave-bar {
  width: 2px;
  height: 3px;
  border-radius: 999px;
  background: #34d399;
  transition: height 0.1s ease, background-color 0.3s;
}

.mi-playing .mi-wave-bar:nth-child(1) { animation: miWave 0.75s ease-in-out infinite alternate; }
.mi-playing .mi-wave-bar:nth-child(2) { animation: miWave 0.52s ease-in-out infinite alternate 0.15s; }
.mi-playing .mi-wave-bar:nth-child(3) { animation: miWave 0.88s ease-in-out infinite alternate 0.3s; }
.mi-playing .mi-wave-bar:nth-child(4) { animation: miWave 0.61s ease-in-out infinite alternate 0.1s; }

/* Subtle Vertical Divider */
.mi-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* Controls Cluster in Horizontal Bar */
.mi-bar-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.mi-btn {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  transition: color 0.18s ease, transform 0.15s ease, background-color 0.18s ease;
}

.mi-ctrl-prev, .mi-ctrl-next {
  width: 22px;
  height: 22px;
}

.mi-ctrl-prev:hover, .mi-ctrl-next:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.1);
}

.mi-ctrl-play {
  width: 26px;
  height: 26px;
  background: #ffffff;
  color: #0a0b10;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.22);
}

.mi-ctrl-play:hover {
  background: #f0f0f0;
  transform: scale(1.08);
}

.mi-ctrl-expand {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

.mi-ctrl-expand:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.1);
}

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

/* Integrated Micro Bottom Progress Line in Bar View */
.mi-bar-progress {
  position: absolute;
  bottom: -4px;
  left: 8px;
  right: 8px;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  transition: height 0.15s ease;
}

.music-island:hover .mi-bar-progress {
  height: 3px;
}

.mi-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #34d399, #6ee7b7);
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* ── 2. COMPACT FULL VIEW (Expanded on click, "not much large") ── */
.music-island.expanded {
  width: min(315px, 92vw);
  height: 140px;
  border-radius: 24px;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.mi-full-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Full View Top Row */
.mi-full-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.mi-full-track {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mi-full-cover {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.mi-full-info {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

.mi-badge-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mi-badge {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
  width: fit-content;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.mi-badge:hover {
  opacity: 0.85;
}

.mi-reload-btn {
  background: none;
  border: 0;
  padding: 2px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, transform 0.3s ease;
}

.mi-reload-btn:hover {
  color: #34d399;
  transform: rotate(180deg);
}

.mi-reload-btn.loading {
  animation: miSpin 0.75s linear infinite;
  color: #34d399;
}

@keyframes miSpin {
  100% { transform: rotate(360deg); }
}

.mi-full-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
  max-width: 195px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mi-full-artist {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.58);
  max-width: 195px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mi-collapse-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.mi-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

/* Full View Progress Row */
.mi-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 2px 0;
}

.mi-time {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
  min-width: 24px;
}

.mi-track-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.mi-track-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: #ffffff;
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* Full View Controls Row */
.mi-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 10px;
}

.mi-full-prev, .mi-full-next {
  width: 24px;
  height: 24px;
}

.mi-full-prev:hover, .mi-full-next:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.1);
}

.mi-full-play {
  width: 32px;
  height: 32px;
}

@media (max-width: 860px) {
  .music-island-container {
    top: 60px; /* sits cleanly under mobile header */
  }
}

@media (max-height: 720px) {
  .music-island.expanded {
    height: 126px;
    padding: 10px 14px 8px;
  }
  .mi-full-cover {
    width: 32px;
    height: 32px;
  }
}
