/* 
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TENSHO MUSIC — PERSISTENT MUSIC PLAYER (assets/css/player.css)
   Angel Carmona / Tensho Beats
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
*/

.global-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--player-height);
    background: rgba(8, 8, 12, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.global-audio-player.active {
    transform: translateY(0);
}

.player-grid {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1.2fr;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* ─── Track Info ───────────────────────────────────────────────────────── */
.player-track-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
}

.player-cover {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.player-track-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.player-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-producer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Controls Central ─────────────────────────────────────────────────── */
.player-controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.player-buttons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.player-btn {
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover {
    color: var(--text-primary);
}

.player-btn.active {
    color: var(--primary);
}

.player-btn-main {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255,255,255,0.2);
    transition: var(--transition-smooth);
}

.player-btn-main:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.player-btn-main svg {
    fill: currentColor;
}

/* Timeline & Slider */
.player-timeline {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.timeline-slider-container {
    flex: 1;
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
}

.timeline-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0;
    border-radius: 2px;
    position: relative;
}

.timeline-progress::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.timeline-slider-container:hover .timeline-progress::after {
    opacity: 1;
}

/* ─── Extra Settings (Volume, Visualizer, Cart) ────────────────────────── */
.player-extra-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
}

/* Visualizer Canvas overlay */
.player-canvas-visualizer {
    width: 80px;
    height: 30px;
    opacity: 0.6;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 120px;
}

.volume-slider-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-progress {
    height: 100%;
    background: #fff;
    width: 70%;
    border-radius: 2px;
}

/* Buy Quick Button */
.player-buy-btn {
    background: var(--gold);
    color: #000;
    font-weight: 800;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
    transition: var(--transition-smooth);
}

.player-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.5);
}

/* Responsive Player Layout & iOS floating player design */
@media (max-width: 900px) {
    .player-grid {
        grid-template-columns: 1.2fr 1.8fr;
    }
    .player-extra-controls {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .global-audio-player {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; /* Float above iOS bottom tab bar dynamically */
        left: 12px !important;
        right: 12px !important;
        width: calc(100% - 24px) !important;
        height: 64px !important;
        border-radius: 16px !important;
        background: rgba(18, 18, 28, 0.8) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding: 0 1rem !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
        transform: translateY(150%);
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
        margin: 0 !important;
    }
    
    .global-audio-player.active {
        transform: translateY(0) !important;
    }
    
    .player-grid {
        grid-template-columns: 1fr auto !important; /* Only track details and play/pause on mobile */
        align-content: center;
        gap: 12px;
    }
    
    .player-controls-container {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        margin-top: 0;
    }
    
    /* Hide extra controls on iOS floating player */
    .shuffle-btn, .prev-btn, .next-btn, .repeat-btn, .player-timeline {
        display: none !important;
    }
    
    .player-buttons {
        gap: 0 !important;
    }
    
    .player-btn-main {
        width: 40px !important;
        height: 40px !important;
        box-shadow: 0 3px 10px rgba(255, 255, 255, 0.15) !important;
    }

    .player-cover {
        width: 46px !important;
        height: 46px !important;
        border-radius: 8px !important;
    }
    
    .player-title {
        font-size: 0.9rem !important;
        max-width: 160px;
    }
    
    .player-producer {
        font-size: 0.75rem !important;
    }
}

