/* =========================================================
   MÜZİK ÇALAR — temaların renklerini kullanır
   ========================================================= */
.player { position: fixed; right: 18px; bottom: 18px; z-index: 40; font-family: var(--font-body); }

/* Plak düğmesi */
.pl-disc {
  position: relative; display: block; width: 56px; height: 56px; margin-left: auto;
  border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0;
  background: repeating-radial-gradient(circle, #151515 0 2px, #222 2px 3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--surface);
  transition: transform 0.2s;
}
.pl-disc:hover { transform: scale(1.06); }
/* Plağın ortasındaki etiket: şarkının kapağı (yoksa tema rengi) */
.pl-disc-label {
  position: absolute; left: 50%; top: 50%; width: 42%; height: 42%;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--accent) center / cover no-repeat;
  box-shadow: 0 0 0 2px #111;
}
.pl-disc-label::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px;
  transform: translate(-50%, -50%); border-radius: 50%; background: #111;
}
.pl-disc-in {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 20%, rgba(255, 255, 255, 0.14) 25%, transparent 30% 70%, rgba(255, 255, 255, 0.1) 75%, transparent 80%);
}
.is-playing .pl-disc { animation: pl-spin 3.2s linear infinite; }
.is-playing .pl-disc:hover { animation-play-state: paused; }
@keyframes pl-spin { to { transform: rotate(360deg); } }

/* Kart */
.pl-card {
  position: absolute; right: 0; bottom: 70px;
  width: 320px; max-height: calc(100vh - 110px); overflow-y: auto;
  padding: 14px 16px 12px;
  background: var(--bg);
  background-image: linear-gradient(var(--surface), var(--surface));
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: max(var(--radius), 6px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  /* Kapalıyken DOM'da kalır ki gömülü çalarlar çalmaya devam etsin */
  opacity: 0; transform: translateY(10px) scale(0.98); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.player.is-open .pl-card { opacity: 1; transform: none; pointer-events: auto; }
[data-theme="rezero"] .pl-card, [data-theme="alice"] .pl-card { box-shadow: 0 18px 50px rgba(80, 60, 120, 0.22); }

.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.pl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Playlist seçici */
.pl-select-wrap { position: relative; flex: 1; min-width: 0; }
.pl-select-wrap::after {
  content: ""; position: absolute; right: 10px; top: 50%; width: 6px; height: 6px; pointer-events: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
}
.pl-select {
  -webkit-appearance: none; appearance: none; width: 100%;
  font: inherit; font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 0.06em;
  color: var(--text); background: var(--accent-soft);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 28px 5px 12px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-select:hover { border-color: var(--accent); }
.pl-select:disabled { cursor: default; }
.pl-select option { color: var(--text); background: var(--bg); }

/* Kapak */
.pl-cover, .pl-thumb {
  flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--accent-soft); color: var(--accent-text, var(--accent));
}
.pl-cover { width: 64px; height: 64px; border-radius: max(calc(var(--radius) * 0.8), 6px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.pl-thumb { width: 36px; height: 36px; border-radius: 5px; }
.pl-cover img, .pl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-cover-ph svg { width: 26px; height: 26px; fill: currentColor; display: block; opacity: 0.8; }
.pl-thumb .pl-cover-ph svg { width: 16px; height: 16px; }
/* Gömülü çalar (Spotify/YouTube) kendi kapağını gösterdiği için büyük kapak gizlenir */
.player[data-kind="spotify"] .pl-cover,
.player[data-kind="youtube"] .pl-cover { display: none; }

.pl-embed:empty { display: none; }
.pl-embed { margin: 0 0 10px; border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, 0.25); }
.pl-embed iframe { display: block; width: 100%; border: 0; }
.player[data-kind="youtube"] .pl-embed { aspect-ratio: 16 / 9; }
.player[data-kind="youtube"] .pl-embed iframe { height: 100%; }
.player[data-kind="soundcloud"] .pl-embed iframe { height: 120px; }

.pl-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pl-meta { min-width: 0; flex: 1; }
.pl-title { font-family: var(--font-title); color: var(--title-color); font-size: 1.05rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-artist { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Kaydırıcılar */
.pl-progress { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-progress input { flex: 1; }
.player input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; margin: 0; cursor: pointer;
  background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--line) var(--p, 0%));
}
.player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
}
.player input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }

/* Düğmeler */
.pl-controls { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; }
.pl-ic {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  background: none; border: 0; border-radius: 50%; color: var(--text); cursor: pointer;
}
.pl-ic svg { width: 20px; height: 20px; fill: currentColor; }
.pl-ic:hover { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
.pl-min { width: 28px; height: 28px; }
.pl-min svg { width: 16px; height: 16px; }
.pl-play { width: 48px; height: 48px; background: var(--accent); color: var(--bg); }
.pl-play svg { width: 24px; height: 24px; }
.pl-play:hover { background: var(--accent); color: var(--bg); filter: brightness(1.1); }
.pl-shuffle, .pl-listbtn { color: var(--muted); }
.pl-shuffle[aria-pressed="true"], .pl-listbtn[aria-expanded="true"] { color: var(--accent-text, var(--accent)); }

.pl-vol { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pl-vol[hidden] { display: none; }
.pl-vol svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.pl-vol input { flex: 1; }

/* Liste */
.pl-list { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); max-height: 240px; overflow-y: auto; }
.pl-list[hidden] { display: none; }
.pl-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 6px;
  font: inherit; text-align: left; color: var(--text); background: none; border: 0; border-radius: 6px; cursor: pointer;
}
.pl-list button:hover { background: var(--accent-soft); }
.pl-list .is-current button { color: var(--accent-text, var(--accent)); }
.pl-list .is-current .pl-thumb { box-shadow: 0 0 0 2px var(--accent); }
.pl-list .is-current .pl-li-title { color: var(--accent-text, var(--accent)); }
.pl-li-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.pl-li-title { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-li-artist { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-src { flex: none; font-size: 0.62rem; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 999px; color: #fff; }
.pl-src-spotify { background: #1aa34a; }
.pl-src-youtube { background: #d42a2a; }
.pl-src-soundcloud { background: #e8601c; }

@media (max-width: 560px) {
  .player { right: 12px; bottom: 12px; }
  .pl-disc { width: 50px; height: 50px; }
  .pl-card { position: fixed; left: 12px; right: 12px; bottom: 72px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .is-playing .pl-disc { animation: none; }
}

/* Spotify playlist/albüm: şarkı listesiyle birlikte gösterilir */
.player[data-kind="spotify"] .pl-embed iframe { border-radius: 12px; }

/* Spotify playlist gömmesi: ileri/geri Spotify'ın kendi listesinden yapılır */
.player .pl-ic:disabled { opacity: 0.3; cursor: not-allowed; }
.player .pl-ic:disabled:hover { background: none; color: inherit; }
.player.is-splist .pl-controls::after {
  content: "Şarkıyı yukarıdaki Spotify listesinden seç"; position: absolute; left: 0; right: 0; bottom: -18px;
  text-align: center; font-size: 0.7rem; color: var(--muted);
}
.player .pl-controls { position: relative; }
.player.is-splist .pl-controls { margin-bottom: 22px; }
