/* ═══════════════════════════════════════════
   music.css — Müzik Çalar Widget
   Sağ alt köşede sabit, glassmorphism stili
═══════════════════════════════════════════ */

.music-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 500;
  font-family: var(--font-sans, 'Inter', sans-serif);
}

/* ── Toggle (müzik notu) butonu ── */
.mp-toggle {
  position: absolute;
  bottom: 0; right: 0;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--red, #dc2626);
  color: #fff;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(220,38,38,0.5);
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  z-index: 2;
  border: none; cursor: pointer;
}
.mp-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 32px rgba(220,38,38,0.7);
}
.mp-toggle.active {
  background: #1a1a2e;
  box-shadow: 0 0 0 2px var(--red, #dc2626), 0 4px 20px rgba(220,38,38,0.4);
}
.mp-toggle i {
  transition: transform 0.35s ease;
}
.mp-toggle.active i {
  transform: rotate(20deg);
}

/* ── Ana panel ── */
.mp-panel {
  position: absolute;
  bottom: 64px; right: 0;
  width: 300px;
  background: rgba(12, 12, 18, 0.97);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 18px;
  backdrop-filter: blur(24px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.05);
  overflow: hidden;

  /* Kapalı hali */
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16,1,0.3,1);
  transform-origin: bottom right;
}
.mp-panel.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Başlık ── */
.mp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mp-label {
  font-size: 0.75rem; font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}
.mp-label i { color: var(--red, #dc2626); }
.mp-close {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4); font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  border: none; cursor: pointer;
}
.mp-close:hover { background: rgba(220,38,38,0.2); color: var(--red, #dc2626); }

/* ── Şarkı bilgisi ── */
.mp-track {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 16px 12px;
}
.mp-cover {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a0000, #3d0000);
  border: 1px solid rgba(220,38,38,0.4);
  display: flex; align-items: center; justify-content: center;
  color: var(--red, #dc2626); font-size: 1.2rem;
  box-shadow: 0 4px 16px rgba(220,38,38,0.25);
  transition: transform 0.3s ease;
}
/* Cover sabit kalır, dönmez */
.mp-cover.spinning {
  /* animasyon yok — intentionally removed */
}
.mp-meta { flex: 1; overflow: hidden; }
.mp-title {
  display: block;
  font-size: 0.92rem; font-weight: 700;
  color: #f1f1f1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-artist {
  display: block; margin-top: 3px;
  font-size: 0.75rem; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Progress bar ── */
.mp-progress-wrap {
  padding: 0 16px;
  cursor: pointer;
}
.mp-progress-bg {
  position: relative; height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px; overflow: visible;
}
.mp-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--red, #dc2626), #ff6b6b);
  border-radius: 4px;
  transition: width 0.1s linear;
  position: relative;
}
.mp-progress-fill::after {
  content: '';
  position: absolute; right: -6px; top: 50%;
  width: 12px; height: 12px;
  background: #fff; border-radius: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform 0.2s ease;
  box-shadow: 0 0 6px rgba(220,38,38,0.6);
}
.mp-progress-wrap:hover .mp-progress-fill::after {
  transform: translateY(-50%) scale(1);
}

.mp-times {
  display: flex; justify-content: space-between;
  padding: 5px 16px 0;
  font-size: 0.7rem; color: rgba(255,255,255,0.3);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Kontroller ── */
.mp-controls {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 14px 16px;
}
.mp-btn {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: none; cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(255,255,255,0.7);
}
.mp-btn:hover { color: #fff; transform: scale(1.1); }

.mp-btn-sm {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.06);
  font-size: 0.95rem;
}
.mp-btn-sm:hover { background: rgba(255,255,255,0.12); }

.mp-btn-main {
  width: 50px; height: 50px;
  background: var(--red, #dc2626);
  font-size: 1.1rem; color: #fff;
  box-shadow: 0 4px 16px rgba(220,38,38,0.4);
}
.mp-btn-main:hover {
  background: #ef4444;
  box-shadow: 0 4px 24px rgba(220,38,38,0.6);
  transform: scale(1.08);
}

/* ── Ses seviyesi ── */
.mp-volume-row {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px 14px;
}
.mp-vol-icon { font-size: 0.75rem; color: rgba(255,255,255,0.3); }
.mp-volume-track {
  flex: 1; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px; cursor: pointer;
  position: relative;
}
.mp-volume-fill {
  height: 100%; width: 70%;
  background: rgba(220,38,38,0.7);
  border-radius: 3px;
  transition: width 0.15s ease;
}

/* ── Playlist ── */
.mp-playlist-wrap {
  border-top: 1px solid rgba(255,255,255,0.06);
  max-height: 180px;
  overflow-y: auto;
}
.mp-pl-header {
  padding: 10px 16px 8px;
  font-size: 0.72rem; font-weight: 600;
  color: rgba(255,255,255,0.3); letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.mp-pl-header i { color: var(--red, #dc2626); }
.mp-pl-count {
  margin-left: auto;
  background: rgba(220,38,38,0.15);
  color: var(--red, #dc2626);
  padding: 2px 7px; border-radius: 99px;
  font-size: 0.68rem;
}
.mp-playlist-items { padding: 0 8px 8px; }
.mp-pl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer; transition: background 0.2s;
}
.mp-pl-item:hover { background: rgba(255,255,255,0.05); }
.mp-pl-item.active {
  background: rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.2);
}
.mp-pl-num {
  font-size: 0.7rem; color: rgba(255,255,255,0.25);
  width: 16px; text-align: center; flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}
.mp-pl-info { flex: 1; overflow: hidden; }
.mp-pl-title {
  display: block; font-size: 0.82rem; font-weight: 600; color: #e0e0e0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-pl-artist {
  display: block; font-size: 0.7rem; color: rgba(255,255,255,0.3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-pl-playing {
  color: var(--red, #dc2626); font-size: 0.75rem; flex-shrink: 0;
  animation: vol-pulse 1.2s ease-in-out infinite;
}
@keyframes vol-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Playlist scrollbar */
.mp-playlist-wrap::-webkit-scrollbar { width: 4px; }
.mp-playlist-wrap::-webkit-scrollbar-thumb { background: rgba(220,38,38,0.3); border-radius: 2px; }

/* ── Mobil ── */
@media (max-width: 480px) {
  .music-widget { bottom: 16px; right: 16px; }
  .mp-panel { width: calc(100vw - 32px); right: 0; }
}