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

.playlists-page {
    padding: 20px 40px 120px 40px;
    color: white;
    min-height: calc(100vh - 140px);
}

/* Auth Prompt (Not Logged In) */
.auth-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.auth-prompt-content {
    text-align: center;
    max-width: 500px;
}

.auth-prompt-content h1 {
    font-size: 48px;
    margin: 0 0 16px 0;
    font-weight: 700;
}

.auth-prompt-content p {
    font-size: 18px;
    color: #b3b3b3;
    margin: 0 0 32px 0;
}

.auth-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.auth-btn {
    padding: 14px 32px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
    display: inline-block;
}

.auth-btn-primary {
    background-color: #514164;
    color: white;
}

.auth-btn-primary:hover {
    background-color: #6b5178;
    transform: scale(1.05);
}

.auth-btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.auth-btn-secondary:hover {
    background-color: white;
    color: #000;
    transform: scale(1.05);
}

/* Playlists Header */
.playlists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.playlists-header h1 {
    font-size: 48px;
    margin: 0;
    font-weight: 700;
}

.create-playlist-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #514164;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}

.create-playlist-btn:hover {
    background-color: #6b5178;
    transform: scale(1.05);
}

.plus-icon {
    font-size: 20px;
    font-weight: 700;
}

/* Playlists Grid */
.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

/* Playlist Card */
.playlist-card {
    background-color: #181818;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background-color 0.3s, transform 0.2s;
}

.playlist-card:hover {
    background-color: #222;
    transform: translateY(-4px);
}

.playlist-cover {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #282828;
}

.playlist-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.playlist-card:hover .playlist-overlay {
    opacity: 1;
}

.play-icon {
    width: 48px;
    height: 48px;
    background-color: #514164;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    transition: transform 0.2s, background-color 0.2s;
}

.playlist-card:hover .play-icon {
    transform: scale(1.1);
    background-color: #6b5178;
}

/* Playlist Info */
.playlist-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.playlist-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-description {
    font-size: 14px;
    color: #b3b3b3;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #777;
}

.meta-separator {
    color: #555;
}

/* Add New Playlist Card */
.playlist-card.add-new {
    border: 2px dashed #333;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.playlist-card.add-new:hover {
    border-color: #514164;
    background-color: #1a1a1a;
}

.add-new-content {
    text-align: center;
}

.add-icon {
    font-size: 48px;
    color: #514164;
    margin-bottom: 8px;
}

.add-new-content p {
    font-size: 14px;
    color: #b3b3b3;
    margin: 0;
}

/* Create Playlist Popup */
.playlist-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.playlist-popup:target {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.playlist-popup-content {
    background-color: #181818;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.playlist-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.playlist-popup-header h2 {
    font-size: 24px;
    margin: 0;
    color: white;
}

.close-popup {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.close-popup:hover {
    color: white;
}

/* Playlist Form */
.playlist-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    background-color: #222;
    border: 1px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #514164;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn-cancel,
.btn-create {
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-cancel {
    background-color: transparent;
    color: white;
    border: 1px solid #333;
}

.btn-cancel:hover {
    background-color: #222;
}

.btn-create {
    background-color: #514164;
    color: white;
}

.btn-create:hover {
    background-color: #6b5178;
    transform: scale(1.05);
}

/* Responsive Design */
@media screen and (max-width: 900px) {
    .playlists-page {
        padding: 20px 20px 120px 20px;
    }

    .playlists-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .playlists-header h1 {
        font-size: 36px;
    }

    .playlists-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .auth-prompt-content h1 {
        font-size: 36px;
    }

    .auth-buttons {
        flex-direction: column;
        width: 100%;
    }

    .auth-btn {
        width: 100%;
    }
}

@media screen and (max-width: 600px) {
    .playlists-header h1 {
        font-size: 28px;
    }

    .playlists-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .create-playlist-btn {
        width: 100%;
        justify-content: center;
    }
}