/* playlists.css */
.playlists-page-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

.playlists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.playlists-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 2.2em;
    font-weight: 700;
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 0 20px;
}

.playlist-card {
    background-color: var(--form-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.playlist-card:hover {
    transform: translateX(5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    border-color: var(--youtube-dark-color);
}

.playlist-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.playlist-card-cover {
    position: relative;
    background: 
        radial-gradient(circle at 20% 30%, 
            hsl(from var(--youtube-color) calc(h - 25) s l) 0%, 
            transparent 60%),
        radial-gradient(circle at 80% 20%, 
            var(--youtube-color) 0%, 
            transparent 55%),
        radial-gradient(circle at 40% 70%, 
            hsl(from var(--youtube-color) calc(h + 20) s l) 0%, 
            transparent 65%),
        linear-gradient(135deg, 
            var(--youtube-dark-color), 
            var(--youtube-darker-color));
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.playlist-card-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 60% 40%, 
            rgba(255, 255, 255, 0.15) 0%, 
            transparent 40%),
        linear-gradient(45deg, 
            transparent 30%, 
            rgba(255, 255, 255, 0.08) 50%, 
            transparent 70%);
    mix-blend-mode: overlay;
}

.playlist-card-cover .icon.large {
    width: 70px;
    height: 70px;
    position: relative;
    fill: #fff;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.song-count {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.85);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    color: white;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.playlist-card-details {
    padding: 24px;
}

.playlist-card-title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.playlist-card-desc {
    color: var(--text-subtle-color);
    margin: 0 0 15px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95em;
}

.playlist-card-meta {
    font-size: 0.85em;
    color: var(--neutral-color);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light-color);
}

/* Modal Styles */
#create-playlist-form button[type="submit"] {
    width: 100%;
    padding: 16px;
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 10px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-subtle-color);
    grid-column: 1 / -1;
    background-color: var(--form-color);
    border-radius: 16px;
    border: 2px dashed var(--border-color);
}

.empty-state .icon.large {
    width: 90px;
    height: 90px;
    margin-bottom: 25px;
    color: var(--neutral-color);
    opacity: 0.6;
}

.empty-state p {
    margin: 12px 0;
    font-size: 1.1em;
    line-height: 1.5;
}

.empty-state p:first-of-type {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

.empty-state .styled-btn {
    margin-top: 20px;
    padding: 14px 28px;
    font-size: 1.1em;
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid var(--youtube-color);
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .playlists-page-container {
        padding: 15px;
    }
    
    .playlists-header {
        flex-direction: column;
        text-align: center;
        padding: 0 15px;
    }
    
    .playlists-header h2 {
        font-size: 1.8em;
    }
    
    .playlists-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    .playlist-card-cover {
        height: 160px;
    }
    
    .playlist-card-details {
        padding: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 15px;
        padding: 30px;
    }
    
    .empty-state {
        padding: 60px 20px;
    }
}

@media (max-width: 480px) {
    .playlists-page-container {
        padding: 10px;
    }
    
    .playlists-header {
        padding: 0 10px;
    }
    
    .playlists-grid {
        padding: 0 10px;
        gap: 15px;
    }
    
    .playlist-card-cover {
        height: 140px;
    }
    
    .playlist-card-details {
        padding: 15px;
    }
    
    .playlist-card-title {
        font-size: 1.2em;
    }
    
    .modal-content {
        padding: 25px 20px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 14px;
    }
    
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-state .icon.large {
        width: 70px;
        height: 70px;
    }
}

/* Animation for modal appearance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal.show .modal-content {
    animation: modalFadeIn 0.3s ease;
}