/* ========================================
   PLAYLISTS

   style.css      — the shell
   components.css — album cards, artist cards, chips
   library.css    — headings, small buttons, empty states,
                    song rows with an album column
   playlists.css  — only what is new here
======================================== */


/* ========================================
   CREATE A PLAYLIST
======================================== */

.create-row {
    display: flex;
    gap: 10px;

    margin-bottom: 22px;
}

.create-row input {
    flex: 1 1 auto;
    min-width: 0;

    padding: 14px 18px;

    color: var(--white);

    background: rgba(10, 26, 48, 0.72);

    border: 1px solid var(--line);
    border-radius: 999px;

    font-family: inherit;
    font-size: 0.88rem;

    transition: 0.25s ease;
}

.create-row input::placeholder {
    color: var(--muted-dark);
}

.create-row input:focus {
    outline: none;

    border-color: var(--line-bright);
    background: rgba(14, 38, 70, 0.9);
}

.create-row .primary-button svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
}


/* ========================================
   PLAYLIST CARDS
======================================== */

.playlist-grid {
    display: grid;

    grid-template-columns: repeat(
        auto-fill,
        minmax(190px, 1fr)
    );

    gap: 16px;
}

.playlist-card {
    position: relative;

    min-width: 0;
}

.playlist-open {
    display: block;

    width: 100%;

    padding: 14px;

    color: var(--white);

    background: rgba(10, 26, 48, 0.66);

    border: 1px solid var(--line);
    border-radius: var(--radius-medium);

    text-align: left;

    cursor: pointer;
    transition: 0.25s ease;
}

.playlist-open:hover {
    border-color: var(--line-bright);

    transform: translateY(-4px);

    box-shadow: 0 20px 40px rgba(0, 88, 190, 0.28);
}

.playlist-open strong,
.playlist-open small {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-open strong {
    font-size: 0.9rem;
}

.playlist-open small {
    margin-top: 3px;

    color: var(--muted);

    font-size: 0.72rem;
}


/* four squares from the covers of the first songs */
.playlist-art {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;

    aspect-ratio: 1;

    margin-bottom: 12px;

    overflow: hidden;

    border-radius: 10px;

    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5);
}

.playlist-art i {
    background:
        radial-gradient(
            circle at 72% 18%,
            rgba(255, 255, 255, 0.36),
            transparent 38%
        ),
        linear-gradient(
            150deg,
            var(--cover-one, #1d5c9e),
            var(--cover-two, #061628)
        );
}


/* ========================================
   BACK BUTTON
======================================== */

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 16px;
    padding: 9px 16px 9px 12px;

    color: var(--muted);

    background: transparent;

    border: 1px solid var(--line);
    border-radius: 999px;

    font-size: 0.76rem;
    font-weight: 600;

    cursor: pointer;
    transition: 0.25s ease;
}

.back-button svg {
    width: 15px;
    height: 15px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.back-button:hover {
    color: var(--cyan);

    border-color: var(--cyan);
}


/* ========================================
   PLAYLIST HERO
======================================== */

.playlist-hero {
    display: grid;
    align-items: end;
    gap: 30px;

    grid-template-columns: 200px minmax(0, 1fr);

    padding: 32px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 84% 10%,
            rgba(35, 140, 255, 0.28),
            transparent 44%
        ),
        linear-gradient(
            120deg,
            #123c73,
            #0a2547 60%,
            #06182c
        );

    border: 1px solid rgba(130, 185, 255, 0.22);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow);

    animation: riseIn 0.7s ease both;
}

.playlist-hero .playlist-art {
    width: 200px;

    margin-bottom: 0;
}

.playlist-heading .eyebrow {
    display: block;

    margin-bottom: 10px;

    color: var(--cyan);

    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.28em;
}

.playlist-heading h1 {
    margin-bottom: 10px;

    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.9rem, 3.4vw, 3rem);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.02em;
}

.playlist-note {
    max-width: 60ch;

    margin-bottom: 10px;

    color: #c3d7f0;

    font-size: 0.86rem;
    line-height: 1.6;
}

.playlist-meta {
    margin-bottom: 20px;

    color: var(--muted);

    font-size: 0.76rem;
}

.playlist-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.small-button.danger:hover {
    color: #04121f;

    background: #ff7a7a;

    border-color: #ff7a7a;
}


/* ========================================
   ADD SONGS
======================================== */

.picker {
    display: grid;
    gap: 12px;
}

.picker-box {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 16px;

    background: rgba(10, 26, 48, 0.72);

    border: 1px solid var(--line);
    border-radius: 999px;

    transition: 0.25s ease;
}

.picker-box:focus-within {
    border-color: var(--line-bright);
}

.picker-box svg {
    width: 16px;
    height: 16px;

    fill: none;
    stroke: var(--muted);
    stroke-width: 1.9;
}

.picker-box input {
    width: 100%;

    padding: 14px 0;

    color: var(--white);

    background: transparent;

    border: 0;

    font-family: inherit;
    font-size: 0.86rem;
}

.picker-box input:focus {
    outline: none;
}

.picker-results {
    display: grid;
    gap: 6px;
}

.picker-row {
    display: grid;
    align-items: center;
    gap: 12px;

    grid-template-columns: 40px minmax(0, 1fr) 72px;

    padding: 8px 12px;

    color: var(--white);

    background: rgba(10, 26, 48, 0.5);

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    text-align: left;

    cursor: pointer;
    transition: 0.2s ease;
}

.picker-row .cover {
    width: 40px;
    height: 40px;

    border-radius: 7px;

    background:
        radial-gradient(
            circle at 70% 20%,
            rgba(255, 255, 255, 0.35),
            transparent 38%
        ),
        linear-gradient(
            150deg,
            var(--cover-one, #1d5c9e),
            var(--cover-two, #061628)
        );
}

.picker-text {
    min-width: 0;
}

.picker-text strong,
.picker-text small {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-text strong {
    font-size: 0.84rem;
}

.picker-text small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 0.72rem;
}

.picker-action {
    color: var(--cyan);

    text-align: right;

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.picker-row:hover {
    border-color: var(--line-bright);
    background: rgba(14, 38, 70, 0.86);
}

.picker-row:disabled {
    cursor: default;
    opacity: 0.55;
}

.picker-row:disabled:hover {
    border-color: transparent;
    background: rgba(10, 26, 48, 0.5);
}

.picker-row:disabled .picker-action {
    color: var(--green);
}

.picker-none {
    padding: 10px 2px;

    color: var(--muted);

    font-size: 0.8rem;
}


/* ========================================
   THE SONG ROWS — wider last column, because
   a playlist row can move, like and drop
======================================== */

.playlist-header,
.playlist-tracks article {
    grid-template-columns:
        44px
        46px
        minmax(140px, 1fr)
        minmax(110px, 170px)
        70px
        138px;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.row-actions button {
    display: grid;
    place-items: center;

    width: 30px;
    height: 30px;

    color: var(--muted);

    background: transparent;

    border: 0;
    border-radius: 50%;

    font-size: 0.8rem;

    cursor: pointer;
    transition: 0.2s ease;
}

.row-actions button:hover:not(:disabled) {
    color: var(--cyan);

    background: rgba(87, 223, 255, 0.12);
}

.row-actions button:disabled {
    cursor: default;
    opacity: 0.25;
}

.row-actions .drop:hover {
    color: #ff7a7a;

    background: rgba(255, 122, 122, 0.14);
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 1050px) {
    .playlist-header,
    .playlist-tracks article {
        grid-template-columns:
            44px
            46px
            minmax(120px, 1fr)
            70px
            138px;
    }

    .playlist-tracks .from-album {
        display: none;
    }
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 650px) {
    .create-row {
        flex-direction: column;
    }

    .create-row .primary-button {
        justify-content: center;
    }

    .playlist-hero {
        grid-template-columns: minmax(0, 1fr);
        justify-items: start;

        gap: 18px;

        padding: 20px;
    }

    .playlist-hero .playlist-art {
        width: 148px;
    }

    .playlist-heading h1 {
        font-size: 1.85rem;
    }

    .playlist-actions {
        width: 100%;
    }

    .playlist-actions .primary-button,
    .playlist-actions .ghost-button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .playlist-header {
        display: none;
    }

    /* title, then the four little buttons */
    .playlist-tracks article {
        grid-template-columns:
            44px
            minmax(0, 1fr)
            126px;

        padding-inline: 10px;
    }

    /* style.css hides every span in a row on a phone, but this
       one holds the buttons, so put it back */
    .playlist-tracks .row-actions {
        display: flex;
    }

    .row-actions button {
        width: 28px;
        height: 28px;
    }

    .playlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .picker-row {
        grid-template-columns: 40px minmax(0, 1fr) 56px;
    }
}
