/* ==========================================================================
   3. TRÌNH PHÁT AUDIO CON THOI NỔI (DRAGGABLE FLOATING PLAYER)
   ========================================================================== */
.floating-player {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 12px);
    left: 12px;
    right: 12px;
    height: 58px;
    background: rgba(19, 19, 26, 0.94);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(243, 171, 43, 0.5);
    border-radius: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
    touch-action: none; /* Khóa cuộn trang khi đang kéo thanh nghe */
    user-select: none;
    cursor: grab;
    overflow: hidden;
    max-width: 480px;
}

.floating-player:active {
    cursor: grabbing;
    box-shadow: 0 12px 30px rgba(243, 171, 43, 0.35);
}

.player-progress-container {
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.player-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--gold-gradient);
}

.player-inner {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    gap: 8px;
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
}

.track-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gold-primary);
    object-fit: cover;
    flex-shrink: 0;
    animation: rotateThumb 15s linear infinite;
    animation-play-state: paused;
}
body.has-active-player .track-thumb { animation-play-state: running; }

@keyframes rotateThumb { 100% { transform: rotate(360deg); } }

.track-text { overflow: hidden; display: flex; flex-direction: column; }
.track-title {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-subtitle {
    font-size: 0.62rem;
    color: var(--gold-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ctrl-btn {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px;
}

.play-main-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gold-gradient);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(243, 171, 43, 0.4);
}