/* --- RESET I BAZA --- */
* {
    box-sizing: border-box; /* Kluczowe dla poprawnego wymiarowania */
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    background-color: #ffeff5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrujemy wszystko w poziomie */
}

*:focus {
    outline: none;
}

/* --- TŁO --- */
#player-bg-artwork {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(25px) brightness(0.7);
    z-index: -2;
    transition: background-image 0.5s ease;
}

#player-bg-layer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.4); /* Biała mgiełka */
    z-index: -1;
}

/* --- GŁÓWNY KONTENER (Trzyma całość w ryzach) --- */
.main-wrapper {
    width: 100%;
    max-width: 420px; /* Maksymalna szerokość jak typowy telefon */
    padding: 20px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* --- 1. KATEGORIE (Przyciski na górze) --- */
#category-selector {
    display: flex;
    gap: 10px;
    flex-wrap:wrap;
    overflow-x: auto; /* Przewijanie palcem w bok */
    padding-bottom: 5px;
    scrollbar-width: none;
    justify-content: flex-start; /* Zacznij od lewej */
}

#category-selector::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    flex: 0 0 auto; /* Nie ściskaj przycisków */
    padding: 8px 16px;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    color: #54576f;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: 0.2s;
}

.cat-btn.active {
    background: #795548;
    color: #fff;
}

/* --- 2. KARTA ODTWARZACZA (Środek) --- */
#player {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 30px 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    text-align: center;
    position: relative;
    overflow: hidden; /* Żeby nic nie wystawało */
}

/* Okładka */
#album-art {
    width: 180px;
    height: 180px;
    margin: 0 auto 25px auto;
    border-radius: 20px; /* Zaokrąglony kwadrat wygląda nowocześniej */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    background: #ddd; /* Tło zanim załaduje się obrazek */
}

#album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Teksty */
#album-name {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

#track-name {
    color: #333;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pasek postępu (Seek Bar) */
#player-track {
    /* Resetujemy stare pozycjonowanie absolutne! */
    position: relative; 
    top: auto; right: auto; left: auto;
    padding: 0;
    background: transparent;
}

#seek-bar-container {
    position: relative;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 8px;
}

#seek-bar {
    height: 100%;
    background: #795548;
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s linear;
}

#s-hover {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,0.1);
}

#track-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
    margin-bottom: 20px;
}

/* Przyciski sterowania */
#player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 0 auto;
    width: 100%;
}

.control .button {
    width: 45px;
    height: 45px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: #555;
    transition: transform 0.2s;
}

.control .button:active {
    transform: scale(0.95);
}

#play-pause-button {
    width: 65px;
    height: 65px;
    background: #795548;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(121, 85, 72, 0.3);
}

/* --- 3. LISTA UTWORÓW (Dół) --- */
#track-list {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 10px 0;
    list-style: none;
    margin: 0;
}

.track-item {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    color: #444;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.track-item:last-child {
    border-bottom: none;
}

.track-item:hover {
    background: rgba(255,255,255,0.5);
}

.track-item.active {
    color: #795548;
    font-weight: bold;
    background: rgba(121, 85, 72, 0.1);
    border-left: 4px solid #795548;
}

/* Naprawa ikonek FontAwesome */
.fas {
    line-height: 1;
}