/* =========================================
   PLAYLIST MODAL SYSTEM
   Cinematic Overlay Architecture
   ========================================= */

.playlist-modal-overlay {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background:
        rgba(0, 0, 0, 0.72);

    backdrop-filter:
        blur(18px);

    -webkit-backdrop-filter:
        blur(18px);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.28s ease,
        visibility 0.28s ease;

    z-index: var(--z-modal, 800);
}


/* =========================================
   ACTIVE STATE
   ========================================= */

.playlist-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* =========================================
   MODAL PANEL
   ========================================= */

.playlist-modal {
    width: 100%;
    max-width: 460px;

    border-radius: 32px;

    overflow: hidden;

    background:
        rgba(18, 18, 18, 0.92);

    border:
        1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        0 20px 80px rgba(0, 0, 0, 0.55);

    transform:
        translateY(30px)
        scale(0.96);

    transition:
        transform 0.28s ease;

    backdrop-filter:
        blur(24px);

    -webkit-backdrop-filter:
        blur(24px);
}


/* =========================================
   ACTIVE PANEL
   ========================================= */

.playlist-modal-overlay.active
.playlist-modal {

    transform:
        translateY(0)
        scale(1);
}


/* =========================================
   HEADER
   ========================================= */

.playlist-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding:
        28px
        28px
        20px;
}


.playlist-modal-heading h3 {
    margin: 0;

    font-size: 1.35rem;
    font-weight: 700;

    color: #ffffff;
}


.playlist-modal-heading p {
    margin-top: 8px;

    font-size: 0.92rem;
    line-height: 1.6;

    color:
        rgba(255, 255, 255, 0.58);
}


/* =========================================
   CLOSE BUTTON
   ========================================= */

.playlist-modal-close {
    width: 42px;
    height: 42px;

    border: none;
    outline: none;

    border-radius: 50%;

    cursor: pointer;

    color: #ffffff;

    background:
        rgba(255, 255, 255, 0.08);

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}


.playlist-modal-close:hover {
    transform: scale(1.06);

    background:
        rgba(255, 255, 255, 0.14);
}


/* =========================================
   BODY
   ========================================= */

.playlist-modal-body {
    max-height: 420px;

    overflow-y: auto;

    padding:
        0
        20px
        20px;
}


/* =========================================
   LOADING STATE
   ========================================= */

.playlist-loading-state {
    padding: 42px 20px;

    text-align: center;

    font-size: 0.95rem;

    color:
        rgba(255, 255, 255, 0.55);
}


/* =========================================
   PLAYLIST ITEM
   ========================================= */

.playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding:
        18px
        18px;

    margin-bottom: 12px;

    border-radius: 20px;

    cursor: pointer;

    transition:
        background 0.22s ease,
        transform 0.22s ease;

    background:
        rgba(255, 255, 255, 0.03);

    border:
        1px solid rgba(255, 255, 255, 0.05);
}


.playlist-item:hover {
    transform: translateY(-1px);

    background:
        rgba(255, 255, 255, 0.06);
}


.playlist-item-left h4 {
    margin: 0;

    font-size: 0.98rem;
    font-weight: 600;

    color: #ffffff;
}


.playlist-item-left p {
    margin-top: 6px;

    font-size: 0.84rem;

    color:
        rgba(255, 255, 255, 0.52);
}


/* =========================================
   PLAYLIST STATUS
   ========================================= */

.playlist-item-status {
    flex-shrink: 0;

    font-size: 1rem;
    font-weight: 700;

    color:
        rgba(255, 255, 255, 0.78);
}


.playlist-item.active {
    border:
        1px solid rgba(255, 255, 255, 0.14);

    background:
        rgba(255, 255, 255, 0.08);
}


/* =========================================
   FOOTER
   ========================================= */

.playlist-modal-footer {
    padding:
        20px
        28px
        28px;
}


/* =========================================
   CREATE BUTTON
   ========================================= */

.playlist-create-btn {
    width: 100%;

    height: 52px;

    border: none;
    outline: none;

    border-radius: 18px;

    cursor: pointer;

    font-size: 0.95rem;
    font-weight: 600;

    color: #ffffff;

    background:
        rgba(255, 255, 255, 0.08);

    transition:
        transform 0.22s ease,
        background 0.22s ease;
}


.playlist-create-btn:hover {
    transform: translateY(-1px);

    background:
        rgba(255, 255, 255, 0.14);
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 768px) {

    .playlist-modal-overlay {
        align-items: flex-end;

        padding: 0;
    }

    .playlist-modal {
        max-width: 100%;

        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;

        animation:
            playlistSheetUp 0.28s ease;
    }

}


@keyframes playlistSheetUp {

    from {
        transform:
            translateY(100%);
    }

    to {
        transform:
            translateY(0);
    }

}
