/* === RESET I GLOBALNE STYLE === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: #000; color: #b3b3b3; overflow: hidden; }
a { color: #b3b3b3; text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; }
ul { list-style: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }

/* === GŁÓWNY KONTENER APLIKACJI === */
.app-container { display: grid; grid-template-rows: 1fr auto; grid-template-columns: 240px 1fr; height: 100vh; width: 100vw; }

/* === PASEK BOCZNY (Sidebar) === */
.sidebar { grid-row: 1 / 2; grid-column: 1 / 2; background-color: #000; padding: 24px; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar-header { margin-bottom: 20px; }
.sidebar-header h3 { color: #fff; font-size: 1.5rem; }
.sidebar-nav li { margin-bottom: 10px; }
.sidebar-nav .nav-link { font-size: 1rem; font-weight: 600; padding: 5px 0; display: block; }
.sidebar-nav .nav-link.active { color: #fff; }
.sidebar-playlists { margin-top: 20px; border-top: 1px solid #282828; padding-top: 20px; flex-grow: 1; }
.sidebar-playlists h4 { text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.8px; margin-bottom: 10px; }
.sidebar-playlists ul li { margin-bottom: 8px; }
.sidebar-playlists .playlist-link { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* === GŁÓWNA ZAWARTOŚĆ (Main Content) === */
.main-content { grid-row: 1 / 2; grid-column: 2 / 3; background: linear-gradient(to bottom, #222, #121212 300px); overflow-y: auto; }
.main-header { padding: 20px 30px; display: flex; justify-content: flex-end; align-items: center; background-color: rgba(0,0,0,0.3); position: sticky; top: 0; z-index: 10; }
.user-info { font-size: 0.9rem; }
.user-info strong { color: #fff; }
.logout-btn { background-color: #1DB954; color: #fff; padding: 8px 15px; border-radius: 500px; margin-left: 15px; font-weight: 600; font-size: 0.8rem; }
.logout-btn:hover { background-color: #1ED760; color: #fff; }
.content-wrapper { padding: 20px 30px; }
.content-wrapper h2 { color: #fff; font-size: 2rem; margin-bottom: 20px; }
.songs-table { width: 100%; border-collapse: collapse; }
.songs-table th { text-align: left; color: #b3b3b3; font-size: 0.8rem; text-transform: uppercase; border-bottom: 1px solid #282828; padding: 10px; }
.songs-table td { padding: 12px 10px; border-bottom: 1px solid #282828; font-size: 0.9rem; }
.songs-table tr:hover { background-color: #282828; }
.songs-table td:first-child, .songs-table th:first-child { width: 50px; text-align: center; }
.songs-table td:nth-last-child(2), .songs-table th:nth-last-child(2) { width: 80px; text-align: center; } /* Dodaj do... */
.songs-table td:last-child, .songs-table th:last-child { width: 50px; text-align: center; } /* Usuń */
.play-btn, .add-to-playlist-btn, .delete-song-btn { font-size: 1.2rem; color: #1DB954; transition: transform 0.1s; }
.play-btn:hover, .add-to-playlist-btn:hover, .delete-song-btn:hover { color: #1ED760; transform: scale(1.2); }
#play-playlist-btn, .btn-spotify { 
    background-color: #1DB954; 
    color: #fff; 
    padding: 10px 20px; 
    border-radius: 500px; 
    font-weight: bold; 
    margin-bottom: 15px; 
    border: none;
}
#play-playlist-btn:hover, .btn-spotify:hover { 
    background-color: #1ED760; 
    color: #fff;
}


/* === PASEK ODTWARZACZA (Player Bar) === */
.player-bar {
    grid-row: 2 / 3;
    grid-column: 1 / -1; 
    background-color: #181818;
    border-top: 1px solid #282828;
    height: 90px;
    padding: 0 20px;
    display: flex; 
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

#audio-player { display: none; }

/* LEWA SEKCJA: Okładka i Info */
.player-left {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.player-album-art {
    width: 56px;
    height: 56px; 
    margin-right: 15px;
    overflow: hidden; 
}

#current-track-cover {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-radius: 4px;
}

.player-info {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    max-width: 150px; 
}
#current-track-title {
    color: #fff;
    font-weight: 600;
    display: block;
    text-overflow: ellipsis;
    overflow: hidden;
}
#current-track-musician {
    font-size: 0.8rem;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* ŚRODKOWA SEKCJA */
.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40%; 
    min-width: 300px;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px; /* Poprawka paska postępu */
}
.player-controls button { font-size: 1.2rem; color: #b3b3b3; }
.player-controls button:hover { color: #fff; }
#play-pause-btn { font-size: 2rem; color: #fff; }
#play-pause-btn:hover { transform: scale(1.1); }


.player-progress-container {
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 0.75rem;
    color: #b3b3b3;
}
.player-progress-container span {
    width: 40px;
    text-align: center;
}
#progress-bar {
    flex-grow: 1;
    margin: 0 10px;
}


/* PRAWA SEKCJA */
.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-grow: 1;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 150px; 
}
#volume-slider {
    flex-grow: 1;
}

/* Ujednolicone style dla suwaków */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #404040;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #1DB954;
    border-radius: 50%;
}
input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #1DB954;
    border-radius: 50%;
}


/* === Style dla formularzy logowania/rejestracji (z login.php i register.php) === */
.form-container {
    background-color: #181818;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    width: 400px;
    text-align: center;
}
.form-container h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
}
.form-container input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 4px;
    background-color: #282828;
    color: #fff;
    box-sizing: border-box; /* Ważne dla paddingu */
}
.form-container button {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 500px;
    background-color: #1DB954;
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.form-container button:hover {
    background-color: #1ED760;
}
.form-container .message { color: #E22134; margin-bottom: 1rem; }
.form-container .message.error { color: #E22134; margin-bottom: 1rem; }
.form-container .message.success { color: #1DB954; margin-bottom: 1rem; }
.form-container .switch-link {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}
.form-container .switch-link a {
    color: #1DB954;
    text-decoration: none;
}

/* === POPRAWKI STYLU MODALI (Bootstrap 5) === */
/* To nadpisze domyślne style Bootstrapa i naprawi wygląd okienek */

/* Główne tło okienka (Twój stary kolor #282828) */
.modal-content.bg-dark {
    background-color: #282828 !important;
}

/* Tło inputów (Twój stary kolor #333) */
.form-control.bg-secondary {
    background-color: #333 !important;
    border-color: #444 !important; /* Lekka ramka */
}
.form-control.bg-secondary:focus {
    background-color: #333 !important;
}

/* Kolor tła listy playlist (aby pasował) */
.list-group-item.bg-dark {
     background-color: #282828 !important;
}

/* Separatory w okienku (Twój stary kolor) */
.modal-header.border-secondary,
.modal-footer.border-secondary,
.list-group-item.border-secondary {
    border-color: #333 !important; 
}

/* Poprawka przycisków na liście playlist (NAPRAWIA CZARNY TEKST) */
.add-song-to-playlist-action.btn-link {
    width: 100%;
    text-align: left;
    color: #fff !important; /* Wymuszamy biały kolor */
    text-decoration: none;
    padding: 10px 5px;
    border-radius: 4px;
}
.add-song-to-playlist-action.btn-link:hover {
    background-color: #333; /* Twój stary kolor hover */
    text-decoration: none;
}