/* Global Player Container */
.global-player-wrapper {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
    /* Allow clicking through the wrapper */
}

.global-player {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

/* Collapsed State */
.global-player.collapsed {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--primary-color);
    /* Use primary color for icon */
}

.global-player.collapsed:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--primary-color);
}

.player-icon {
    font-size: 24px;
    color: white;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Music Wave Animation */
.music-wave {
    position: absolute;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 15px;
    bottom: 12px;
}

.music-wave span {
    width: 3px;
    background: white;
    animation: wave 1s infinite ease-in-out;
}

.music-wave span:nth-child(1) {
    animation-delay: 0s;
    height: 60%;
}

.music-wave span:nth-child(2) {
    animation-delay: 0.2s;
    height: 100%;
}

.music-wave span:nth-child(3) {
    animation-delay: 0.4s;
    height: 40%;
}

@keyframes wave {

    0%,
    100% {
        height: 30%;
    }

    50% {
        height: 100%;
    }
}

/* Expanded State */
.global-player.expanded {
    width: 95%;
    max-width: 1100px;
    height: 90px;
    border-radius: 20px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.player-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    justify-content: center;
}

.collapse-btn {
    display: none;
}

.player-main-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    gap: 16px;
}

/* Song Info */
.song-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.mini-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.mini-cover.spinning {
    animation: spin 10s linear infinite;
    border-radius: 50%;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.info-text {
    overflow: hidden;
}

.song-name {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.artist-name {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 2px;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.control-btn:hover {
    color: var(--primary-color);
}

.play-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.4);
}

.play-btn:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
    color: white;
}

/* Actions */
.actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    justify-content: flex-end;
}

.time-display {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    gap: 6px;
}
.time-display .time-sep {
    color: var(--text-secondary);
    opacity: 0.8;
}

.volume-control {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.volume-control .horizontal-slider {
    width: 120px;
    accent-color: var(--primary-color);
}

.volume-control .action-btn {
    padding: 4px;
}

.quality-select {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    outline: none;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
}

.action-btn:hover {
    color: var(--text-primary);
}

/* Progress Bar */
.progress-bar-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    margin-top: 10px;
    position: relative;
    width: 100%;
}

.progress-bar-container:hover {
    height: 6px;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar-container:hover .progress-bar::after {
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .global-player-wrapper {
        bottom: 40px;
    }

    .global-player.expanded {
        height: auto;
        padding: 15px;
        flex-direction: column;
    }

    .player-main-row {
        flex-direction: column;
        gap: 15px;
    }

    .song-info,
    .actions {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .controls {
        margin: 10px 0;
    }
}
