/* User Playlists - Main Styles */
.user-playlists-page {
    max-width: 1200px;
    margin: 0 auto;
}
.user-playlists-page .playlist-name {
    color: #333;
}
.user-playlists-page .playlist-meta{ color: #666;}

/* Header */
.playlists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.playlists-title {
    font-size: 2.5em;
    font-weight: 700;
    color: #673de6;
    margin: 0;
}
button.create-playlist-btn.btn-primary {
    background: #673de6;
    border: none;
    border-radius: 30px;
    padding: 6px 15px;
}
/* Grid Layout */
.playlists-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

/* Playlist Cards */
.playlist-card {
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
}

.playlist-card:hover {
    background: #282828;
    transform: translateY(-5px);
}


.playlist-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-card:hover .playlist-overlay {
    opacity: 1;
}

.playlist-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
}

.action-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.playlist-info {
    color: white;
}

.playlist-name {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: inherit;
}

.playlist-meta {
    font-size: 0.9em;
    color: #b3b3b3;
    margin: 0;
}

/* Empty State */
.playlists-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.playlists-empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

/* Add to Playlist Widget */
.add-to-playlist-widget {
    position: relative;
    display: inline-block;
}

.playlist-toggle-btn {
    background: #1db954;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.playlist-toggle-btn:hover {
    background: #1ed760;
    transform: scale(1.05);
}

.playlist-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.playlist-dropdown-content.show {
    display: block;
}

.playlist-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.playlist-item {
    padding: 8px 0;
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}

.playlist-checkbox input {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease;
}

.playlist-checkbox input:checked + .checkmark {
    background: #1db954;
    border-color: #1db954;
}

.playlist-checkbox input:checked + .checkmark::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

.playlist-name {
    font-weight: 500;
}

.post-count {
    color: #666;
    font-size: 0.9em;
}

.playlist-actions {
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.create-new-playlist-btn {
    background: none;
    border: none;
    color: #1db954;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    text-align: left;
    padding: 8px 0;
}

.create-new-playlist-btn:hover {
    color: #1ed760;
}

/* Modals */
.create-playlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    min-width: 300px;
    max-width: 90vw;
}

.modal-content h3 {
    margin: 0 0 30px 0;
    color: #fff;
}

.playlist-name-input {
    background: none;
    border: none;
    border-radius: 0;
    padding: 16px;
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin-bottom: 50px;
    text-align: center;
    border-bottom: 1px solid rgb(255 255 255 / 27%);
}

.playlist-name-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.cancel-create-btn {
    background: #f0f0f0;
    color: #333;
}

.confirm-create-btn {
    background: #1db954;
    color: white;
}

/* Playlist Display */
.playlist-header-simple {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 15px;
}
.playlist-info-simple {
    padding: 15px 0;
}
.playlist-display {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.playlist-header {
    background: linear-gradient(135deg, #1db954, #1ed760);
    color: white;
    padding: 30px;
}

.playlist-header-simple .playlist-title {
    font-size: 20px;
    font-weight: 700;
   margin-bottom: 5px;
}
.playlist-header-simple .playlist-meta{
    font-size: 14px;
    color: rgb(0 0 0 / 60%);
}
.playlist-cover-large img {
    border-radius: 8px;
}
.playlist-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-count {
    font-size: 1.1em;
}

.sort-mode-select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
}

.sort-mode-select option {
    color: #333;
}

.playlist-posts {
    padding: 20px;
}

.playlist-post {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s ease;
}

.playlist-post:hover {
    background: #f8f8f8;
}

.playlist-post:last-child {
    border-bottom: none;
}

.post-number {
    width: 30px;
    text-align: center;
    color: #666;
    font-weight: 600;
}

.post-thumbnail {
    width: 60px;
    height: 60px;
    margin: 0 16px;
    border-radius: 4px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-info {
    flex: 1;
}

.post-title {
    margin: 0 0 4px 0;
    font-size: 1.1em;
}

.post-title a {
    color: #333;
    text-decoration: none;
}

.post-title a:hover {
    color: #1db954;
}

.post-meta {
    display: flex;
    gap: 12px;
    font-size: 0.9em;
    color: #666;
}

.post-actions button {
    background: #ff4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.post-actions button:hover {
    background: #ff6666;
}

/* Login Prompt */
.playlists-login-prompt {
    text-align: center;
    padding: 60px 20px;
    background: #f8f8f8;
    border-radius: 8px;
}

.login-prompt-content {
    max-width: 400px;
    margin: 0 auto;
}

.login-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.login-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #1db954;
    color: white;
}

.btn-primary:hover {
    background: #1ed760;
}

.btn-secondary {
    background: #333;
    color: white;
}

.btn-secondary:hover {
    background: #555;
}

/* Drag and Drop */
.playlist-post.sortable-ghost {
    opacity: 0.4;
}

.playlist-post.sortable-chosen {
    background: #f0f0f0;
}

/* Responsive */
@media (max-width: 768px) {
    .playlists-grid {
       
    }
    
    .playlists-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .playlist-meta {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .playlist-post {
        flex-wrap: wrap;
    }
    
    .post-actions {
        width: 100%;
        margin-top: 12px;
    }
    
    .post-actions button {
        width: 100%;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 33% { content: '.'; }
    34%, 66% { content: '..'; }
    67%, 100% { content: '...'; }
}

/* Audio Player Integration */
.gs-add-playlist {
    cursor: pointer;
    transition: all 0.3s ease;
}

.gs-add-playlist:hover {
    transform: scale(1.1);
}

.gs-add-playlist:hover img {
    filter: brightness(0.8);
}

.playlist-trigger.has-playlists img {
    filter: brightness(0) saturate(100%) invert(52%) sepia(98%) saturate(415%) hue-rotate(90deg) brightness(95%) contrast(85%);
}

.loading-playlists,
.error-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.playlist-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Max playlist limit message */
.max-limit-message {
    padding: 20px;
    text-align: center;
}

.limit-message-content p {
    margin: 0;
    color: rgb(255 255 255 / 51%);
    font-size: 14px;
}

.create-playlist-option {
    transition: all 0.3s ease;
}
.playlist-action-bar .action-buttons {
    gap: 5px;
    justify-content: space-between;
}

/* Action buttons container spacing */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    flex-grow: 1;
}

.btn-action:hover {
    background: #f8f9fa;
    border-color: #007cba;
}

.btn-action:active {
    transform: translateY(1px);
}



/* Loading states */
.gs-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.playlist-title.loading {
    opacity: 0.6;
}

.simple-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Sortable drag & drop styles */
.sortable-ghost {
    opacity: 0.4;
    background: #f0f0f0;
}

.sortable-chosen {
    background: #f8f9fa;
    border-radius: 8px;
}

.gs-card.sortable-ghost {
    opacity: 0.4;
}

.gs-card.sortable-chosen {
    transform: rotate(2deg);
}

/* Drag & Drop Enhanced Styles */
.drag-handle {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    opacity: 0.6;
    transition: opacity 0.2s;
    z-index: 10;
    padding: 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.1);
}

.drag-handle:hover {
    opacity: 1;
    background: rgba(0,0,0,0.2);
}

.sortable-ghost {
    opacity: 0.4;
    background: rgba(0,0,0,0.1);
}

.sortable-chosen {
    background: rgba(0,0,0,0.05);
}

.dragging-active .gs-card {
    cursor: grabbing;
}

/* Body state during drag */
body.dragging-active {
    cursor: grabbing !important;
    user-select: none;
}

body.dragging-active * {
    cursor: grabbing !important;
}

/* Edit mode styles */
.btn-edit-listing.editing {
    background: #673de6 !important;
    color: white !important;
    border-color: #673de6 !important;
}

.gs-card {
    transition: all 0.3s ease;
    position: relative;
}

.playlist-tracks-cards {
    min-height: 100px;
}