body { font-family: Arial, sans-serif; background: #111; color: #eee; margin: 0; padding: 20px; }
h1 { color: #9147ff; }
h2 { color: #ddd; font-size: 18px; }
.box { background: #1d1d1d; border: 1px solid #333; border-radius: 10px; padding: 15px; margin-bottom: 20px; }
.now-title { font-size: 22px; font-weight: bold; color: #fff; }
.muted { color: #aaa; font-size: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { border-bottom: 1px solid #333; padding: 8px; text-align: left; }
th { color: #bbb; font-size: 13px; text-transform: uppercase; }
.status-played { color: #2ecc71; }
.status-skipped { color: #f1c40f; }
.status-error { color: #e74c3c; font-weight: bold; }
.small { font-size: 13px; }
.queue-request { background: #3a1515; border-left: 3px solid #e74c3c; }
.badge-sr { background: #e74c3c; color: white; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; }
input[type=text] { padding: 8px; border-radius: 6px; border: 1px solid #333; background: #222; color: #eee; }
input[type=password] { padding: 8px; border-radius: 6px; border: 1px solid #333; background: #222; color: #eee; }
select { padding: 8px; border-radius: 6px; background: #222; color: #eee; border: 1px solid #333; }
button { background: #9147ff; color: white; border: none; padding: 10px 20px; border-radius: 6px; font-size: 14px; cursor: pointer; margin-top: 10px; }
button:hover { background: #7c2eff; }
button:disabled { background: #555; cursor: not-allowed; }
.small-btn { padding: 5px 10px; font-size: 12px; margin: 0 2px; }
.arrow-btn { padding: 5px 14px; font-size: 18px; margin: 0 2px; line-height: 1; }
#startButton { background: #2ecc71; }
#startButton:hover { background: #27ae60; }

/* ================= UTILITY / POMOCNICZE KLASY =================
   Te klasy zastapily atrybuty style="..." w index.html, dzieki czemu
   mozemy wlaczyc scisly Content-Security-Policy (style-src 'self')
   bez zadnych wyjatkow typu 'unsafe-inline'. */
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-15 { margin-top: 15px; }
.mb-12 { margin-bottom: 12px; }
.mb-15 { margin-bottom: 15px; }

.field-input { width: 100%; box-sizing: border-box; }
.field-label { display: block; margin-bottom: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 6px; margin-bottom: 15px; cursor: pointer; }
.sr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sr-row button { margin-top: 0; }
.btn-cancel { background: #555; margin-left: 10px; }

/* ================= MODALE (playlistModal, changePasswordModal, modeModal, appDialog) ================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
}
.modal-box {
    background: #1d1d1d;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 25px;
    max-width: 400px;
    margin: 100px auto;
}
.modal-title { color: #9147ff; margin-top: 0; }
.modal-text { color: #eee; margin-bottom: 15px; }

/* ================= ELEMENTY Z UNIKALNYM STYLEM (byly inline, teraz tu, po id) ================= */
/* #authLoggedIn - stan ukryty ustawiany teraz przez klase "hidden" w index.html */
#registerBtn { background: #555; }
#changePasswordBtn { background: #555; }
#logoutBtn { background: #c0392b; }
#loadModeButton { background: #16a085; }
#srInput { flex: 1; min-width: 300px; }
#searchInput { width: 50%; }
#cpMessage { margin-bottom: 10px; min-height: 16px; }
#modeMessage { margin-bottom: 10px; min-height: 16px; }
#appDialogMessage { color: #eee; margin-bottom: 15px; white-space: pre-wrap; }
/* ================= NOWE KLASY - zastepuja inline style="..." w app.js =================
   Chodzi o to, zeby JS NIGDY nie ustawial element.style.xxx bezposrednio - zamiast tego
   przelacza gotowe klasy CSS przez classList.add()/remove(). Dzieki temu CSP moze
   zablokowac WSZYSTKIE inline style bez zadnych wyjatkow (bez hash/nonce). */

.btn-locked { background: #c0392b !important; cursor: not-allowed !important; }
.rotated { transform: rotate(180deg); }

.playlist-arrow-icon { color: #9147ff; font-size: 18px; cursor: pointer; }
.playlist-name-toggle { flex: 1; font-weight: bold; cursor: pointer; }
.playlist-arrow-toggle { margin-left: 5px; cursor: pointer; }
.playlist-content { padding: 10px 15px; }
.playlist-controls-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.playlist-checkbox-label { display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* Kolory przyciskow - zastepuja usuniete inline style="background:...;" */
.btn-danger { background: #c0392b; }
.btn-warning { background: #e67e22; }
/* Karta pojedynczej playlisty - wczesniej inline style w renderPlaylists() */
.playlist-card { border: 1px solid #333; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.playlist-card-header { background: #2a2a2a; padding: 12px 15px; display: flex; align-items: center; gap: 10px; }

/* ================= UKLAD OBOK SIEBIE: Add song request + Search the library =================
   Oba boksy w jednej linii zamiast jeden pod drugim. 60/40 (SR/Search) - SR ma wiecej
   kontrolek (input+select+button w jednym rzedzie), wiec potrzebuje wiecej miejsca.
   Ponizej 900px laczy sie z powrotem w kolumne, zeby nie zgniatac formularzy na waskim ekranie. */
.row-split {
    display: flex;
    gap: 20px;
    align-items: stretch;
}
.row-split > .box {
    margin-bottom: 20px; /* ta sama wartosc co zwykle .box, dla spojnosci pionowej */
}
.col-sr { flex: 0 0 60%; }
.col-search { flex: 1; }

@media (max-width: 900px) {
    .row-split {
        flex-direction: column;
    }
    .col-sr, .col-search {
        flex: 1 1 auto;
    }
}