/* ========== MUSIC PLAYER – Ultra Glassmorphism (Final) ========== */
.music-player {
    position: fixed;
    top: 92px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 600px;
    min-width: 320px;
    z-index: 9000;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
    padding: 6px 20px;
    opacity: 1;
    pointer-events: auto;
}
.music-player.hidden { display: none; }

.mp-inner { display: flex; align-items: center; gap: 14px; }

/* Controls */
.mp-controls { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.mp-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.mp-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.mp-btn:disabled { opacity: 0.4; pointer-events: none; }

/* دکمهٔ پخش دایره‌ای کامل */
.mp-btn-play {
    width: 42px; height: 42px;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 18px rgba(56,189,248,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-btn-play .material-icons { font-size: 1.5rem; line-height: 1; }
.mp-btn-play:hover { background: linear-gradient(135deg, #0ea5e9, #7c3aed); transform: scale(1.05); }

/* دکمهٔ بستن */
.mp-close-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
    margin-left: 4px;
}
.mp-close-btn:hover { background: rgba(239,68,68,0.2); color: #f87171; }
.mp-close-btn .material-icons { font-size: 1rem; }

/* دکمهٔ شناور بازگردانی – بنفش نئونی، بزرگ‌تر */
.mp-restore-btn {
    position: fixed;
    top: 94px;
    right: 16px;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(154, 77, 255, 0.35);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
    color: #b15cff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 8999;
    transition: all 0.25s ease;
}
.mp-restore-btn.hidden { display: none; }
.mp-restore-btn:hover {
    background: rgba(139, 92, 246, 0.35);
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(154, 77, 255, 0.45);
    color: #fff;
}
.mp-restore-btn .material-icons { font-size: 1.5rem; }

/* انیمیشن موج/لرزش (در زمان پخش مخفی) */
.mp-restore-btn.pulse {
    animation: musicPulse 1.6s ease-in-out infinite;
}
@keyframes musicPulse {
    0%   { transform: scale(1);   box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25); }
    50%  { transform: scale(1.08); box-shadow: 0 6px 24px rgba(154, 77, 255, 0.5); }
    100% { transform: scale(1);   box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25); }
}

/* Info */
.mp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mp-title-wrap { overflow: hidden; white-space: nowrap; height: 20px; }
.mp-title {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    padding-right: 16px;
}
.mp-title.marquee { animation: marquee 7s linear infinite; }
@keyframes marquee {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Progress */
.mp-progress-wrap { width: 100%; }
.mp-progress-track {
    position: relative;
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    cursor: pointer;
}
.mp-progress-fill {
    position: absolute; top: 0; left: 0;
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #38bdf8, #8b5cf6);
    border-radius: 4px;
}
.mp-progress-thumb {
    position: absolute; top: 50%;
    transform: translate(-50%, -50%);
    width: 11px; height: 11px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity 0.2s;
    left: 0%;
    pointer-events: none;
}
.mp-progress-track:hover .mp-progress-thumb,
.mp-progress-track.dragging .mp-progress-thumb { opacity: 1; }

.mp-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 1px;
}

/* Volume */
.mp-volume { display: flex; align-items: center; flex-shrink: 0; }

/* ========== CONSENT MODAL ========== */
.mp-consent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-consent-overlay.hidden { display: none; }

.mp-consent-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 32px 28px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    color: #f1f5f9;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.mp-consent-icon { font-size: 3rem; color: #38bdf8; margin-bottom: 12px; }
.mp-consent-card h3 { font-size: 1.3rem; margin-bottom: 8px; color: #fff; }
.mp-consent-card p { font-size: 0.9rem; color: #cbd5e1; margin-bottom: 24px; line-height: 1.6; }
.mp-consent-buttons { display: flex; gap: 12px; justify-content: center; }
.mp-consent-btn { padding: 10px 22px; border-radius: 40px; font-weight: 700; font-size: 0.9rem; border: none; cursor: pointer; transition: all 0.2s; }
.mp-consent-btn.primary { background: linear-gradient(135deg, #38bdf8, #8b5cf6); color: #fff; box-shadow: 0 4px 14px rgba(56,189,248,0.3); }
.mp-consent-btn.primary:hover { background: linear-gradient(135deg, #0ea5e9, #7c3aed); transform: translateY(-2px); }
.mp-consent-btn.secondary { background: rgba(255,255,255,0.1); color: #cbd5e1; border: 1px solid rgba(255,255,255,0.15); }
.mp-consent-btn.secondary:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ========== MOBILE (سبک‌تر) ========== */
@media (max-width: 950px) {
    .music-player { top: 90px; }
    .mp-restore-btn { top: 92px; }
}
@media (max-width: 640px) {
    .music-player { top: 80px; padding: 5px 12px; border-radius: 40px; max-width: 95vw; }
    .mp-inner { gap: 8px; }
    .mp-btn { width: 30px; height: 30px; }
    .mp-btn-play { width: 36px; height: 36px; }
    .mp-btn-play .material-icons { font-size: 1.3rem; }
    .mp-close-btn { width: 24px; height: 24px; }
    .mp-close-btn .material-icons { font-size: 0.9rem; }
    .mp-title { font-size: 0.78rem; }
    .mp-time { font-size: 0.6rem; }
    .mp-consent-card { padding: 24px 20px; }
    .mp-restore-btn {
        top: 80px; right: 10px;
        width: 44px; height: 44px;
        backdrop-filter: none;
    }
    .mp-restore-btn .material-icons { font-size: 1.3rem; }
    @keyframes musicPulse {
        0%   { transform: scale(1);   box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25); }
        50%  { transform: scale(1.04); box-shadow: 0 6px 22px rgba(154, 77, 255, 0.45); }
        100% { transform: scale(1);   box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25); }
    }
}