/**
 * Advanced Music Player - Main Styles
 *
 * @package AdvancedMusicPlayer
 * @since 1.0.0
 *
 * ============================================================================
 *  KONTRAKT WIDOCZNOŚCI ELEMENTÓW DYNAMICZNYCH
 *  (czytaj zanim zmienisz cokolwiek związanego z display: none/flex/block)
 * ============================================================================
 *
 *  1. .mobile-mini-player (#mobile-mini-player)
 *     - JS: $('#mobile-mini-player').show() / .hide() (player-core.js:5586,5591)
 *     - HTML: inline style="display:none;" (templates/player-main.php:849)
 *     - CSS top-level (na końcu pliku): display:none !important — globalnie ukryty
 *     - CSS @media (max-width:479px): display:flex !important — pokazany na mobile
 *     - Wnioski: !important w stylesheet wygrywa nad jQuery .show() inline display:block
 *
 *  2. .modal-overlay (#modal-new-playlist, #modal-rename-playlist, #modal-info, #modal-legend itd.)
 *     - JS: $modal.fadeIn() / fadeOut() (player-core.js: rozproszone)
 *     - HTML: inline style="display:none;" (templates/player-main.php — kilka miejsc)
 *     - CSS: display:flex (linia ~4090) — żeby fadeIn zachowało flex layout
 *     - NIE dodawać display:none jako default w CSS — rozjedzie jQuery fadeIn (ustawi
 *       inline display:block i straci flex centering modala).
 *
 *  3. .countdown-bar (#countdown-bar)
 *     - JS: $countdown.fadeIn() / fadeOut() (player-core.js:1992,2006,2025)
 *     - HTML: inline style="display:none;" (templates/player-main.php:840)
 *     - CSS: display:flex — z tego samego powodu co modale.
 *
 *  Reguła ogólna: jeśli element jest pokazywany przez jQuery .fadeIn() to default
 *  w CSS musi być finalnym display ('flex' lub 'block'), a startowe ukrycie zostaje
 *  na inline style w PHP. Jeśli używasz .show()/.hide() (jak mini-player) — możesz
 *  bezpiecznie wymusić CSS display:none !important + override w @media.
 * ============================================================================
 */

/* ========================================
   ELEMENTOR OVERRIDE - Force player styles
   ======================================== */

/* Reset Elementor margins/paddings */
.elementor-widget-shortcode .player-container,
.elementor-element .player-container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* Fix modal z-index and widths */
.player-container .modal-overlay {
    z-index: 99999 !important;
}

.player-container .modal-content {
    max-width: 500px !important;
    width: 90% !important;
    margin: 0 auto !important;
}

.player-container .modal-info {
    max-width: 800px !important;
    width: 90% !important;
}

/* Fix close button appearance - 10% SMALLER */
.player-container .modal-close {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    width: 36px !important; /* 40px - 10% = 36px */
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important; /* Smaller X to fit */
}

/* Reset Elementor button overrides */
.player-container button,
.player-container .btn {
    font-family: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* Fix borders and gaps */
.player-container .player-tabs,
.player-container .player-tracklist {
    border: none !important;
    box-shadow: none !important;
}

/* Fix modal playlist visibility */
.player-container .modal-playlist-item {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix modal backgrounds - rounded corners, white border, black bg */
.player-container .modal-overlay .modal-content {
    background: #000000 !important;
    border: 2px solid #FFFFFF !important;
    border-radius: 12px !important;
}

/* Fix modal info (opis utworu) - black border, no gap, 30% wider, ROUNDED corners WITHOUT arcs */
.player-container .modal-info-content {
    width: 1040px !important; /* 800px + 30% = 1040px */
    max-width: 90vw !important;
    border: 2px solid #000000 !important; /* Black border */
    border-radius: 12px !important; /* Rounded corners on content itself */
    box-shadow: none !important;
    padding: 0 !important;
    overflow: hidden !important; /* CRITICAL: Clip header/body to prevent arcs */
    background: #FFFFFF !important; /* White background behind everything */
}

/* Modal info header - rounded ONLY on top, white background to cover arcs */
.player-container .modal-info-header {
    padding: 20px 60px 20px 20px !important;
    margin: 0 !important;
    background: #FFFFFF !important; /* Solid white to cover potential black gaps */
    border-radius: 10px 10px 0 0 !important; /* Slightly smaller radius to fit inside parent */
}

/* Modal info body - rounded ONLY on bottom, white background */
.player-container .modal-info-body {
    padding: 20px !important;
    margin: 0 !important;
    background: #FFFFFF !important;
    border-radius: 0 0 10px 10px !important; /* Slightly smaller radius */
}

/* Modal info close button - RED circle, white bg, RED X, hover: RED circle, RED bg, WHITE X - 10% SMALLER */
.player-container .modal-info-close,
.player-container .modal-info-overlay .modal-info-close,
#modal-info .modal-info-close,
#modal-legend .modal-info-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important; /* 40px - 10% = 36px */
    height: 36px !important;
    border-radius: 50% !important;
    background: #FFFFFF !important; /* WHITE background */
    border: 2px solid #E30613 !important; /* RED circle */
    color: #E30613 !important; /* RED X */
    font-size: 18px !important; /* Smaller X to fit */
    line-height: 1 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    position: absolute !important;
    top: 15px !important;
    right: 13px !important; /* 15px - 2px = 13px - PRZESUNIĘTE W PRAWO */
    z-index: 200 !important; /* HIGHER than header to always be on top */
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.player-container .modal-info-close:hover,
.player-container .modal-info-overlay .modal-info-close:hover,
#modal-info .modal-info-close:hover,
#modal-legend .modal-info-close:hover {
    background: #E30613 !important; /* RED background */
    color: #FFFFFF !important; /* WHITE X */
    border-color: #E30613 !important; /* RED circle */
}

/* Fix ALL other close buttons - WHITE circle, BLACK bg, WHITE X, hover: WHITE circle, RED bg, WHITE X - 10% SMALLER */
.player-container .modal-close,
.player-container .modal-overlay .modal-close,
#modal-create-playlist .modal-close,
#modal-rename-playlist .modal-close,
#modal-delete-playlist .modal-close,
#modal-add-to-playlist .modal-close,
#modal-move-to-playlist .modal-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important; /* 40px - 10% = 36px */
    height: 36px !important;
    border-radius: 50% !important;
    background: #000000 !important; /* BLACK background */
    border: 2px solid #FFFFFF !important; /* WHITE circle */
    color: #FFFFFF !important; /* WHITE X */
    font-size: 18px !important; /* Smaller X to fit */
    line-height: 1 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 100 !important;
}

.player-container .modal-close:hover,
.player-container .modal-overlay .modal-close:hover,
#modal-create-playlist .modal-close:hover,
#modal-rename-playlist .modal-close:hover,
#modal-delete-playlist .modal-close:hover,
#modal-add-to-playlist .modal-close:hover,
#modal-move-to-playlist .modal-close:hover {
    background: #E30613 !important; /* RED background */
    color: #FFFFFF !important; /* WHITE X stays */
    border-color: #FFFFFF !important; /* WHITE circle stays */
}

/* Modal subtitle - smaller gray text under title */
.modal-subtitle {
    font-size: 14px !important;
    color: #AAAAAA !important;
    margin: -8px 0 16px 0 !important;
    font-weight: normal !important;
}

/* Fix modal for ADD TO PLAYLIST and MOVE TO PLAYLIST - force black bg, white border, rounded corners, 15% WIDER */
#modal-add-to-playlist .modal-content,
#modal-move-to-playlist .modal-content {
    min-width: 575px !important;
    max-width: 575px !important;
    background: #000000 !important; /* CZARNE tło */
    border: 2px solid #FFFFFF !important; /* BIAŁA ramka */
    border-radius: 8px !important;
    padding: 30px !important;
    box-sizing: border-box !important;
}

/* Nagłówki i podtytuły w tych modalach */
#modal-add-to-playlist h3,
#modal-move-to-playlist h3 {
    color: #FFFFFF !important;
    font-size: 24px !important;
    margin: 0 0 10px 0 !important;
}

#modal-add-to-playlist .modal-subtitle,
#modal-move-to-playlist .modal-subtitle,
#modal-add-to-playlist p.modal-subtitle,
#modal-move-to-playlist p.modal-subtitle {
    color: #FFFFFF !important;
    font-size: 14px !important;
    margin-bottom: 20px !important;
    opacity: 0.8 !important;
}

/* Force styles for playlist list inside these modals */
#modal-add-to-playlist .modal-playlist-list,
#modal-move-to-playlist .modal-playlist-list {
    background: transparent !important;
    padding: 12px 0 !important;
    margin: 16px 0 !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

/* USUNIĘTO - duplikat, nowa definicja jest na dole pliku */

/* Force title color in these modals */
#modal-add-to-playlist h3,
#modal-move-to-playlist h3 {
    color: #FFFFFF !important;
    margin: 0 0 16px 0 !important;
}

/* ========================================
   MAIN PLAYER STYLES
   ======================================== */

/* Spłaszczenie playera - brak zaznaczania, kopiowania, przeciągania */
.player-container,
.player-container * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* Wyjątki dla pól tekstowych (wyszukiwarka, input playlist) */
.player-container input[type="text"],
.player-container textarea {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Wyjątki dla draggable elementów (kolejka, ulubione, playlisty, ZAKŁADKI PLAYLIST) */
.player-container .track-item[draggable="true"],
.player-container .queue-item[draggable="true"],
.player-container .favorite-item[draggable="true"],
.player-container .playlist-track-item[draggable="true"],
.player-container .playlist-tab[draggable="true"] {
    -webkit-user-drag: element !important;
    cursor: move;
}

/* CSS Variables - Design System */
:root {
    /* Colors */
    --player-bg: #FFFFFF;
    --player-bg-secondary: #F5F5F5;
    --color-primary: #E30613;
    --color-secondary: #000000;
    
    /* Text */
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-muted: #999999;
    
    /* UI Elements */
    --border-color: #DDDDDD;
    --hover-bg: #F0F0F0;
    --active-bg: #FFE5E7;
    
    /* Progress Bar */
    --progress-bg: #DDDDDD;
    --progress-fill: #E30613;
    
    /* Icons */
    --icon-color: #E30613;
    --icon-inactive: #CCCCCC;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Cover Size */
    --cover-size: 250px;
}

/* Container */
.player-container {
    background: var(--player-bg);
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    padding: 0;
    font-family: var(--font-family);
    max-width: 1200px;
    margin: 0 auto;
    /* Fix: przycina dzieci do zaokraglonych rogow — eliminuje biale "trojkaciki" w narozach playera.
       Pelne rozwiazanie bialego tla = refactor color systemu (light->dark theme), wymaga osobnego ticketu. */
    overflow: hidden;
}

/* Main Player Section */
.player-main {
    display: flex;
    gap: var(--spacing-xl);
    margin-bottom: 0;
    padding: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid rgba(51, 51, 51, 0.1);
}

.player-cover-section {
    flex-shrink: 0;
}

.player-cover {
    width: var(--cover-size);
    height: var(--cover-size);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.player-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Animation removed - okładka nie obraca się */

.player-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.player-info {
    margin-bottom: var(--spacing-md);
}

.player-track-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-sm) 0;
}

.player-track-meta {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700; /* POGRUBIONY licznik utworów */
}

/* Progress Bar */
.player-progress-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.player-time-current,
.player-time-remaining {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
    font-weight: 700; /* POGRUBIONE czasy utworu */
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: #000000;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.progress-bar-fill {
    height: 100%;
    background: var(--progress-fill);
    border-radius: 3px;
    width: 0%;
    transition: none;
}

.progress-bar-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 50%;
    left: 0%;
    opacity: 1;
    cursor: pointer;
    transition: none;
}

.progress-bar-container {
    cursor: pointer;
}

/* ============================================
   CONTROLS - PRZEPROJEKTOWANE PRZYCISKI
   ============================================ */

.player-controls {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

/* Primary Controls: desktop = display:contents (buttony wpadają do .player-controls jako jedna linia)
   Mobile/tablet = display:flex (override w breakpointach) */
.player-controls-primary {
    display: contents;
}

/* Secondary Controls: desktop = display:contents
   Mobile/tablet = display:grid (override w breakpointach) */
.player-controls-secondary {
    display: contents;
}

/* BAZOWE STYLE PRZYCISKÓW */
.control-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 44px;
    height: 44px;
    outline: none !important;
}

.control-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.control-btn svg {
    width: 24px;
    height: 24px;
}

/* HOVER - bez żadnych efektów */
.control-btn:hover {
    /* Brak animacji - tylko cursor pointer */
}

/* ============================================
   1. PLAY/PAUSE - NAJWIĘKSZY, Z OKRĘGIEM
   ============================================ */

.control-btn-play {
    width: 56px;
    height: 56px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    order: -10;
}

.control-btn-play svg {
    width: 28px;
    height: 28px;
}

.control-btn-play[data-state="playing"] .icon-play {
    display: none;
}

.control-btn-play[data-state="playing"] .icon-pause {
    display: block !important;
}

/* ============================================
   2. PREVIOUS - wyrównany do Mode (44px)
   ============================================ */

.control-btn-previous {
    width: 48px; /* 44px + 10% = 48.4px ≈ 48px */
    height: 48px;
    padding: 0;
}

.control-btn-previous svg,
.control-btn-previous .previous-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
}

/* ============================================
   3. NEXT - wyrównany do Mode (44px)
   ============================================ */

.control-btn-next {
    width: 48px; /* 44px + 10% = 48px */
    height: 48px;
    padding: 0;
}

.control-btn-next svg,
.control-btn-next .next-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
}

/* ============================================
   4. MODE - IDENTYCZNY ROZMIAR I STYL JAK PREVIOUS/NEXT
   ============================================ */

.control-btn-mode {
    width: 48px; /* 44px + 10% = 48px */
    height: 48px;
    padding: 0;
}

.control-btn-mode svg,
.control-btn-mode .mode-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
}

/* Ukryj/pokaż ikony w zależności od trybu */
.control-btn-mode .icon-continuous {
    display: block;
}

.control-btn-mode .icon-single {
    display: none;
}

.control-btn-mode[data-mode="single"] .icon-continuous {
    display: none;
}

.control-btn-mode[data-mode="single"] .icon-single {
    display: block;
}

/* ============================================
   5. SHUFFLE - GRAFIKA PNG Z PRZEZROCZYSTYM TŁO
   ============================================ */

.control-btn-shuffle {
    width: 48px; /* 44px + 10% = 48px */
    height: 48px;
    padding: 0;
}

.control-btn-shuffle svg,
.control-btn-shuffle .shuffle-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
    display: none; /* Ukryj domyślnie */
}

/* OFF - CZERWONA grafika (Dodaj-podtytul-2.png) */
.control-btn-shuffle[data-shuffle="off"] .shuffle-off-img {
    display: block !important; /* Pokazuj OFF */
    filter: none !important; /* CZERWONA! Bez grayscale */
    opacity: 1 !important; /* CZERWONA! */
    mix-blend-mode: darken !important;
}

.control-btn-shuffle[data-shuffle="off"] .shuffle-on-img {
    display: none !important; /* Ukryj ON */
}

/* ON - CZERWONA grafika (ewvfwr.png) */
.control-btn-shuffle[data-shuffle="on"] .shuffle-on-img {
    display: block !important; /* Pokazuj ON */
    filter: none !important; /* CZERWONA! Bez grayscale */
    opacity: 1 !important; /* CZERWONA! */
    mix-blend-mode: darken !important;
}

.control-btn-shuffle[data-shuffle="on"] .shuffle-off-img {
    display: none !important; /* Ukryj OFF */
}

/* ============================================
   6. REPEAT - GRAFIKI PNG DLA TRZECH STANÓW
   ============================================ */

.control-btn-repeat {
    width: 48px; /* 44px + 10% = 48px */
    height: 48px;
    padding: 0;
}

.control-btn-repeat .repeat-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
    display: none;
}

/* OFF - CZERWONA grafika (DOMYŚLNIE WIDOCZNA) - BEZ wyszarzenia! */
.control-btn-repeat .repeat-off-img {
    display: block !important; /* ZAWSZE widoczna */
    filter: none !important; /* CZERWONA! Bez grayscale */
    opacity: 1 !important; /* CZERWONA! Bez opacity */
    mix-blend-mode: darken !important;
}

.control-btn-repeat[data-repeat="off"] .repeat-off-img {
    display: block !important;
    filter: none !important; /* CZERWONA! */
    opacity: 1 !important; /* CZERWONA! */
    mix-blend-mode: darken !important;
}

.control-btn-repeat[data-repeat="off"] .repeat-one-img,
.control-btn-repeat[data-repeat="off"] .repeat-all-img {
    display: none !important;
}

/* ONE (1x) - czerwona grafika */
.control-btn-repeat[data-repeat="one"] .repeat-one-img {
    display: block !important;
    filter: none !important;
    opacity: 1 !important;
}

.control-btn-repeat[data-repeat="one"] .repeat-off-img,
.control-btn-repeat[data-repeat="one"] .repeat-all-img {
    display: none !important;
}

/* ALL - czerwona grafika */
.control-btn-repeat[data-repeat="all"] .repeat-all-img {
    display: block !important;
    filter: none !important;
    opacity: 1 !important;
}

.control-btn-repeat[data-repeat="all"] .repeat-off-img,
.control-btn-repeat[data-repeat="all"] .repeat-one-img {
    display: none !important;
}

/* ============================================
   7. CROSSFADE - ROZMIAR JAK SHUFFLE/REPEAT
   ============================================ */

.control-btn-crossfade {
    width: 48px; /* 44px + 10% = 48px */
    height: 48px;
    padding: 0;
}

.control-btn-crossfade svg,
.control-btn-crossfade .crossfade-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
}

.control-btn-crossfade[data-crossfade="off"] .crossfade-img {
    filter: none;
    opacity: 1;
    mix-blend-mode: darken;
}

.control-btn-crossfade[data-crossfade="on"] .crossfade-img {
    filter: none;
    opacity: 1;
    mix-blend-mode: darken;
}

/* Disabled (tryb Single) - ten sam odcień co OFF */
.control-btn-crossfade.disabled .crossfade-img {
    filter: grayscale(100%);
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    mix-blend-mode: darken;
}

.crossfade-time {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: var(--color-primary);
}

.control-btn-crossfade[data-crossfade="on"] .crossfade-time {
    display: flex;
}

/* ============================================
   8. DELAY - GRAFIKI PNG DLA KAŻDEGO STANU
   ============================================ */

.control-btn-delay {
    width: 48px; /* 44px + 10% = 48px */
    height: 48px;
    padding: 0;
}

.control-btn-delay .delay-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
    display: none;
}

/* 0s - czerwona grafika */
.control-btn-delay[data-delay="0"] .delay-0s-img {
    display: block;
    filter: none;
    opacity: 1;
}

/* 5s - czerwona grafika */
.control-btn-delay[data-delay="5"] .delay-5s-img {
    display: block;
    filter: none;
    opacity: 1;
}

/* 10s - czerwona grafika */
.control-btn-delay[data-delay="10"] .delay-10s-img {
    display: block;
    filter: none;
    opacity: 1;
}

/* 20s - czerwona grafika */
.control-btn-delay[data-delay="20"] .delay-20s-img {
    display: block;
    filter: none;
    opacity: 1;
}

/* 30s - czerwona grafika */
.control-btn-delay[data-delay="30"] .delay-30s-img {
    display: block;
    filter: none;
    opacity: 1;
}

/* ============================================
   9. VOLUME - GRAFIKI PNG + SLIDER
   ============================================ */

.volume-control {
    position: relative;
    display: inline-block;
}

.control-btn-volume {
    width: 48px; /* 44px + 10% = 48px */
    height: 48px;
    padding: 0;
}

.control-btn-volume .volume-mute-img,
.control-btn-volume .volume-low-img,
.control-btn-volume .volume-high-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
    display: none;
}

/* Mute - gdy volume = 0 lub muted = true */
.control-btn-volume[data-volume="0"] .volume-mute-img,
.control-btn-volume[data-muted="true"] .volume-mute-img {
    display: block;
}

/* Volume Low - 1-50% */
.control-btn-volume[data-muted="false"][data-volume-level="low"] .volume-low-img {
    display: block;
}

/* Volume High - 51-100% */
.control-btn-volume[data-muted="false"][data-volume-level="high"] .volume-high-img {
    display: block;
}

.volume-slider {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #000000;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid #333333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10000;
}

/* Pokazuj suwak przy hover/focus/.show-slider class - BEZ DELAY gdy pokazujemy */
.volume-control:hover .volume-slider,
.volume-control:focus-within .volume-slider,
.volume-control.show-slider .volume-slider {
    opacity: 1 !important;
    pointer-events: all !important;
    transition: opacity 0.2s ease 0s;
}

/* Utrzymuj suwak widoczny gdy kursor jest NA suwaku */
.volume-slider:hover,
.volume-slider.is-dragging {
    opacity: 1 !important;
    pointer-events: all !important;
    transition: opacity 0.2s ease 0s;
}

/* Delay tylko przy chowaniu — krotki delay zeby user mial szanse zlapac slider, ale nie blokujacy */
.volume-slider {
    transition: opacity 0.2s ease 0.3s;
}

.volume-track {
    position: relative;
    width: 10px;
    height: 120px;
    background: #333333;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 auto;
}

.volume-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #E30613;
    border-radius: 5px;
    pointer-events: none;
}

.volume-thumb {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E30613;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    z-index: 10001;
    bottom: 15px;
    pointer-events: all;
    opacity: 1;
}

.volume-thumb:active {
    cursor: grabbing;
    transform: translateX(-50%) scale(1.1);
}

/* ============================================
   9B. FADE OUT - NOWY PRZYCISK
   ============================================ */

.control-btn-fadeout {
    width: 44px;
    height: 44px;
    padding: 0;
}

.control-btn-fadeout .fadeout-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
}

/* Fade Out OFF (szary) - gdy nic nie gra */
.control-btn-fadeout[data-fadeout="off"] .fadeout-img {
    filter: none;
    opacity: 1;
}

/* Fade Out ACTIVE (czerwony) - gdy coś gra */
.control-btn-fadeout[data-fadeout="active"] .fadeout-img {
    filter: none;
    opacity: 1;
}

/* ============================================
   10. QUICK PLAY - GRAFIKA PNG
   ============================================ */

.control-btn-quickplay {
    width: 48px; /* 44px + 10% = 48px */
    height: 48px;
    padding: 0;
}

.control-btn-quickplay .quickplay-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
}

/* Quick Play ON (czerwony) */
.control-btn-quickplay[data-quickplay="on"] .quickplay-img {
    filter: none;
    opacity: 1;
}

/* Quick Play OFF (szary) */
.control-btn-quickplay[data-quickplay="off"] .quickplay-img {
    filter: grayscale(100%);
    opacity: 0.5;
}

/* ============================================
   11. INFO - STANDARD
   ============================================ */

.control-btn-info,
.control-btn-legend {
    width: 48px; /* 44px + 10% = 48px */
    height: 48px;
    padding: 0;
}

.control-btn-info .info-img,
.control-btn-legend .legend-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: darken;
}

/* Tabs */
.player-tabs-section {
    margin-bottom: 0;
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    min-height: 150px;
    border-bottom: 1px solid rgba(51, 51, 51, 0.1);
    background: #000000;
}

.player-tabs {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: nowrap;
    background: #000000;
    padding: 0 var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    align-items: center;
    justify-content: flex-start; /* Zakładki wyrównane do lewej */
}

/* User Playlists Scroll */
.player-user-playlists-scroll {
    overflow-x: auto;
    white-space: nowrap;
    padding: var(--spacing-lg);
    padding-top: 0;
    padding-bottom: var(--spacing-md);
    margin: 0;
    background: #000000;
    min-height: 80px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Gdy brak user-playlist (kontener pusty — żadnych dzieci) — kolapsuj scroll
   i jego parenta, by nie zostawiać czarnej przerwy między zakładkami a filtrami. */
.player-user-playlists-scroll:empty {
    min-height: 0;
    padding: 0;
}

/* Parent tabs-section ma globalnie min-height: 150px (miejsce na user-playlist).
   Gdy scroll-container w środku jest pusty — kolapsuj również parenta. */
.player-tabs-section:has(.player-user-playlists-scroll:empty) {
    min-height: 0;
}

.player-user-playlists-scroll::-webkit-scrollbar {
    height: 8px;
}

.player-user-playlists-scroll::-webkit-scrollbar-track {
    background: #000000;
}

.player-user-playlists-scroll::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

.player-user-playlists-scroll::-webkit-scrollbar-thumb:hover {
    background: #c00511;
}

.player-tab,
.player-tab-add {
    background: transparent;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    font-size: var(--text-base);
    color: #FFFFFF;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 700;
    outline: none;
}

.player-tab:focus,
.player-tab-add:focus {
    outline: none;
    box-shadow: none;
}

.player-tab:hover,
.player-tab-add:hover {
    color: #FFFFFF;
    background: #1a1a1a;
}

.player-tab.active {
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-primary);
    border-left: none;
    border-right: none;
    border-top: none;
    background: transparent !important;
    font-weight: 700;
}

/* Playlists mają czerwone tło nawet gdy active */
.playlist-tab.active {
    background: var(--color-primary) !important;
    color: white !important;
    border-color: white !important;
    border-bottom: 2px solid transparent !important;
}

.player-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Filters */
.player-filters {
    display: flex;
    gap: var(--spacing-md);
    margin: 0;
    margin-bottom: 0;
    flex-wrap: wrap;
    align-items: flex-start; /* B6: nieotwarty dropdown nie rośnie razem z otwartym sąsiadem */
    background: #000000;
    padding: var(--spacing-md);
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: none;
}

/* Nieaktywny kontener filtrów (inline display:none od jQuery .hide()) musi pozostać ukryty
   także w mobile, gdzie reguły @media wymuszają display:grid !important na .player-filters. */
.player-filters[style*="display: none"],
.player-filters[style*="display:none"] {
    display: none !important;
}

/* Custom Dropdown - Wrapper */
.filter-dropdown-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

/* Custom Dropdown - Header (Nagłówek) */
.filter-dropdown-header {
    padding: var(--spacing-md);
    background: var(--color-primary);
    border-radius: 12px;
    font-size: var(--text-sm);
    color: white;
    cursor: pointer;
    font-weight: 700;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Biały trójkąt po prawej stronie */
.filter-dropdown-header::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 0 7px 12px;
    border-color: transparent transparent transparent white;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    margin-left: 8px;
}

/* Nagłówek gdy lista jest otwarta - dolne rogi ostre i trójkąt obrócony w dół */
.filter-dropdown-wrapper.open .filter-dropdown-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.filter-dropdown-wrapper.open .filter-dropdown-header::after {
    transform: rotate(90deg);
}

/* Custom Dropdown - Lista rozwijana (POD nagłówkiem)
 * Overlay: position:absolute nad tracklistą, nie wypycha layoutu w dół. */
.filter-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    background: #C74741;
    border-radius: 12px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    max-height: 0;
    overflow: hidden;
}

/* Lista otwarta - pokazuje się (max 6 opcji visible, reszta scroll) */
.filter-dropdown-wrapper.open .filter-dropdown-list {
    max-height: calc(48px * 6);
    overflow-y: auto;
}

/* Custom Dropdown - Opcje w liście */
.filter-dropdown-option {
    padding: var(--spacing-md);
    padding-right: var(--spacing-xl);
    color: white;
    font-weight: 700;
    font-size: var(--text-sm);
    cursor: pointer;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.1s ease;
    position: relative;
}

.filter-dropdown-option:first-child {
    border-top: none;
}

.filter-dropdown-option:hover {
    background: rgba(0, 0, 0, 0.1);
}

.filter-dropdown-option.selected {
    background: rgba(0, 0, 0, 0.2);
}

.filter-dropdown-option.selected::after {
    content: '✓';
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 18px;
    font-weight: 700;
}

/* Custom Dropdown - Scrollbar */
.filter-dropdown-list::-webkit-scrollbar {
    width: 8px;
}

.filter-dropdown-list::-webkit-scrollbar-track {
    background: #C74741;
}

.filter-dropdown-list::-webkit-scrollbar-thumb {
    background: white;
    border-radius: 4px;
}

.filter-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #f0f0f0;
}

/* Active Filters (Pills) */
.active-filters-container {
    position: relative;
    display: flex;
    gap: var(--spacing-sm);
    margin: 0;
    overflow-x: auto;
    white-space: nowrap;
    padding: var(--spacing-lg);
    padding-right: 200px;
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-lg);
    background: #000000;
    border-bottom: none;
    min-height: 80px;
    align-items: center;
}

.active-filters-container::-webkit-scrollbar {
    height: 8px;
}

.active-filters-container::-webkit-scrollbar-track {
    background: #000000;
}

.active-filters-container::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

.active-filters-container::-webkit-scrollbar-thumb:hover {
    background: #c00511;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: #000000;
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: var(--text-sm);
    flex-shrink: 0;
    font-weight: 700;
    border: 2px solid white;
}

/* Pigułki MNIEJSZE w fullscreen */
.fullscreen-mode .filter-badge {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 20px !important;
}

.filter-badge button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: 4px;
}

.clear-all-filters-btn,
.btn-clear-queue,
.btn-clear-favorites {
    background: #000000;
    color: white;
    border: 2px solid white;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: var(--text-sm);
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 700;
}

.clear-all-filters-btn {
    position: absolute;
    right: var(--spacing-lg);
}

.clear-all-filters-btn:hover,
.btn-clear-queue:hover,
.btn-clear-favorites:hover {
    background: #1a1a1a;
}

/* Tracklist */
.player-tracklist-container {
    margin: 0;
    padding: 0;
    background: #000000;
    height: calc(60px * 10) !important; /* BEZWZGLĘDNA stała wysokość */
    min-height: calc(60px * 10) !important;
    max-height: calc(60px * 10) !important;
}

.player-tab-content {
    display: none;
}

.player-tab-content.active {
    display: block;
}

.player-tracklist {
    height: calc(60px * 10) !important;
    min-height: calc(60px * 10) !important; /* BEZWZGLĘDNA wysokość */
    max-height: calc(60px * 10) !important;
    overflow-y: auto !important;
    background: #000000;
    padding: 0;
    margin: 0;
}

/* Czerwony scrollbar dla tracklisty */
.player-tracklist::-webkit-scrollbar {
    width: 8px;
}

.player-tracklist::-webkit-scrollbar-track {
    background: #000000;
}

.player-tracklist::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

.player-tracklist::-webkit-scrollbar-thumb:hover {
    background: #c00511;
}

.track-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid #333333;
    cursor: pointer;
    transition: background 0.2s;
    background: #000000;
    color: #FFFFFF;
}

.track-item:hover {
    background: #1a1a1a;
}

.track-item.playing,
.track-item.active {
    background: #1a1a1a;
}

.track-item.playing .track-title {
    color: var(--color-primary);
}

/* Czerwony TYTUŁ i CZAS dla aktywnego utworu (wszystkie typy tracklist) */
.track-item.active .track-title,
.queue-item.active .track-title,
.favorite-item.active .track-title,
.playlist-track-item.active .track-title {
    color: #E30613 !important; /* Taki sam czerwony jak wszystkie inne elementy */
    font-weight: 700;
}

.track-item.active .track-duration,
.queue-item.active .track-duration,
.favorite-item.active .track-duration,
.playlist-track-item.active .track-duration {
    color: #E30613 !important; /* Taki sam czerwony jak wszystkie inne elementy */
    font-weight: 700;
}

.track-number {
    font-size: var(--text-sm);
    color: #FFFFFF;
    min-width: 30px;
    text-align: center;
}

/* PUNKT 2: Track Number Wrapper + Play Icon */
.track-number-wrapper {
    position: relative;
    min-width: 30px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    pointer-events: auto !important; /* v16: ZAWSZE klikalne! */
    z-index: 100 !important; /* v16: NA WIERZCHU! */
}

.track-number-wrapper * {
    pointer-events: auto !important; /* WSZYSTKIE dzieci klikalne! */
}

.track-number-text {
    font-size: calc(var(--text-sm) * 1.2); /* PUNKT 2: +20% */
    color: #FFFFFF;
    transition: opacity 0.2s;
}

.track-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
    color: #FFFFFF;
    cursor: pointer !important;
    pointer-events: auto !important; /* v14: MUSI być klikalne! */
}

.track-play-icon * {
    pointer-events: auto !important; /* SVG path też klikalne! */
    cursor: pointer !important;
}

/* Hover track-item: ukryj numer, pokaż BIAŁĄ ikonę */
.track-item:hover .track-number-text {
    opacity: 0;
}

.track-item:hover .track-play-icon {
    opacity: 1;
    color: #FFFFFF; /* Biała na hover track-item */
}

/* PUNKT 1: Hover KONKRETNIE NA IKONIE → CZERWONA + 29px */
.track-number-wrapper:hover .track-play-icon {
    color: #E30613 !important; /* Czerwona TYLKO na hover ikony! */
    width: 29px !important; /* v13: Ta sama wielko ść co biała */
    height: 29px !important;
}

/* Active (zaznaczony): ukryj numer, pokaż CZERWONĄ ikonę */
.track-item.active .track-number-text {
    opacity: 0;
}

.track-item.active .track-play-icon {
    opacity: 1;
    color: #E30613; /* PUNKT 1: Czerwona już przy zaznaczeniu! */
}

/* PAUSED (zatrzymany): ukryj numer, pokaż BIAŁĄ ikonę play */
.track-item.paused .track-number-text {
    opacity: 0;
}

.track-item.paused .track-play-icon {
    opacity: 1;
    color: #FFFFFF; /* Biała play icon */
}

/* PAUSED + hover na ikonie: CZERWONA */
.track-item.paused .track-number-wrapper:hover .track-play-icon {
    color: #E30613 !important;
}

.track-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.track-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-info-inline {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: #FFFFFF;
    /* ZAWSZE w jednej linii! */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 0 4px 0;
}

.track-categories {
    display: none;
}

.track-duration {
    font-size: var(--text-sm);
    color: #FFFFFF;
    min-width: 50px;
    text-align: center;
}

.track-actions {
    display: flex;
    gap: 12px;
}

.track-actions button {
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 24px;
    height: 24px;
    position: relative;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    pointer-events: auto !important;
    z-index: 100 !important;
    overflow: visible;
}

/* Wymuszenie klikalności przycisku + */
.track-actions .btn-add-to-playlist {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 101 !important;
}

.track-actions button:hover,
.track-actions button:focus,
.track-actions button:active,
.track-actions button:focus-visible {
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
}

.track-actions .btn-add-to-playlist,
.track-actions .btn-favorite,
.track-actions .btn-add-to-queue,
.track-actions .btn-info,
.track-actions .btn-remove-from-queue {
    background: transparent !important;
}

.track-actions .btn-add-to-playlist:hover,
.track-actions .btn-favorite:hover,
.track-actions .btn-add-to-queue:hover,
.track-actions .btn-info:hover,
.track-actions .btn-remove-from-queue:hover,
.track-actions .btn-add-to-playlist:focus,
.track-actions .btn-favorite:focus,
.track-actions .btn-add-to-queue:focus,
.track-actions .btn-info:focus,
.track-actions .btn-remove-from-queue:focus {
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.track-actions button img {
    width: 24px;
    height: 24px;
    display: block;
    transition: none;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none !important;
}

/* Domyślnie - pokaż icon-default (SVG białe) */
.track-actions button .icon-default {
    display: block;
    pointer-events: none !important;
    filter: brightness(0) invert(1);
    opacity: 1;
}

.track-actions button .icon-hover,
.track-actions button .icon-active {
    display: none;
    pointer-events: none !important;
}

/* Hover - pokaż icon-hover (PNG czerwone) */
.track-actions button:hover .icon-default {
    display: none;
}

.track-actions button:hover .icon-hover {
    display: block;
    filter: none;
    opacity: 1;
}

/* Favorite active - pokaż icon-active */
.track-actions .btn-favorite.is-favorite .icon-default,
.track-actions .btn-favorite.is-favorite .icon-hover {
    display: none;
}

.track-actions .btn-favorite.is-favorite .icon-active {
    display: block;
}

/* Favorite active hover - pozostaw icon-active */
.track-actions .btn-favorite.is-favorite:hover .icon-active {
    display: block;
}

/* Queue icons - CZERWONA ikona gdy w kolejce (is-in-queue) */
.track-actions .btn-add-to-queue .icon-default {
    display: block;
}

.track-actions .btn-add-to-queue .icon-hover {
    display: none;
}

.track-actions .btn-add-to-queue:hover .icon-default {
    display: none;
}

.track-actions .btn-add-to-queue:hover .icon-hover {
    display: block;
}

/* Queue active (is-in-queue) - CZERWONA ikona zawsze */
.track-actions .btn-add-to-queue.is-in-queue .icon-default,
.track-actions .btn-add-to-queue.is-in-queue .icon-hover {
    display: none;
}

.track-actions .btn-add-to-queue.is-in-queue .icon-hover {
    display: block !important; /* CZERWONA ikona */
}

/* Stare dashicons - ukryj */
.track-actions .dashicons {
    display: none;
}

/* Menu trzech kropek (dla mobile) - domyślnie ukryte */
.track-actions-menu-btn {
    display: none !important; /* Ukryte na desktop */
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 24px !important;
    height: 24px !important;
    position: relative !important;
    font-size: 20px !important;
    color: #FFFFFF !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.track-actions-menu-btn:hover {
    color: #E30613 !important;
}

/* Dropdown menu dla ikon akcji (mobile) */
.track-actions-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px;
    z-index: 10000;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.track-actions-dropdown.active {
    display: block !important;
}

.track-actions-dropdown button {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px !important;
    background: transparent !important;
    border: none !important;
    color: #FFFFFF !important;
    text-align: left;
    cursor: pointer !important;
    border-radius: 4px;
    font-size: 14px !important;
    height: auto !important;
}

.track-actions-dropdown button:hover {
    background: rgba(227, 6, 19, 0.2) !important;
}

.track-actions-dropdown button img {
    width: 20px !important;
    height: 20px !important;
    position: static !important;
}

/* Search Section */
.player-search-section {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    background: #000000;
    padding: var(--spacing-lg) var(--spacing-xl);
    margin: 0;
    padding-bottom: calc(var(--spacing-xl) * 1.5);
    border-radius: 0 0 10px 10px; /* Match bottom corners with player-container border-radius (12px - 2px for border) */
}

.player-search-input,
#player-search,
input#player-search.player-search-input {
    flex: 1;
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    font-size: var(--text-base);
    color: #000000 !important; /* BLACK text */
    background: #FFFFFF !important; /* WHITE background */
    background-color: #FFFFFF !important;
    -webkit-text-fill-color: #000000 !important;
}

.player-search-input::placeholder,
#player-search::placeholder {
    color: #999999 !important; /* GRAY placeholder */
    opacity: 1 !important;
}

.player-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-fullscreen {
    padding: 8px 16px;
    background: var(--color-primary);
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.2s;
    height: 40px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto; /* Wyrównany do prawej strony */
}

.btn-fullscreen:hover {
    background: #C00510;
}

.btn-fullscreen .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Utility */
.no-tracks {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-size: var(--text-base);
}

/* No Results from Search */
/* Unified empty/message styles */
.no-results,
.queue-empty-message,
.no-favorites-message,
.empty-tracklist-message {
    text-align: center;
    padding: var(--spacing-lg);
    color: white;
    font-size: var(--text-base);
    font-weight: 400;
    opacity: 0.7;
    width: 100%;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* No Playlists - special case (inside .player-user-playlists-scroll which has its own padding) */
.no-playlists {
    text-align: center;
    color: white;
    font-size: var(--text-base);
    font-weight: 400;
    opacity: 0.7;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-results p {
    margin: 0 0 var(--spacing-md) 0;
    font-size: var(--text-base);
    color: white;
}

.no-results strong {
    color: white;
}

.clear-search-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--text-sm);
    transition: background 0.2s;
}

.clear-search-btn:hover {
    background: #C00510;
}

/* Highlight in search results */
mark {
    background: #FFEB3B;
    color: var(--text-primary);
    font-weight: 700;
    padding: 2px 0;
}

/* Queue specific styles */
.queue-header {
    padding: var(--spacing-md);
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.queue-item {
    position: relative;
}

.queue-item[draggable="true"] {
    cursor: move;
}

.drag-handle {
    color: var(--text-muted);
    cursor: move;
    padding: 0 var(--spacing-sm);
    font-size: 18px;
    user-select: none;
}

/* Playlists specific styles */
.playlist-tab {
    position: relative;
    /* Fix Sebastian: padding-right zwiekszony z 60 na 78, bo: X btn (right:10, w:24)+edit btn (right:40, w:24) = edit lewa krawedz na 64 od prawej.
       60px padding bylo za malo — text nazwy playlisty wchodzi pod ikone olowka. 78px zostawia 14px buforu. */
    padding: 10px 78px 10px 20px;
    background: var(--color-primary);
    color: white;
    border-radius: 50px;
    border: 2px solid var(--color-primary);
    margin-right: 8px;
    font-weight: 700;
}

.playlist-tab:hover {
    background: #C00510 !important;
    color: white !important;
    border-color: #C00510 !important;
}

.playlist-tab.active {
    border: 2px solid white !important;
    background: var(--color-primary) !important;
    color: white !important;
}

.playlist-name {
    display: inline-block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 15px;
}

.edit-playlist-btn,
.delete-playlist-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #E30613;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.edit-playlist-btn {
    right: 40px;
    transform: translateY(-50%) scaleX(-1);
    /* Same as delete button - red bg, white icon */
}

.edit-playlist-btn:hover,
.delete-playlist-btn:hover {
    background: white;
    color: #E30613;
    border-color: white;
}

/* no-playlists now inherits from unified styles above */

/* Context Menu (Playlist Add) */
/* NEW: Playlist Add Menu (Plus Button) */
.playlist-add-menu {
    position: fixed;
    background: #000000;
    border: 1px solid #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    min-width: 220px;
    max-width: 320px;
    overflow: hidden;
}

.playlist-add-menu-header {
    padding: 14px 16px;
    background: #E30613;
    color: white;
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid #FFFFFF;
}

.playlist-add-menu-item {
    padding: 12px 16px;
    color: white;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-add-menu-item:last-child {
    border-bottom: none;
}

.playlist-add-menu-item:hover {
    background: #C74741;
}

.playlist-add-menu-item.empty {
    cursor: default;
    opacity: 0.6;
    text-align: center;
}

.playlist-add-menu-item.empty:hover {
    background: transparent;
}

/* Modals — uwaga: .modal-overlay jest finalnie definiowany niżej (z-index 100000 wygrywa) */

.modal-content {
    background: #000000;
    padding: var(--spacing-xl);
    border-radius: 12px;
    min-width: 500px;
    max-width: 90%;
    position: relative;
    border: 2px solid #FFFFFF;
    box-sizing: border-box;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-close:hover {
    color: var(--color-primary);
}

.modal-content h3 {
    margin: 0 0 var(--spacing-lg) 0;
    color: #FFFFFF;
}

.modal-content p {
    color: #FFFFFF;
    margin: 0 0 var(--spacing-lg) 0;
    line-height: 1.5;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #333333;
    border-radius: 6px;
    font-size: var(--text-base);
    margin-bottom: var(--spacing-lg);
    background: #1a1a1a;
    color: white;
    box-sizing: border-box;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: #C00510;
}

.btn-secondary {
    background: var(--player-bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

.btn-danger {
    background: var(--color-primary); /* Same red as btn-primary */
    color: white;
}

.btn-danger:hover {
    background: #C00510; /* Same hover as btn-primary */
}

/* Playlist selection list in modal */
#playlist-selection-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: var(--spacing-lg);
}

/* New modal playlist list (for add to playlist / move to playlist) */
.modal-playlist-list {
    max-height: 400px;
    overflow-y: auto;
    margin: var(--spacing-md) 0;
}

/* Czerwony scrollbar dla modalu playlisty (jak w info modal) */
.modal-playlist-list::-webkit-scrollbar {
    width: 8px;
}

.modal-playlist-list::-webkit-scrollbar-track {
    background: #000000;
}

.modal-playlist-list::-webkit-scrollbar-thumb {
    background: #E30613;
    border-radius: 4px;
}

.modal-playlist-list::-webkit-scrollbar-thumb:hover {
    background: #c00511;
}

/* Firefox scrollbar */
.modal-playlist-list {
    scrollbar-width: thin;
    scrollbar-color: #E30613 #000000;
}

/* USUNIĘTO - generyczna definicja, używamy specyficznych selektorów z ID modala */

.modal-empty-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: var(--spacing-lg) 0;
}

/* Tracklist loading indicator */
.tracklist-loading {
    text-align: center;
    padding: var(--spacing-xl) 0;
    color: #666;
    font-size: var(--text-base);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.playlist-selection-item {
    margin-bottom: var(--spacing-sm);
}

.btn-select-playlist {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--player-bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--text-base);
    text-align: left;
    transition: all 0.2s;
}

.btn-select-playlist:hover {
    background: var(--hover-bg);
    border-color: var(--color-primary);
}

/* Hidden */
#player-audio {
    display: none;
}

/* ============================================
   INFO MODAL - SZCZEGÓŁOWE INFORMACJE O UTWORZE
   ============================================ */

.modal-info-content {
    width: 800px;
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-radius: 12px;
}

.modal-info-content::-webkit-scrollbar {
    width: 6px;
}

.modal-info-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-info-content::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

.modal-info-close {
    z-index: 100;
    width: 35px;
    height: 35px;
    font-size: 28px;
    line-height: 33px;
    top: 15px;
    right: 15px;
    background: #FFFFFF;
    color: #E30613;
    border: 2px solid #E30613;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-info-close:hover {
    background: #E30613;
    color: #FFFFFF;
    border-color: #E30613;
}

.modal-info-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 60px 20px 20px;
    border-bottom: 1px solid #dddddd;
    background: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 12px 12px 0 0;
}

.info-cover {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.info-title {
    font-size: 24px;
    margin: 0;
    color: #000000;
    flex: 1;
}

.modal-info-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    background: #FFFFFF;
    color: #000000;
}

.modal-info-body::-webkit-scrollbar {
    width: 8px;
}

.modal-info-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-info-body::-webkit-scrollbar-thumb {
    background: #E30613;
    border-radius: 4px;
}

/* Grid Layout 2x2 */
.info-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px 30px;
    margin-bottom: 30px;
}

.info-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    font-weight: 700;
    font-size: var(--text-sm);
    color: #000000;
    text-transform: none;
    letter-spacing: 0;
}

.info-value {
    font-size: var(--text-base);
    color: #000000;
}

/* Full Width Sections */
.info-full-width-section {
    margin-bottom: 25px;
}

.info-full-width-section .info-label {
    display: block;
    margin-bottom: 10px;
}

.info-description {
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: var(--text-base);
    color: #000000;
}

/* Materials Section - continuous text */
.info-materials-section {
    margin-bottom: 25px;
}

.info-materials-label {
    display: block;
    margin-bottom: 10px;
}

.info-materials {
    font-size: var(--text-base);
    line-height: 1.6;
    color: #000000;
    white-space: pre-wrap;
}

/* Categories - białe pilki z czarną obramówką */
.info-categories span,
.info-categories .category-pill {
    display: inline-block;
    background: #FFFFFF;
    color: #000000;
    border: 2px solid #000000;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: var(--text-sm);
    margin-right: 8px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* PDFs Section */
.info-pdfs-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdf-link {
    color: #E30613;
    text-decoration: none;
    font-weight: 600;
}

.pdf-link:hover {
    text-decoration: underline;
}

.info-pdfs a,
.info-pdfs .pdf-link {
    color: var(--color-primary);
    text-decoration: underline;
    font-size: var(--text-base);
    font-weight: normal;
    transition: color 0.2s;
    display: block;
    margin-bottom: 6px;
}

.info-pdfs a:hover,
.info-pdfs .pdf-link:hover {
    color: #c00511;
}

.info-categories span {
    display: inline-block;
    background: var(--player-bg-secondary);
    padding: 4px 12px;
    margin: 4px;
    border-radius: 20px;
    font-size: var(--text-sm);
}

.info-pdfs a {
    color: var(--color-primary);
    text-decoration: underline;
    display: block;
    margin: 8px 0;
}

.info-tracklist {
    margin-top: 20px;
}

.info-tracklist h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.info-tracklist ol,
.info-tracklist ul {
    margin-left: 20px;
}

.info-tracklist li {
    margin: 8px 0;
    line-height: 1.5;
}

/* ============================================
   COUNTDOWN BAR - DELAY OPÓŹNIENIA
   ============================================ */

/*
 * .countdown-bar — UWAGA: domyślnie ukrywany przez inline style="display:none" w
 * templates/player-main.php (jQuery .fadeIn() polega na tym żeby zachować flex layout;
 * gdyby default w CSS był display:none, fadeIn ustawiłby inline display:block i rozjechał gap/align).
 * Nie usuwać inline style w HTML bez zmiany JS na .css('display','flex').animate(...).
 */
.countdown-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 2px solid var(--color-primary);
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.countdown-text {
    font-size: var(--text-base);
    color: var(--text-primary);
}

.countdown-seconds {
    font-weight: bold;
    font-size: 18px;
    color: var(--color-primary);
}

.countdown-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
}

.countdown-close:hover {
    color: var(--text-primary);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: var(--text-sm);
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeInOut 3s ease-in-out;
    white-space: nowrap;
}

.toast.error {
    background: rgba(244, 67, 54, 0.9);
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ============================================
   RESPONSIVENESS - Media Queries
   ============================================ */

/* Desktop Extra Large (1400px and up) - wider player */
@media (min-width: 1400px) {
    .player-container {
        max-width: calc(100% - 80px);
        margin: 0 40px;
    }
}

/* Desktop Large (1024px and up) - default styles above */

/* Laptop / Tablet Landscape (768px - 1023px) */
@media (max-width: 1023px) {
    :root {
        --cover-size: 180px; /* Mniejsza okładka */
    }

    .player-container {
        max-width: 100%;
        /* Fix Sebastian: overflow visible — pozwala volume slider popup (position absolute, bottom 50px,
           wysokosc 152px = 202px ponad volume button) wyjsc poza container bez clippingu. Bez tego
           slider byl przycinany przez gorna krawedz containera na mobile. */
        overflow: visible;
        /* Fix Sebastian: zerowy horizontal padding — zapobiega bialym pasom po bokach (children maja czarny bg).
           Vertical padding zachowany zeby tytul i kontrolki nie byly przyciete przez border. */
        padding: var(--spacing-md) 0;
    }

    /* Tablet/mobile 0-1023: grid 2×2 dla filtrów (zapobiega asymetrycznemu 3+1 przy ~800px na tablecie) */
    .player-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* Bufor scrollu pod ostatnim trackiem — chroni przed zasłonięciem przez fixed footer nav motywu (60px) na tablecie/mobile */
    .player-tracklist {
        padding-bottom: 70px;
        box-sizing: content-box;
    }
    
    /* KOLUMNOWY LAYOUT PLAYERA */
    .player-main {
        flex-direction: column !important;
        align-items: center !important;
        gap: 14px !important;
        padding-bottom: 16px !important;
    }

    /* Okładka wycentrowana */
    .player-cover-section {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .player-cover {
        width: 180px !important;
        height: 180px !important;
    }

    /* Info section - pełna szerokość */
    .player-info-section {
        width: 100% !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .player-progress-bar {
        width: 100% !important;
        margin-bottom: 0 !important;
    }
    
    /* Tytuł - mniejsza czcionka */
    .player-track-title {
        font-size: 16px !important;
    }
    
    /* Progress bar - mniejszy */
    .player-progress {
        height: 4px !important;
    }
    
    /* Fix Sebastian: tabs wijaja sie na kolejne linie zamiast overflowac za prawa krawedz playera.
       Bez tego "Pelny widok" button (push margin-left:auto) wystawal poza container i byl ucinany. */
    .player-tabs {
        flex-wrap: wrap !important;
        row-gap: 8px !important;
    }
    .btn-fullscreen {
        margin-left: 0 !important; /* nie pcha do skrajnej prawej — wraps naturalnie */
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    /* Wrapper: column dla primary + secondary, stretch dzieci na 100% */
    .player-controls {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Primary: Play + Previous + Next + Volume w jednej linii */
    .player-controls-primary {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 24px !important;
        width: 100% !important;
        padding: 4px 0 !important;
        overflow: visible !important;
    }

    /* Secondary: grid 4×2 dla 8 przycisków */
    .player-controls-secondary {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 10px 8px !important;
        padding: 8px !important;
        justify-items: center !important;
        justify-content: stretch !important;
        width: 100% !important;
    }

    /* Fix Sebastian: WSZYSTKIE kontrolki identyczne — play, volume-control i pozostale tego samego rozmiaru.
       Bez tego play nakladal na okladke i wymusza asymetryczny layout w grid 4×3. */
    .control-btn,
    .control-btn-play,
    .volume-control {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        max-width: 52px !important;
        max-height: 52px !important;
        padding: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    .control-btn svg,
    .control-btn-play svg,
    .volume-control svg,
    .control-btn img,
    .control-btn-play img {
        width: 26px !important;
        height: 26px !important;
    }
    
    .control-btn-previous,
    .control-btn-next,
    .control-btn-mode,
    .control-btn-shuffle,
    .control-btn-repeat,
    .control-btn-crossfade,
    .control-btn-delay,
    .control-btn-volume,
    .control-btn-info,
    .control-btn-legend {
        width: 40px !important;
        height: 40px !important;
    }
    
    .control-btn-previous svg,
    .control-btn-previous .previous-img,
    .control-btn-next svg,
    .control-btn-next .next-img,
    .control-btn-mode svg,
    .control-btn-mode .mode-img,
    .control-btn-shuffle svg,
    .control-btn-shuffle .shuffle-img,
    .control-btn-shuffle .shuffle-off-img,
    .control-btn-shuffle .shuffle-on-img,
    .control-btn-repeat .repeat-img,
    .control-btn-crossfade svg,
    .control-btn-crossfade .crossfade-img,
    .control-btn-delay .delay-img,
    .control-btn-volume .volume-img,
    .control-btn-volume .volume-mute-img,
    .control-btn-info .info-img,
    .control-btn-legend .legend-img {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Playlist tabs - proporcjonalnie mniejsze */
    .playlist-tab {
        /* Fix Sebastian: padding-right zwiekszony z 45 na 75 — edit btn (right:40+w:24) wchodzil na text. */
        padding: 8px 75px 8px 14px !important;
        font-size: 12px !important;
        white-space: nowrap !important; /* Pełna nazwa w jednej linii */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: none !important; /* Pełna szerokość */
    }
    
    .playlist-tab .dashicons {
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
    }
}

/* Tablet Portrait (480px - 767px) */
@media (max-width: 767px) {
    :root {
        --cover-size: 140px; /* Mniejsza okładka */
        --spacing-xs: 3px;
        --spacing-sm: 6px;
        --spacing-md: 10px;
        --spacing-lg: 14px;
    }
    
    .player-container {
        /* Fix Sebastian: zerowy horizontal padding — eliminuje biale paski. Vertical 8px chroni tytul/kontrolki przed obcieciem. */
        padding: 8px 0 !important;
    }
    
    /* KOLUMNOWY LAYOUT PLAYERA */
    .player-main {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        padding-bottom: 16px !important;
    }

    /* Okładka wycentrowana */
    .player-cover-section {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .player-cover {
        width: 140px !important;
        height: 140px !important;
    }

    /* Info section - pełna szerokość */
    .player-info-section {
        width: 100% !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .player-progress-bar {
        width: 100% !important;
        margin-bottom: 0 !important;
    }
    
    /* Tytuł - mniejsza czcionka */
    .player-track-title {
        font-size: 14px !important;
    }
    
    /* Progress bar - mniejszy */
    .player-progress {
        height: 3px !important;
    }
    
    .player-tabs-section {
        padding: 0 !important;
    }
    
    /* Controls - NIE wrap, jedna linia! */
    .player-controls {
        flex-wrap: nowrap !important; /* ZAWSZE jedna linia! */
        gap: 4px !important;
        justify-content: flex-start !important;
        overflow-x: auto !important; /* Scroll jeśli się nie zmieszczą */
        overflow-y: hidden !important;
    }
    
    /* Przyciski - proporcjonalnie mniejsze */
    .control-btn {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important; /* Nie zmniejszaj przycisków */
    }
    
    .control-btn .dashicons {
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
    }
    
    .control-btn-play {
        width: 55px !important;
        height: 55px !important;
        flex-shrink: 0 !important;
    }
    
    .control-btn-play .dashicons,
    .control-btn-play svg {
        font-size: 30px !important;
        width: 30px !important;
        height: 30px !important;
    }
    
    .control-btn-previous,
    .control-btn-next,
    .control-btn-mode,
    .control-btn-shuffle,
    .control-btn-repeat,
    .control-btn-crossfade,
    .control-btn-delay,
    .control-btn-volume,
    .control-btn-info,
    .control-btn-legend {
        width: 34px !important;
        height: 34px !important;
    }
    
    .control-btn-previous svg,
    .control-btn-previous .previous-img,
    .control-btn-next svg,
    .control-btn-next .next-img,
    .control-btn-mode svg,
    .control-btn-mode .mode-img,
    .control-btn-shuffle svg,
    .control-btn-shuffle .shuffle-img,
    .control-btn-shuffle .shuffle-off-img,
    .control-btn-shuffle .shuffle-on-img,
    .control-btn-repeat .repeat-img,
    .control-btn-crossfade svg,
    .control-btn-crossfade .crossfade-img,
    .control-btn-delay .delay-img,
    .control-btn-volume .volume-img,
    .control-btn-volume .volume-mute-img,
    .control-btn-info .info-img,
    .control-btn-legend .legend-img {
        width: 34px !important;
        height: 34px !important;
    }
    
    .player-tab .dashicons {
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
    }
    
    /* Zakładki - grid 3×2, ale tylko pierwsze 4 widoczne dla Mixy/Dźwięki */
    .player-tabs {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        padding: 8px !important;
    }
    
    .player-tab,
    .player-tab-add {
        padding: 10px 6px !important;
        font-size: 11px !important;
        text-align: center !important;
        justify-content: center !important;
    }
    
    /* Playlist tabs - proporcjonalnie mniejsze */
    .playlist-tab {
        /* Fix Sebastian: padding-right zwiekszony z 40 na 70 — edit btn (right:40+w:24=64 od prawej) wchodzil na text. */
        padding: 6px 70px 6px 12px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .playlist-tab .dashicons {
        font-size: 14px !important;
        width: 14px !important;
        height: 14px !important;
    }
    
    /* UKRYJ ikony akcji, POKAŻ menu trzech kropek (dla tablet) */
    .track-actions .btn-add-to-playlist,
    .track-actions .btn-favorite,
    .track-actions .btn-add-to-queue,
    .track-actions .btn-info,
    .track-actions .btn-remove-from-queue {
        display: none !important; /* Ukryte na tablet */
    }
    
    .track-actions-menu-btn {
        display: block !important; /* Widoczne na tablet */
    }
    
    /* Track actions container - relative dla dropdown */
    .track-actions {
        position: relative !important;
    }
    
    /* UKRYJ przycisk Pełny widok w mobile */
    .btn-fullscreen {
        display: none !important;
    }
    
    /* Filtry - Grid 2×2 */
    .player-filters {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        padding: 12px 8px !important;
    }

    .filter-dropdown-wrapper {
        min-width: auto !important;
    }

    /* Dropdown list rozciąga się na pełną szerokość gridu (czytelność opcji
       z długimi nazwami) — wrapper z lewej kolumny rozszerza w prawo, z prawej w lewo. */
    .filter-dropdown-wrapper:nth-child(odd) .filter-dropdown-list {
        right: calc(-100% - 8px);
    }
    .filter-dropdown-wrapper:nth-child(even) .filter-dropdown-list {
        left: calc(-100% - 8px);
    }
    
    .filter-dropdown-header {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }
    
    .active-filters-container {
        padding: 8px !important;
        min-height: 60px !important;
    }
    
    /* Wrapper: column dla primary + secondary, stretch dzieci na 100% */
    .player-controls {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Primary: Play + Previous + Next + Volume w jednej linii */
    .player-controls-primary {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 20px !important;
        width: 100% !important;
        padding: 4px 0 !important;
        overflow: visible !important;
    }

    /* Secondary: grid 4×2 dla 8 przycisków */
    .player-controls-secondary {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 10px 8px !important;
        padding: 8px !important;
        justify-items: center !important;
        width: 100% !important;
    }

    /* Fix Sebastian: WSZYSTKIE buttony identyczne — play tez 56x56 (nie wieksze).
       Volume-control to wrapper a nie button, ale dziala jak button => same wymiary. */
    .control-btn,
    .control-btn-play,
    .volume-control {
        padding: 12px !important;
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        max-width: 56px !important;
        max-height: 56px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    .control-btn img,
    .control-btn svg,
    .control-btn-play img,
    .control-btn-play svg,
    .volume-control svg,
    .volume-control img {
        width: 28px !important;
        height: 28px !important;
    }
    
    /* Tracklista - bez miniatur, większe ikony akcji */
    .track-item {
        padding: 10px 8px !important;
        gap: 10px !important;
        font-size: var(--text-sm);
    }
    
    /* UKRYJ miniatury */
    .track-thumbnail {
        display: none !important;
    }
    
    /* Track number WIDOCZNY */
    .track-number {
        display: block !important;
        min-width: 30px !important;
        font-size: 13px !important;
    }
    
    /* Tytuł może się zawijać */
    .track-title {
        font-size: 14px !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        line-height: 1.3 !important;
    }
    
    /* Większe ikony akcji - łatwiejsze kliknięcie */
    .track-actions {
        gap: 8px !important;
    }
    
    .track-actions button {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    .track-actions button img {
        width: 24px !important;
        height: 24px !important;
    }
    
    .track-duration {
        font-size: 13px !important;
        min-width: 45px !important;
    }

    /* Tracklista — auto-height by kontener dopasował się do liczby utworów
       (zamiast stałych 600px = 10 wierszy). Scroll nadal aktywny od 10 utworów. */
    .player-tracklist-container {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .player-tracklist {
        height: auto !important;
        min-height: 0 !important;
        max-height: calc(60px * 10) !important;
    }
}

/* Mobile (max 479px) */
@media (max-width: 479px) {
    :root {
        --cover-size: 44px; /* 60% mniejsza (110px → 44px) */
    }
    
    .player-container {
        padding: 0 !important; /* Bez paddingu - czarne tło do obramowania */
        background: #000000 !important;
    }
    
    /* UKRYJ główny player - będzie tylko mini player */
    .player-main {
        display: none !important;
    }
    
    /* Okładka po lewej - fixed size */
    .player-cover-section {
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .player-cover {
        width: 44px !important;
        height: 44px !important;
    }
    
    /* Info section - proporcjonalnie mniejsza */
    .player-info-section {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
    }
    
    /* Tytuł - mniejsza czcionka */
    .player-track-title {
        font-size: 12px !important;
    }
    
    /* Progress bar - mniejszy */
    .player-progress {
        height: 2px !important;
    }
    
    /* Fix Sebastian: tu tez 4×3 grid (zamiast jednej linii scrollowanej) — wieksze buttony, lepiej dla touch */
    .player-controls {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 8px 6px !important;
        padding: 10px 4px !important;
        justify-items: center !important;
    }

    /* Fix Sebastian: buttony nadal wieksze nawet na bardzo malych ekranach */
    .control-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 10px !important;
    }
    
    .control-btn-play {
        width: 48px !important;
        height: 48px !important;
    }
    
    .control-btn-play svg {
        width: 26px !important;
        height: 26px !important;
    }
    
    .control-btn-previous,
    .control-btn-next,
    .control-btn-mode,
    .control-btn-shuffle,
    .control-btn-repeat,
    .control-btn-crossfade,
    .control-btn-delay,
    .control-btn-volume,
    .control-btn-info,
    .control-btn-legend {
        width: 30px !important;
        height: 30px !important;
    }
    
    .control-btn-previous svg,
    .control-btn-previous .previous-img,
    .control-btn-next svg,
    .control-btn-next .next-img,
    .control-btn-mode svg,
    .control-btn-mode .mode-img,
    .control-btn-shuffle svg,
    .control-btn-shuffle .shuffle-img,
    .control-btn-shuffle .shuffle-off-img,
    .control-btn-shuffle .shuffle-on-img,
    .control-btn-repeat .repeat-img,
    .control-btn-crossfade svg,
    .control-btn-crossfade .crossfade-img,
    .control-btn-delay .delay-img,
    .control-btn-volume .volume-img,
    .control-btn-volume .volume-mute-img,
    .control-btn-info .info-img,
    .control-btn-legend .legend-img {
        width: 30px !important;
        height: 30px !important;
    }
    
    /* Jeszcze mniejsze filtry */
    .filter-dropdown-header {
        padding: 8px 10px !important;
        font-size: 11px !important;
    }
    
    /* Jeszcze kompaktowsza tracklista */
    .track-item {
        padding: 8px 6px !important;
    }
    
    /* Track title - ZAWSZE w jednej linii (nowrap) */
    .track-title {
        font-size: 13px !important;
        white-space: nowrap !important; /* Jedna linia! */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* UKRYJ ikony akcji, POKAŻ menu trzech kropek */
    .track-actions .btn-add-to-playlist,
    .track-actions .btn-favorite,
    .track-actions .btn-add-to-queue,
    .track-actions .btn-info,
    .track-actions .btn-remove-from-queue {
        display: none !important; /* Ukryte na mobile */
    }
    
    .track-actions-menu-btn {
        display: block !important; /* Widoczne na mobile */
    }
    
    /* Track actions container - relative dla dropdown */
    .track-actions {
        position: relative !important;
    }
    
    /* Playlist tabs - proporcjonalnie mniejsze */
    .playlist-tab {
        padding: 5px 35px 5px 10px !important;
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .playlist-tab .dashicons {
        font-size: 12px !important;
        width: 12px !important;
        height: 12px !important;
    }
    
    /* Zakładki mniejsza czcionka */
    .player-tab,
    .player-tab-add {
        padding: 10px 6px !important;
        font-size: 11px !important;
    }
    
    /* MINI PLAYER (belka na dole ekranu jak Spotify) */
    .mobile-mini-player {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: #1a1a1a !important;
        border-top: 1px solid #333 !important;
        padding: 10px 16px !important;
        align-items: center !important;
        gap: 12px !important;
        z-index: 10000 !important;
        height: 64px !important;
    }
    
    .mobile-mini-player .mini-cover {
        width: 44px !important;
        height: 44px !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
    }
    
    .mobile-mini-player .mini-cover img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .mobile-mini-player .mini-info {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .mobile-mini-player .mini-title {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #FFFFFF !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
    }
    
    .mobile-mini-player .mini-artist {
        font-size: 12px !important;
        color: #999 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
    }
    
    .mobile-mini-player .mini-controls {
        display: flex !important;
        gap: 8px !important;
        align-items: center !important;
    }
    
    .mobile-mini-player .mini-btn {
        background: transparent !important;
        border: none !important;
        color: #FFFFFF !important;
        cursor: pointer !important;
        padding: 8px !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .mobile-mini-player .mini-btn svg {
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Tracklista - padding na dole dla mini playera */
    .player-tracklist-container {
        padding-bottom: 80px !important;
    }

    /* Tracklista - klik na utwór = play (bez ikony play) */
    .track-play-icon {
        display: none !important; /* Ukryj ikonę play */
    }
    
    .track-number-text {
        display: block !important; /* Pokaż numer */
    }
    
    /* Kliknięty utwór - pokaż pause zamiast numeru */
    .track-item.playing .track-number-text {
        display: none !important;
    }
    
    .track-item.playing .track-pause-icon {
        display: flex !important; /* Pokaż pause */
        position: static !important;
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Fale dźwiękowe MIĘDZY numerem a tytułem */
    .track-item.playing .track-sound-wave {
        display: flex !important;
        position: static !important;
        order: 2 !important; /* Po numerze/pause */
        margin-right: 8px !important;
    }
    
    .track-number-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .track-info-inline {
        order: 3 !important; /* Po falach */
    }
    
    /* FILTRY - tylko 4 pierwsze widoczne (grid 2×2) */
    .player-filters {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    /* Ukryj wszystkie filtry po 4-tym */
    .filter-dropdown-wrapper:nth-child(n+5) {
        display: none !important;
    }
    
    /* Playlisty - większa wysokość dla pełnej nazwy */
    .playlist-tab {
        min-height: 36px !important;
        padding: 8px 35px 8px 10px !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        white-space: normal !important; /* Zawijaj tekst */
        overflow: visible !important;
    }
}

/* ============================================
   PLUS BUTTON MENU (SIMPLEST APPROACH)
   ============================================ */

.amp-plus-menu {
    position: fixed;
    background: #111;
    color: #fff;
    border: 1px solid #333;
    border-radius: 10px;
    min-width: 220px;
    z-index: 99999;
    max-height: 60vh;
    overflow: auto;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.amp-plus-menu-header {
    padding: 0.6em 0.8em;
    border-bottom: 1px solid #2a2a2a;
    font-weight: 700;
    color: #bbb;
    font-size: 14px;
}

.amp-plus-menu-item {
    padding: 0.6em 0.8em;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
    color: #fff; /* White text for playlist names */
}

.amp-plus-menu-item:not(.amp-empty):hover {
    background: #1f1f1f;
}

.amp-plus-menu-item.amp-empty {
    opacity: 0.6;
    cursor: default;
}

/* Scrollbar for plus menu */
.amp-plus-menu::-webkit-scrollbar {
    width: 8px;
}

.amp-plus-menu::-webkit-scrollbar-track {
    background: #111;
    border-radius: 10px;
}

.amp-plus-menu::-webkit-scrollbar-thumb {
    background: #E30613;
    border-radius: 10px;
    border: 2px solid #111;
}

.amp-plus-menu {
    scrollbar-color: #E30613 #111;
    scrollbar-width: thin;
}

/* ============================================
   FULLSCREEN MODE - Same Layout, Scrollable Tracklist
   ============================================ */

.player-container.fullscreen-mode {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: visible !important; /* VISIBLE - dropdowny mogą wychodzić, ale kontener ma stałą wysokość więc nie scrolluje */
    box-sizing: border-box !important;
}

/* Hide body scroll in fullscreen */
body:has(.fullscreen-mode) {
    overflow: hidden !important;
}

/* Tabs - mniejsze odstępy */
.fullscreen-mode .player-tabs {
    gap: 6px !important;
}

/* User playlists scroll - mniejsze paddingi */
.fullscreen-mode #player-user-playlists-scroll {
    padding: 4px 0 !important;
    gap: 6px !important;
}

/* Filters - STAŁA WYSOKOŚĆ */
.fullscreen-mode .player-filters {
    flex: 0 0 auto !important;
    padding: 8px var(--spacing-md) !important;
    gap: 8px !important;
    overflow: visible !important;
    z-index: 100 !important;
}

/* Nagłówki kategorii - NORMALNY ROZMIAR */
.fullscreen-mode .filter-dropdown-header {
    padding: 12px 16px !important; /* NORMALNY ROZMIAR jak w widoku podstawowym */
    font-size: 14px !important; /* NORMALNY ROZMIAR */
    min-height: auto !important;
}

/* Active filters (pills) - STAŁA WYSOKOŚĆ z mniejszymi paddingami */
.fullscreen-mode .active-filters-container {
    flex: 0 0 auto !important;
    padding: 4px 10px !important;
}

.fullscreen-mode .filter-pill {
    padding: 3px 8px !important;
    font-size: 11px !important;
    height: 24px !important;
}

/* Filter pills container - STAŁA WYSOKOŚĆ */
.fullscreen-mode .filter-pills-container {
    flex: 0 0 auto !important;
    padding: 4px 10px !important;
    min-height: 28px !important;
}

/* KONTENER TRACKLISTY - ZAJMUJE CAŁĄ POZOSTAŁĄ PRZESTRZEŃ */
.fullscreen-mode .player-tracklist-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: visible !important; /* VISIBLE - żeby dropdowny z filtrów mogły wychodzić */
    display: flex !important;
    flex-direction: column !important;
}

/* TAB CONTENT - WŁASNY SCROLL WEWNĘTRZNY (cienki czerwony scrollbar) */
.fullscreen-mode .player-tab-content {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
    scrollbar-width: thin;
    scrollbar-color: #E30613 #111;
}

/* Wyłącz drugi scroll na wewnętrznej trackliście */
.fullscreen-mode .player-tracklist,
.fullscreen-mode #player-tracklist,
.fullscreen-mode #player-dzwieki,
.fullscreen-mode #player-queue,
.fullscreen-mode #player-favorites {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
}

/* Czerwony scrollbar w fullscreen - identyczny jak normalny */
.fullscreen-mode .player-tab-content::-webkit-scrollbar {
    width: 8px;
}

.fullscreen-mode .player-tab-content::-webkit-scrollbar-track {
    background: #000000;
}

.fullscreen-mode .player-tab-content::-webkit-scrollbar-thumb {
    background: #E30613;
    border-radius: 4px;
}

.fullscreen-mode .player-tab-content::-webkit-scrollbar-thumb:hover {
    background: #c00511;
}

/* Search bar - NA DOLE */
.fullscreen-mode .player-search-section {
    flex: 0 0 auto !important;
    order: 999 !important;
}

/* Fullscreen button - zaokrąglenie JAK nagłówki kategorii (12px) */
.btn-fullscreen {
    border-radius: 12px !important;
    border: none !important;
    outline: none !important;
    min-width: 120px !important; /* Identyczna szerokość dla obu trybów */
}

/* Usuń białe obramowanie przy focus/active */
.btn-fullscreen:focus,
.btn-fullscreen:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Fullscreen button - rozmiar w fullscreen mode */
.fullscreen-mode .btn-fullscreen {
    background: var(--color-primary) !important; /* IDENTICAL to normal "Pełny widok" */
    color: white !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    margin-right: 0 !important; /* Wyrównanie do prawej krawędzi nagłówka "Grupa" */
}

/* Hover dla przycisku "Zamknij" w fullscreen - IDENTICAL to normal hover */
.fullscreen-mode .btn-fullscreen:hover {
    background: #C00510 !important; /* IDENTICAL to normal "Pełny widok" hover */
    color: white !important;
}

/* Modal z playlistami - WIDOCZNY w fullscreen mode */
.fullscreen-mode .modal-overlay,
.player-container.fullscreen-mode .modal-overlay {
    z-index: 99999 !important; /* BARDZO WYSOKI - nad wszystkim */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.fullscreen-mode .modal-content,
.player-container.fullscreen-mode .modal-content {
    z-index: 100000 !important;
    position: relative !important;
}

/* ============================================
   DELIKATNA KOMPRESJA WYSOKOŚCI W FULLSCREEN
   ============================================ */

/* Okładka - mniejsza (jeszcze bardziej) */
.fullscreen-mode .player-cover {
    width: 150px !important;
    height: 150px !important;
}

.fullscreen-mode .player-cover img {
    width: 150px !important;
    height: 150px !important;
}

/* Header - mniejszy padding */
.fullscreen-mode .player-header {
    padding: 8px 12px !important;
}

.fullscreen-mode .player-cover-section {
    padding: 0 !important;
}

/* Info - mniejsze odstępy */
.fullscreen-mode .player-track-info h2 {
    font-size: 18px !important;
    margin-bottom: 4px !important;
}

.fullscreen-mode .player-track-info .track-meta {
    font-size: 12px !important;
}

.fullscreen-mode .player-info-section {
    padding: 0 10px !important;
}

/* Progress bar - mniejsze paddingi */
.fullscreen-mode .player-progress-bar {
    padding: 6px 0 !important;
    margin: 6px 0 !important;
}

.fullscreen-mode .player-time-current,
.fullscreen-mode .player-time-remaining {
    font-size: 11px !important;
}

/* Controls - mniejsze odstępy */
.fullscreen-mode .player-controls {
    padding: 8px 0 !important;
    gap: 16px !important; /* Doubled from 8px */
}

/* Przyciski kontrolne - nieco mniejsze */
.fullscreen-mode .control-btn {
    width: 42px !important; /* 38px + 10% = 41.8px ≈ 42px */
    height: 42px !important;
}

.fullscreen-mode .control-btn img {
    width: 42px !important; /* 38px + 10% = 42px */
    height: 42px !important;
}

.fullscreen-mode #btn-play-pause {
    width: 65px !important;
    height: 65px !important;
}

/* Track items - jeszcze mniejsza wysokość */
.fullscreen-mode .track-item {
    padding: 6px 10px !important;
    min-height: 42px !important;
}

.fullscreen-mode .track-thumbnail {
    width: 40px !important;
    height: 40px !important;
}

.fullscreen-mode .track-thumbnail img {
    width: 40px !important;
    height: 40px !important;
}

.fullscreen-mode .track-title {
    font-size: 13px !important;
    line-height: 1.3 !important;
}

.fullscreen-mode .track-duration {
    font-size: 12px !important;
}

.fullscreen-mode .track-number {
    font-size: 12px !important;
    min-width: 28px !important;
}

/* v17: Track number wrapper - proporcjonalnie mniejszy w fullscreen */
.fullscreen-mode .track-number-wrapper {
    min-width: 24px !important; /* 30px → 24px (80%) */
    height: 19px !important; /* 24px → 19px (80%) */
}

.fullscreen-mode .track-number-text {
    font-size: calc(var(--text-sm) * 0.96) !important; /* 1.2 → 0.96 (80%) */
}

.fullscreen-mode .track-play-icon {
    width: 23px !important; /* v18: ZAWSZE 23px (jak czerwona na hover) */
    height: 23px !important;
}

.fullscreen-mode .track-number-wrapper:hover .track-play-icon {
    width: 23px !important; /* 29px → 23px (80%) - TAK SAMO jak biała! */
    height: 23px !important;
}

.fullscreen-mode .track-pause-icon {
    width: 21px !important; /* v21: Zawsze 21px - biała pauza */
    height: 21px !important;
}

/* v21: Biała pauza gdy utwór gra (przed hoverem) */
.fullscreen-mode .track-item.playing .track-pause-icon {
    width: 21px !important;
    height: 21px !important;
}

.fullscreen-mode .track-sound-wave {
    width: 23px !important; /* v19: TAK SAMO jak play icon - WSZYSTKIE STANY */
    height: 23px !important;
}

/* v19: Paused + hover */
.fullscreen-mode .track-item.paused .track-play-icon {
    width: 23px !important;
    height: 23px !important;
}

.fullscreen-mode .track-item.paused .track-number-wrapper:hover .track-play-icon {
    width: 23px !important;
    height: 23px !important;
}

/* v19: Active (zaznaczony) */
.fullscreen-mode .track-item.active .track-play-icon {
    width: 23px !important;
    height: 23px !important;
}

/* v20: Playing + hover pause - 10% mniejsza niż play */
.fullscreen-mode .track-item.playing:hover .track-pause-icon {
    width: 21px !important;
    height: 21px !important;
}

.fullscreen-mode .track-item.playing .track-sound-wave {
    width: 23px !important;
    height: 23px !important;
}

/* Track actions - mniejsze ikony */
.fullscreen-mode .track-actions {
    gap: 4px !important;
}

.fullscreen-mode .track-actions button {
    width: 28px !important;
    height: 28px !important;
    padding: 3px !important;
}

.fullscreen-mode .track-actions img {
    width: 20px !important;
    height: 20px !important;
}

/* Filter dropdowns - wyższy z-index żeby były nad tracklistą */
.fullscreen-mode .filter-dropdown-list {
    z-index: 10000 !important;
}

.fullscreen-mode .filter-dropdown-wrapper {
    position: relative !important;
}

/* Player main (z filtrami) - OVERFLOW VISIBLE */
.fullscreen-mode .player-main {
    flex: 0 0 auto !important;
    overflow: visible !important;
    z-index: 50 !important;
}

/* Tabs section - OVERFLOW VISIBLE */
.fullscreen-mode .player-tabs-section {
    flex: 0 0 auto !important;
    padding: 6px 10px !important;
    overflow: visible !important;
    z-index: 50 !important;
}

/* Tabs - mniejsze */
.fullscreen-mode .player-tab {
    padding: 8px 14px !important;
    font-size: 14px !important;
}

/* "Nowa playlista" i "Dodaj z dysku" - TAKI SAM rozmiar jak pozostałe zakładki */
.fullscreen-mode .player-tab-add {
    padding: 8px 14px !important;
    font-size: 14px !important;
}

/* Playlist tabs - IDENTYCZNE jak normalny widok, tylko mniejszy padding */
.fullscreen-mode .playlist-tab {
    padding: 8px 50px 8px 16px !important; /* Normalne: 10px 60px 10px 20px */
    font-size: 13px !important;
}

.fullscreen-mode .playlist-name {
    font-size: 13px !important;
}

.fullscreen-mode .edit-playlist-btn,
.fullscreen-mode .delete-playlist-btn {
    width: 16px !important;
    height: 16px !important;
    font-size: 10px !important;
}

/* Wyszukiwarka - mniejsza wysokość */
.fullscreen-mode .player-search-section {
    padding: 6px 12px !important;
}

.fullscreen-mode .player-search-input,
.fullscreen-mode #player-search {
    padding: 8px 12px !important;
    font-size: 13px !important;
    height: 34px !important;
    box-sizing: border-box !important;
}

/* Logo in fullscreen - top right, RED with professional shadow/glow */
.player-logo-fullscreen {
    position: absolute;
    top: 12px; /* Margin from top */
    right: 12px; /* Margin from right */
    display: none !important; /* Hidden by default */
    z-index: 10;
}

.fullscreen-mode .player-logo-fullscreen {
    display: block !important; /* Show ONLY in fullscreen */
}

.player-logo-fullscreen img {
    height: auto;
    max-height: 50px; /* Small enough to not push anything down */
    width: auto;
    /* USUNIĘTO FILTR - oryginalne kolory z grafiki */
}

/* Legend button - separated from others, aligned right (TYLKO desktop) */
/* Fix Sebastian: tylko na desktop (>=1024px) — na mobile/tablet psulo grid 4×3 layout
   poprzez pchanie legendy do prawej krawedzi grid cell zamiast centrowania */
@media (min-width: 1024px) {
    .control-btn-legend {
        margin-left: auto !important; /* Push to right */
    }
}

/* ========================================
   LEGEND MODAL STYLES
   ======================================== */

/* FORCE legend modal header h3 to be visible */
#modal-legend .modal-info-header,
#modal-legend .modal-info-header h3 {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#modal-legend .modal-info-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: #FFFFFF !important;
    /* KRYTYCZNE: IDENTYCZNA wysokość jak w modal-info (okładka 80px + padding) */
    padding: 20px 60px 20px 20px !important;
    min-height: 120px !important; /* 80px okładka + 20px top + 20px bottom */
    display: flex !important;
    align-items: center !important; /* Wyśrodkuj tytuł pionowo */
    margin: 0 !important;
    border-bottom: 1px solid #DDDDDD !important;
    border-radius: 10px 10px 0 0 !important; /* Match info modal rounded top */
}

#modal-legend .modal-info-header h3 {
    text-align: center !important;
    font-size: 20px !important;
    font-weight: bold !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.legend-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 40px;
    margin: 20px 0;
    align-items: start; /* Align to top */
}

.legend-section {
    display: flex;
    flex-direction: column;
}

/* Ensure items in both columns have synchronized heights */
.legend-section .legend-item {
    height: auto; /* Auto height */
    display: flex;
    align-items: center; /* Center vertically */
    margin-bottom: 16px; /* Consistent spacing */
    box-sizing: border-box;
}

/* USUNIĘTO nth-child min-height rules - powodują nierówne odstępy
   Zamiast tego używamy stałego margin-bottom dla WSZYSTKICH */

.legend-section h4 {
    color: #000000;
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #E30613;
}

.legend-note {
    display: none !important; /* KRYTYCZNE: Ukryj całkowicie - nie jest potrzebne */
}

/* KRYTYCZNE: Wyrównaj prawą kolumnę z lewą (Play = SPACJA) */
.legend-shortcuts {
    position: relative; /* Dla absolutnego pozycjonowania noty */
}

.legend-shortcuts .legend-item:first-of-type {
    margin-top: 0 !important; /* RESET - zaczynamy od 0 */
}

/* WSZYSTKIE legend-item mają IDENTYCZNE odstępy */
.legend-section .legend-item {
    margin-bottom: 16px !important; /* Stały odstęp między WSZYSTKIMI */
    margin-top: 0 !important; /* RESET top margin */
}

.legend-controls .legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px !important; /* Force consistent spacing */
    margin-top: 0 !important;
}

.legend-shortcuts .legend-item {
    margin-bottom: 16px !important; /* Force consistent spacing */
    margin-top: 0 !important;
}

.legend-controls .legend-icon {
    font-size: 24px;
    min-width: 30px;
    text-align: center;
}

/* Wyrównanie ikony fullscreen (dashicon) */
.legend-controls .legend-icon .dashicons-fullscreen-alt {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-top: 3px !important; /* Obniż troszkę żeby była wyśrodkowana względem tekstu */
}

.legend-controls .legend-text strong {
    display: block;
    color: #000000;
    font-size: 14px;
    margin-bottom: 2px;
}

.legend-controls .legend-text p {
    color: #666666 !important;
    font-size: 12px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    display: block !important; /* MUSI być widoczny */
    opacity: 1 !important;
    visibility: visible !important;
}

.legend-shortcuts .legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.legend-key {
    display: inline-block;
    background: #E30613;
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.legend-key-desc {
    color: #000000;
    font-size: 13px;
}

.legend-track-icons {
    margin-top: 30px;
    padding-top: 0; /* USUNIĘTO padding - nie jest potrzebne */
    /* USUNIĘTO border-top - to była ta szara linia! */
    width: 100%;
}

.legend-track-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-track-icons .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-track-icons .legend-icon {
    font-size: 20px;
}

.legend-track-icons .legend-text {
    color: #000000;
}

/* Responsive adjustments for legend */
@media (max-width: 1100px) {
    .legend-container {
        flex-direction: column;
        gap: 30px;
    }
}

/* Fullscreen button in fullscreen mode - ABSOLUTE positioning to align with logo */
.fullscreen-mode .player-tabs {
    position: relative !important;
}

.fullscreen-mode .btn-fullscreen {
    position: absolute !important;
    right: 12px !important; /* Same as logo margin */
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}

/* Edit i Delete playlist buttons Z BIAŁYMI OKRĘGAMI */
.edit-playlist-btn,
.delete-playlist-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 4px;
    cursor: pointer;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 1) !important; /* BIAŁY okrąg */
    border-radius: 50%; /* Okrągły */
    background: transparent;
    color: #FFFFFF !important; /* BIAŁA ikona */
    opacity: 1 !important; /* ZAWSZE widoczna */
    transition: all 0.2s;
    padding: 0;
}

.edit-playlist-btn:hover,
.delete-playlist-btn:hover {
    border-color: rgba(255, 255, 255, 1) !important;
}

.delete-playlist-btn:hover {
    border-color: #E30613 !important;
    color: #E30613 !important;
}

/* MODALS - CRITICAL CSS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000; /* Bardzo wysoki z-index */
}

.modal-content {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    color: #FFFFFF !important; /* BIAŁY tekst */
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #FFFFFF !important; /* BIAŁY X */
    font-size: 24px;
    cursor: pointer;
    opacity: 1 !important; /* ZAWSZE widoczny */
    transition: color 0.2s;
}

.modal-close:hover {
    color: #E30613 !important; /* Czerwony na hover */
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #FFFFFF !important; /* BIAŁY nagłówek */
    font-size: 24px;
}

.modal-content p,
.modal-subtitle {
    color: #FFFFFF !important; /* BIAŁY tekst w paragrafach */
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #FFFFFF !important; /* BIAŁY tekst w input */
    border-radius: 4px;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-primary {
    background: #E30613;
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #C74741;
}

.btn-secondary {
    background: #444;
    color: #FFFFFF;
}

.btn-secondary:hover {
    background: #555;
}

/* Modal playlist list - WYŻSZA SPECYFICZNOŚĆ */
#modal-add-to-playlist .modal-playlist-list,
#modal-move-to-playlist .modal-playlist-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    background: transparent !important;
}

/* Playlist items - KONKRETNE SELEKTORY - NAJWYŻSZA SPECYFICZNOŚĆ */
/* ULTRA-SPECYFICZNY SELEKTOR - WSZYSTKIE MOŻLIWE KOMBINACJE */
.player-container #modal-add-to-playlist .modal-playlist-item,
.player-container #modal-move-to-playlist .modal-playlist-item,
#modal-add-to-playlist .modal-playlist-list .modal-playlist-item,
#modal-move-to-playlist .modal-playlist-list .modal-playlist-item,
body #modal-add-to-playlist .modal-playlist-item,
body #modal-move-to-playlist .modal-playlist-item {
    padding: 15px !important;
    background: #444444 !important; /* SZARE tło */
    background-color: #444444 !important; /* Backup */
    border: 2px solid #E30613 !important; /* CZERWONE obramowanie */
    border-radius: 4px !important;
    color: #FFFFFF !important; /* BIAŁY tekst */
    cursor: pointer !important;
    transition: all 0.2s !important;
    font-size: 16px !important;
    margin: 0 0 10px 0 !important;
    display: block !important;
    width: auto !important;
    min-height: 20px !important;
}

.player-container #modal-add-to-playlist .modal-playlist-item:hover,
.player-container #modal-move-to-playlist .modal-playlist-item:hover,
#modal-add-to-playlist .modal-playlist-list .modal-playlist-item:hover,
#modal-move-to-playlist .modal-playlist-list .modal-playlist-item:hover,
body #modal-add-to-playlist .modal-playlist-item:hover,
body #modal-move-to-playlist .modal-playlist-item:hover {
    background: #E30613 !important; /* CZERWONE tło */
    background-color: #E30613 !important;
    border: 2px solid #FFFFFF !important; /* BIAŁA ramka */
    color: #FFFFFF !important; /* BIAŁY tekst */
}

#modal-add-to-playlist .modal-empty-message,
#modal-move-to-playlist .modal-empty-message {
    color: #FFFFFF !important;
    text-align: center;
    padding: 20px;
}


/* ============================================
   v1.2.0: NOWE FUNKCJE (Fale + Pauza)
   ============================================ */

/* 1. TOASTY W FULLSCREEN - nad wyszukiwarką */
.fullscreen-mode .toast,
.fullscreen-mode .amp-toast,
.player-container.fullscreen-mode .toast,
.player-container.fullscreen-mode .amp-toast {
    position: fixed !important;
    top: auto !important; /* Wyłącz top */
    bottom: 80px !important; /* Nad wyszukiwarką (80px od dołu) */
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 999999 !important;
    display: block !important;
    /* ZACHOWAJ ORYGINALNY WYGLĄD */
    padding: 15px 25px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    white-space: nowrap !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
}

/* 2. ANIMOWANE FALE DŹWIĘKOWE (5 kresek) */
.track-sound-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 22px;
    height: 22px;
    opacity: 0;
    pointer-events: none;
}

.track-sound-wave span {
    width: 3px;
    background: #E30613; /* Czerwone kreski */
    border-radius: 2px;
    animation: pulse-wave 0.8s ease-in-out infinite;
}

/* Opóźnienia dla każdej kreski (efekt fali) */
.track-sound-wave span:nth-child(1) { animation-delay: 0s; height: 40%; }
.track-sound-wave span:nth-child(2) { animation-delay: 0.1s; height: 70%; }
.track-sound-wave span:nth-child(3) { animation-delay: 0.2s; height: 100%; }
.track-sound-wave span:nth-child(4) { animation-delay: 0.3s; height: 70%; }
.track-sound-wave span:nth-child(5) { animation-delay: 0.4s; height: 40%; }

@keyframes pulse-wave {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.7;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* 3. IKONA PAUZY (2 pionowe kreski) */
.track-pause-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 26px; /* v11: powiększone z 22px */
    height: 26px; /* v11: powiększone z 22px */
    opacity: 0;
    pointer-events: all; /* Musi być clickable! */
    cursor: pointer;
}

.track-pause-icon span {
    width: 4px;
    height: 18px; /* v11: powiększone z 16px */
    background: #FFFFFF; /* Białe kreski */
    border-radius: 2px;
    transition: background 0.2s;
}

/* 4. STANY IKON */

/* PLAYING: ukryj numer i play, pokaż FALE */
.track-item.playing .track-number-text,
.track-item.playing .track-play-icon {
    opacity: 0 !important;
}

.track-item.playing .track-sound-wave {
    opacity: 1;
}

/* PLAYING + HOVER: ukryj fale, pokaż PAUZĘ */
.track-item.playing:hover .track-sound-wave {
    opacity: 0;
}

.track-item.playing:hover .track-pause-icon {
    opacity: 1;
}

/* PLAYING + HOVER NA PAUZĘ: kreski CZERWONE */
.track-item.playing .track-pause-icon:hover span {
    background: #E30613 !important;
}

/* Koniec v1.2.0 */

/* ==========================================================================
   FIX: mobile-mini-player wyciekał na desktop
   Reguły z bloku 3207-3294 są wewnątrz @media (max-width: 479px),
   więc domyślny display: none nigdy nie obowiązywał >479px.
   Po kliknięciu utworu JS usuwa inline display:none → element się pokazywał.
   Override poza media query (najwyższy priorytet po pliku):
   ========================================================================== */
.mobile-mini-player {
    display: none !important;
}
@media (max-width: 479px) {
    .mobile-mini-player {
        display: flex !important;
    }
}
