/* ===== NOWY DESIGN ODTWARZACZA ===== */

:root {
    --player-accent: #00d4ff;
    --player-accent-secondary: #0099ff;
    --player-danger: #ff0080;
    --player-text: #ffffff;
    --player-text-secondary: #aaaaaa;
    --player-bg: rgba(15, 15, 25, 0.96);
    --player-border: rgba(255, 255, 255, 0.08);
}

/* ===== KONTENER GŁÓWNY ===== */
#audio-controls {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--player-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 14px;
    border-radius: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 1000;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 212, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 1px solid var(--player-border);
    max-width: 95vw;
    width: auto;
    flex-wrap: nowrap;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: playerSlideUp 0.5s ease-out;
}

@keyframes playerSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

#audio-controls:hover {
    box-shadow: 
        0 16px 50px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 212, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ===== SEKCJA PRZYCISKÓW ===== */
.player-buttons-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ===== BUTTON STYLES ===== */
.player-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--player-accent), var(--player-accent-secondary));
    color: var(--player-text);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 16px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.player-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 212, 255, 0.3),
        0 0 20px rgba(0, 212, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.player-btn:hover::before {
    opacity: 1;
}

.player-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(0, 212, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Stany specjalne buttonów */
.player-btn.active {
    background: linear-gradient(135deg, var(--player-danger), #ff6b00);
    box-shadow: 
        0 4px 16px rgba(255, 0, 128, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-btn.active:hover {
    box-shadow: 
        0 6px 20px rgba(255, 0, 128, 0.35),
        0 0 20px rgba(255, 0, 128, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.player-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 153, 255, 0.3));
}

.player-btn.disabled:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.1);
}

/* SVG ikony */
.player-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.3));
}

/* ===== SUWAK GŁOŚNOŚCI ===== */
.player-volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.player-volume-icon {
    width: 18px;
    height: 18px;
    color: var(--player-text-secondary);
    transition: color 0.3s ease;
}

#player-volume {
    width: 100px;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, 
        rgba(0, 212, 255, 0.1), 
        rgba(0, 212, 255, 0.25));
    border: none;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
    transition: background 0.3s ease;
}

#player-volume:hover {
    background: linear-gradient(to right, 
        rgba(0, 212, 255, 0.2), 
        rgba(0, 212, 255, 0.35));
}

#player-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--player-accent), var(--player-accent-secondary));
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 0 12px rgba(0, 212, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#player-volume::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 
        0 0 18px rgba(0, 212, 255, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#player-volume::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--player-accent), var(--player-accent-secondary));
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    box-shadow: 
        0 0 12px rgba(0, 212, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#player-volume::-moz-range-thumb:hover {
    transform: scale(1.25);
    box-shadow: 
        0 0 18px rgba(0, 212, 255, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#player-volume::-moz-range-track {
    background: transparent;
    border: none;
}

/* ===== SEPARATORY ===== */
.player-separator {
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent);
    margin: 0 2px;
    flex-shrink: 0;
}

/* ===== WSKAŹNIK ODTWARZANIA ===== */
.player-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.player-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--player-accent), var(--player-accent-secondary));
    box-shadow: 0 0 10px var(--player-accent);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.player-status-text {
    font-size: 11px;
    color: var(--player-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ===== TERAZ ODTWARZANE ===== */
#now-playing {
    position: fixed;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--player-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--player-accent);
    padding: 10px 16px;
    border-radius: 12px;
    z-index: 999;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 212, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 700;
    max-width: 85vw;
    text-align: center;
    word-wrap: break-word;
    border: 1px solid var(--player-border);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#now-playing::before {
    content: '♫ ';
    margin-right: 6px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== BŁĘDY ===== */
#player-error {
    position: fixed;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    z-index: 1001;
    box-shadow: 
        0 12px 40px rgba(255, 107, 107, 0.25),
        0 0 30px rgba(255, 107, 107, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: none;
    max-width: 85vw;
    word-wrap: break-word;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: slideInError 0.4s ease-out;
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== DYNAMICZNA KOLORYSTYKA ===== */

/* Ciemny nastrój - blues/purples */
#audio-controls.mood-dark {
    --player-accent: #6366f1;
    --player-accent-secondary: #8b5cf6;
}

/* Energetyczny nastrój - reds/oranges */
#audio-controls.mood-energetic {
    --player-accent: #f97316;
    --player-accent-secondary: #dc2626;
}

/* Melancholijny nastrój - teals/cyans */
#audio-controls.mood-melancholic {
    --player-accent: #06b6d4;
    --player-accent-secondary: #0891b2;
}

/* Spokojny nastrój - greens */
#audio-controls.mood-calm {
    --player-accent: #10b981;
    --player-accent-secondary: #059669;
}

/* Wesoły nastrój - pinks/purples */
#audio-controls.mood-happy {
    --player-accent: #ec4899;
    --player-accent-secondary: #db2777;
}

/* ===== MEDIA QUERIES ===== */

@media (max-width: 768px) {
    #audio-controls {
        padding: 8px 10px;
        gap: 6px;
        bottom: 12px;
    }

    .player-btn {
        width: 32px;
        height: 32px;
    }

    .player-btn svg {
        width: 16px;
        height: 16px;
    }

    #player-volume {
        width: 70px;
    }

    #now-playing {
        bottom: 60px;
        font-size: 10px;
        padding: 8px 12px;
    }

    #player-error {
        top: 12px;
        right: 12px;
        font-size: 11px;
        padding: 10px 12px;
    }

    .player-status-text {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    #audio-controls {
        padding: 6px 8px;
        gap: 4px;
        width: calc(100% - 16px);
        max-width: unset;
        bottom: 8px;
    }

    .player-btn {
        width: 30px;
        height: 30px;
    }

    .player-btn svg {
        width: 14px;
        height: 14px;
    }

    #player-volume {
        width: 50px;
        height: 4px;
    }

    #player-volume::-webkit-slider-thumb {
        width: 12px;
        height: 12px;
    }

    #player-volume::-moz-range-thumb {
        width: 12px;
        height: 12px;
    }

    #now-playing {
        bottom: 48px;
        font-size: 9px;
        padding: 6px 10px;
        max-width: 90vw;
    }

    #player-error {
        top: 8px;
        right: 8px;
        font-size: 10px;
        padding: 8px 10px;
        max-width: 90vw;
    }

    .player-separator {
        display: none;
    }

    .player-status {
        display: none;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    #audio-controls {
        padding: 6px 10px;
        gap: 6px;
        bottom: 6px;
    }

    .player-btn {
        width: 32px;
        height: 32px;
    }

    #player-volume {
        width: 70px;
    }

    #now-playing {
        bottom: 45px;
        font-size: 10px;
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .player-btn:hover {
        transform: none;
    }

    .player-btn:active {
        transform: scale(0.95);
    }

    #player-volume::-webkit-slider-thumb:hover {
        transform: scale(1.15);
    }

    #player-volume::-moz-range-thumb:hover {
        transform: scale(1.15);
    }
}

/* Zmniejszona animacja */
@media (prefers-reduced-motion: reduce) {
    #audio-controls,
    #now-playing,
    #player-error,
    .player-btn,
    #player-volume::-webkit-slider-thumb,
    #player-volume::-moz-range-thumb,
    .player-status-dot {
        transition: none;
        animation: none;
    }

    .player-btn::before {
        display: none;
    }
}
