/* ====================================
   Music Player Styles
   Fixed Bottom Player
   ==================================== */

.music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-height);
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.player-container {
    height: 100%;
    padding: 0 var(--spacing-lg);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: var(--spacing-lg);
}

/* ========== Song Info (Left) ========== */
.player-song-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.player-thumbnail {
    flex-shrink: 0;
}

.player-thumbnail img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.player-details {
    flex: 1;
    min-width: 0;
}

.player-title {
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.player-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-song-info .favorite-btn {
    flex-shrink: 0;
}

/* ========== Player Controls (Center) ========== */
.player-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}

.control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.btn-control {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.btn-control:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.btn-control.active {
    color: var(--accent-primary);
}

.btn-play-pause {
    width: 40px;
    height: 40px;
    background: white;
    color: #121212;
    font-size: 1.2rem;
}

.btn-play-pause:hover {
    background: white;
    transform: scale(1.08);
}

/* ========== Progress Bar ========== */
.player-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-current,
.time-duration {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Roboto Mono', monospace;
    min-width: 40px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.seek-bar {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.progress-filled {
    position: absolute;
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    pointer-events: none;
    transition: width 0.1s linear;
}

.progress-bar:hover .progress-filled {
    background: var(--accent-hover);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(var(--seek-position, 0), -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.progress-bar:hover::after {
    opacity: 1;
}

/* ========== Volume & Extras (Right) ========== */
.player-extras {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-bar {
    width: 100px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* ========== Bottom Nav (Mobile) ========== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: var(--player-height);
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 999;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    transition: color var(--transition-fast);
}

.bottom-nav-item i {
    font-size: 1.3rem;
}

.bottom-nav-item.active {
    color: var(--accent-primary);
}

.bottom-nav-item:hover {
    color: var(--text-primary);
}

/* ========== Queue Modal (Optional) ========== */
.queue-modal {
    position: fixed;
    right: 0;
    bottom: var(--player-height);
    width: 360px;
    max-height: 500px;
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    z-index: 1001;
}

.queue-modal.show {
    transform: translateY(0);
}

.queue-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.queue-header h3 {
    font-size: 1.1rem;
}

.queue-list {
    overflow-y: auto;
    max-height: 400px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.queue-item:hover {
    background: var(--bg-hover);
}

.queue-item.active {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
}

.queue-item img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-title {
    font-weight: 500;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== Lyrics Panel (Optional) ========== */
.lyrics-panel {
    position: fixed;
    right: 0;
    bottom: var(--player-height);
    width: 400px;
    max-height: 600px;
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    z-index: 1001;
}

.lyrics-panel.show {
    transform: translateY(0);
}

.lyrics-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lyrics-content {
    padding: var(--spacing-lg);
    overflow-y: auto;
    max-height: 500px;
    line-height: 1.8;
}

.lyrics-line {
    padding: var(--spacing-sm) 0;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.lyrics-line.active {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.lyrics-embed {
    width: 100%;
    height: 100%;
}

/* ========== Audio Element (Hidden) ========== */
#audio-element {
    display: none;
}

/* ========== Player Animations ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.btn-play-pause.playing::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* ========== Loading State ========== */
.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.player-loading i {
    font-size: 2rem;
    color: var(--accent-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
