/* ── Base ─────────────────────────────────────────────── */
* {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #8b8d8f;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ── Player Container ───────────────────────────────────── */
#player-container .player {
  width: 100%;
  max-width: 400px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(to bottom, #2a2e35 0%, #17191d 100%);
  border: solid 2px #3e434c;
  border-bottom: none;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
  padding-bottom: 15px;
  position: relative;
  transition: all 0.3s ease; /* برای انیمیشن کوچک شدن */
}

/* دکمه کوچک کردن */
.minimize-btn {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}
.minimize-btn:hover svg {
  stroke: #fff;
}

/* ── Top bar ──────────────────────────────────────────── */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 20px 5px 20px; /* پدینگ بالا برای فاصله از دکمه کوچک کردن */
}

.indicator {
  font-size: 10px;
  margin: 0;
  letter-spacing: 1px;
  color: #ea570a;
}

.small,
.big,
.big_play_pause {
  border-radius: 50%;
  height: 40px;
  width: 40px;
  background: radial-gradient(at bottom right, #292e35 0%, #292e34 80%);
  border: none;
  box-shadow: -7px -6px 10px 5px rgba(255, 255, 255, 0.04),
              6px 6px 10px 5px rgb(39, 42, 47);
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.big,
.big_play_pause {
  height: 60px;
  width: 60px;
  box-shadow: -7px -6px 10px 5px rgba(255, 255, 255, 0.04),
              7px 6px 10px 2px rgb(14, 15, 16);
  background: radial-gradient(at bottom right, #17191e 0%, #1d2025 80%);
}

.big_play_pause {
  background: radial-gradient(at top left, #c92711 0%, #ea570a 80%);
  position: relative;
}

.is-playing .big_play_pause::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(234, 87, 10, 0.5);
  animation: pulse 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}

.inner_button,
.inner_button_big,
.playpause {
  border-radius: 50%;
  height: 35px;
  width: 35px;
  background: radial-gradient(at top left, rgba(46, 50, 58, 1) 0%, rgba(28, 30, 35, 1) 80%);
  margin: 0 auto;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.inner_button_big {
  height: 55px;
  width: 55px;
  background: radial-gradient(at top left, rgb(57, 59, 64) 0%, rgb(12, 13, 16) 112%);
}

.playpause {
  background: radial-gradient(at bottom right, #c92711 0%, #ea570a 80%);
  height: 55px;
  width: 55px;
}

/* Active states */
.small:active { transform: translateY(2px) scale(0.96); }
.big_play_pause:active { transform: translateY(4px) scale(0.96); }
.big:active { transform: translateY(4px) scale(0.96); }

.extra-btn.active, .small.active .inner_button svg { stroke: #ea570a; }
.extra-btn.active { color: #ea570a; }

/* ── Album ────────────────────────────────────────────── */
.center {
  height: 120px;
  width: 120px;
  border-radius: 50%;
  margin: 5px auto 0;
  box-shadow: -15px -10px 16px 5px rgba(255, 255, 255, 0.04), 10px 10px 16px 8px rgb(24, 26, 29);
  background: radial-gradient(at top left, rgba(28, 30, 35, 1) 0%, #131416 85%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.album {
  border-radius: 50%;
  height: 110px;
  width: 110px;
  object-fit: cover;
}

.is-playing .album {
  animation: spin 12s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Waveform ─────────────────────────────────────────── */
.waveform {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 20px;
  margin: 10px auto 0;
  width: 60%;
}

.waveform .bar {
  width: 4px;
  min-height: 3px;
  border-radius: 2px;
  background: linear-gradient(to top, #c92711, #ffc107);
  height: 4px;
  transition: height 0.15s ease;
  opacity: 0.35;
  transform-origin: bottom;
}

.is-playing .waveform .bar {
  opacity: 1;
  animation: wave 1s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(1); }
}

/* ── Details ──────────────────────────────────────────── */
.song_details {
  text-align: center;
  margin-top: 10px;
  padding: 0 20px;
}

.song_details > div:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Seek ─────────────────────────────────────────────── */
.slider {
  margin: 10px auto 0;
  width: 80%;
}

.time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  margin-bottom: 5px;
}

.seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: #000;
  box-shadow: inset -2px -2px 2px 0 rgb(66, 70, 74), inset 1px 1px 1px -1px #000;
  outline: none;
  cursor: pointer;
  accent-color: #ea570a;
}

.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(at top left, #c92711 0%, #ffc107 90%);
  cursor: pointer;
}
.seek::-moz-range-thumb {
  width: 12px; height: 12px; border: none; border-radius: 50%;
  background: radial-gradient(at top left, #c92711 0%, #ffc107 90%);
  cursor: pointer;
}

/* ── Extras ───────────────────────────────────────────── */
.extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 20px 0;
  gap: 10px;
}

.extra-btn {
  background: transparent;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #84878a;
  border-radius: 6px;
  transition: color 0.15s;
}
.extra-btn svg { pointer-events: none; }

.extra-label {
  font-size: 9px;
  letter-spacing: 0.5px;
  color: inherit;
  font-weight: 600;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.volume {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: #000;
  outline: none;
  cursor: pointer;
  accent-color: #ea570a;
  min-width: 40px;
}

.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(at top left, #c92711 0%, #ffc107 90%);
  cursor: pointer;
}

/* ── Controls row ─────────────────────────────────────── */
.controls {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 10px 20px 0 20px;
}

/* ── Overlay & Playlist ───────────────────────────────── */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: 1001;
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }

.playlist {
  position: fixed; top: 0; right: 0; width: 300px; max-width: 85vw;
  height: 100dvh; background: #1a1c20; border-left: 1px solid #3e434c;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1002; display: flex; flex-direction: column;
}
.playlist.open { transform: translateX(0); }
.sheet-handle { display: none; }

.playlist-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px; border-bottom: 1px solid #2c3037;
  font-size: 14px; color: #c9c9c9; letter-spacing: 1px; text-transform: uppercase;
}

.playlist-close {
  background: transparent; border: none; font-size: 18px; cursor: pointer; color: #8b8d8f;
}
.playlist-close:hover { color: #fff; }

#trackList { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }

#trackList li {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  cursor: pointer; border-bottom: 1px solid #24272d; transition: background 0.15s; font-size: 13px;
}
#trackList li:hover { background: #24272d; }
#trackList li.active { background: linear-gradient(to right, rgba(234, 87, 10, 0.15), transparent); color: #ffb37a; }
#trackList li .num { width: 22px; color: #5a5d63; font-size: 11px; }
#trackList li.active .num { color: #ea570a; }

/* ════════════════════════════════════════════════════════
   MINIMIZED PLAYER STATE (حالت کوچک شده)
   ════════════════════════════════════════════════════════ */
#player-container .player.is-minimized {
  padding-bottom: 0;
  border-radius: 20px 20px 0 0;
  border: 1px solid #3e434c;
  border-bottom: none;
  cursor: pointer;
}

#player-container .player.is-minimized .minimize-btn {
  display: none; /* مخفی کردن دکمه کوچک‌سازی در حالت کوچک */
}

/* مخفی کردن بخش‌های غیرضروری در حالت کوچک */
#player-container .player.is-minimized .top,
#player-container .player.is-minimized .center,
#player-container .player.is-minimized .waveform,
#player-container .player.is-minimized .slider,
#player-container .player.is-minimized .extras,
#player-container .player.is-minimized #prevBtn,
#player-container .player.is-minimized #nextBtn {
  display: none;
}

/* چیدمان جدید برای حالت کوچک */
#player-container .player.is-minimized .song_details {
  margin: 0;
  padding: 10px 15px;
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 60%;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
}

#player-container .player.is-minimized .song_details #songTitle {
  font-size: 14px !important;
  margin-bottom: 2px;
}

#player-container .player.is-minimized .song_details #songArtist {
  font-size: 10px !important;
  margin-top: 0 !important;
}

#player-container .player.is-minimized .controls {
  margin: 0;
  padding: 5px 15px;
  justify-content: flex-end;
  height: 60px;
  position: relative;
  z-index: 5;
}

#player-container .player.is-minimized .big_play_pause {
  height: 40px;
  width: 40px;
  box-shadow: none;
}
#player-container .player.is-minimized .playpause {
  height: 36px;
  width: 36px;
}
#player-container .player.is-minimized .playpause img#playIcon {
  height: 12px !important;
}

/* ════════════════════════════════════════════════════════
   MOBILE
   ════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .playlist {
    top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-width: 100%;
    height: 70dvh; border-left: none; border-top: 1px solid #3e434c;
    border-radius: 22px 22px 0 0; transform: translateY(100%);
  }
  .playlist.open { transform: translateY(0); }

  .sheet-handle {
    display: block; width: 44px; height: 5px; border-radius: 3px;
    background: #3e434c; margin: 10px auto 2px; flex-shrink: 0;
  }
  .playlist-header { padding: 8px 20px 14px; }
  #trackList li { padding: 16px 20px; font-size: 14px; }
  
  /* اصلاح حالت کوچک در موبایل */
  #player-container .player.is-minimized .controls {
    justify-content: flex-start; /* دکمه پخش سمت چپ */
  }
  #player-container .player.is-minimized .song_details {
    text-align: left; /* متن سمت راست */
    right: auto;
    left: 60px;
    width: calc(100% - 60px);
  }
}