@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap");

/* ---------- Zmienne ---------- */
:root {
    --bg: #1c1a22;
    --surface: #26232e;
    --surface-2: #2f2b39;
    --line: #3b3647;
    --text: #d9d6e0;
    --muted: #9a95a8;
    --accent: #8b5cf6;
    --accent-hover: #a07cf8;
    --link: #b49cff;
    --header: #4a2590;
    --header-border: #3a1d73;
    --danger: #f0716f;
    --success: #5fc08a;
    --radius: 10px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ---------- Baza ---------- */
body {
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg);
}

#background {
    width: 100vw;
    height: 100vh;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

ul {
    float: left;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Roboto", sans-serif;
    font-weight: 300;
    letter-spacing: 0.01em;
}

h1 {
    width: 100%;
    margin: 0;
    padding: 22px 40px;
    overflow: auto;
    color: #fff;
    font-size: 1.9rem;
    background: linear-gradient(90deg, #6b2fc4 0%, #4a2590 100%);
}

/* ---------- Układ ---------- */
.module {
    float: left;
    width: 70vw;
    padding: 24px 28px;
}

/* ---------- Nagłówek ---------- */
#header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: var(--header);
    border-bottom: 4px solid var(--header-border);
}

#header .logo {
    justify-self: start;
    font-family: "Roboto", sans-serif;
    font-weight: 300;
    font-size: 24px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
}

#header a {
    color: #fff;
}

#header a:hover {
    color: #e6dcff;
    text-decoration: none;
}

/* wyszukiwarka */
#header .search {
    justify-self: center;
    display: flex;
    width: min(380px, 40vw);
}

#header .search input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 8px 0 0 8px;
}

#header .search button {
    padding: 8px 16px;
    font-weight: 500;
    background: var(--accent);
    border-radius: 0 8px 8px 0;
}

#header .search button:hover {
    color: #fff;
    background: var(--accent-hover);
}

/* menu po prawej */
#header .menu {
    justify-self: end;
    margin: 0;
    padding: 0;
}

#header .user {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px 14px;
}

#header .user form {
    display: inline;
}

#header button {
    padding: 0;
    font-size: 16px;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
}

#header button:hover {
    color: #e6dcff;
}

.tab {
    margin: 0;
}

/* ---------- Tabele ---------- */
table {
    border-collapse: collapse;
    overflow: hidden;
    border-radius: var(--radius);
}

table td,
table th {
    padding: 10px 24px;
    border: none;
    text-align: left;
}

table th {
    font-weight: 500;
    color: var(--muted);
    background: var(--surface-2);
}

table tr {
    border: none;
    background-color: var(--surface);
}

table tr:nth-child(even) {
    background-color: #2b2833;
}

table tbody tr:hover {
    background-color: var(--surface-2);
}

/* ---------- Odtwarzacz ---------- */
audio {
    width: 300px;
    max-width: 100%;
    border-radius: 7px;
    filter: invert(1);
    transition: transform 0.3s ease;
}
audio:hover,
audio:focus,
audio:active {
    transform: scale(1.01);
}

audio::-webkit-media-controls-enclosure {
    background-color: transparent;
}

div.list {
    position: fixed;
    z-index: 9999;
}

.playlists_list {
    background-color: var(--surface-2);
}

/* ---------- Formularze ---------- */
.card {
    max-width: 560px;
    margin-bottom: 20px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

form p {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 16px;
}

form label {
    font-size: 0.9rem;
    color: var(--muted);
}

form input[type="text"],
form input[type="url"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form select,
form textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

form input[type="file"] {
    padding: 8px;
    font: inherit;
    color: var(--muted);
    background: var(--bg);
    border: 1px dashed var(--line);
    border-radius: 8px;
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

form .errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
    color: var(--danger);
}

form .helptext {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ---------- Przyciski ---------- */
.btn,
form input[type="submit"],
form button[type="submit"] {
    display: inline-block;
    padding: 10px 20px;
    font: inherit;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn:hover,
form input[type="submit"]:hover,
form button[type="submit"]:hover {
    background: var(--accent-hover);
    text-decoration: none;
    color: #fff;
}

.btn-secondary {
    color: var(--link);
    background: transparent;
    border: 1px solid var(--line);
}

.btn-secondary:hover {
    color: #fff;
    background: var(--surface-2);
    border-color: var(--accent);
}

/* ---------- Komunikaty ---------- */
.messages {
    max-width: 560px;
    margin-top: 20px;
}

.message {
    margin-bottom: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}

.message-success {
    border-left-color: var(--success);
}

.message-error {
    border-left-color: var(--danger);
}

/* ---------- Dostępność ---------- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--accent-hover);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* ---------- Telefon / wąskie ekrany ---------- */
@media (max-width: 800px) {
    .module {
        float: none;
        width: auto;
        padding: 16px;
        margin: 1vw;
    }

    h1 {
        padding: 18px 20px;
    }


    #header {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }

    #header .search {
        justify-self: stretch;
        width: auto;
    }

    #header .menu {
        justify-self: start;
    }

    #header .user {
        justify-content: flex-start;
    }
}
.play-cell {
    width: 1%;
    padding-right: 0;
}

.play-btn {
    width: 38px;
    height: 38px;
    padding: 0 0 0 2px;
    font-size: 14px;
    line-height: 1;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.play-btn:hover {
    background: var(--accent-hover);
}

.play-btn:active {
    transform: scale(0.94);
}

.play-btn.is-playing {
    padding-left: 0;
    letter-spacing: -1px;
    background: var(--accent-hover);
}

.play-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* PLAYER BAR */
#player-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
}

.pb-main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 24px;
}

.pb-controls {
    display: flex;
    gap: 6px;
}

#player-bar button {
    color: #fff;
    background: transparent;
    border: 0;
    font-size: 18px;
    cursor: pointer;
}

#player-bar button:hover {
    color: var(--accent-hover);
}

#pb-toggle {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 50%;
    font-size: 15px;
}

#pb-toggle:hover {
    background: var(--accent-hover);
    color: #fff;
}

#pb-info {
    display: flex;
    flex-direction: column;
    flex: 0 1 240px;
    min-width: 0;
}

#player-title,
#pb-context {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#pb-context {
    font-size: 0.8rem;
    color: var(--muted);
}

.pb-seek {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--muted);
}

.pb-seek input[type="range"] {
    flex: 1;
}

#pb-vol {
    width: 90px;
}

#player-bar input[type="range"] {
    accent-color: var(--accent);
}

/* kolejka */
#queue-panel {
    max-height: 40vh;
    overflow-y: auto;
    padding: 8px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

#queue-panel[hidden] {
    display: none;
}

.queue-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

#queue-list {
    margin: 0;
    padding-left: 22px;
    float: none;
}

#queue-list li {
    padding: 5px 4px;
    cursor: pointer;
}

#queue-list li:hover {
    background: var(--surface-2);
}

#queue-list li.current {
    color: var(--accent-hover);
    font-weight: 500;
}

#content {
    padding-bottom: 90px;
}

@media (max-width: 800px) {
    .pb-main { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
    .pb-seek { order: 5; flex-basis: 100%; }
    #pb-vol { display: none; }
}