/* Modal de Preview da Playlist */
.playlist-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-preview-modal.show {
    opacity: 1;
}

.playlist-preview-modal .modal-content {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.playlist-preview-modal.show .modal-content {
    transform: scale(1);
}

.playlist-preview-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-preview-modal .modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.playlist-preview-modal .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.playlist-preview-modal .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.playlist-preview-modal .modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.playlist-preview-modal .playlist-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.playlist-preview-modal .playlist-uploader {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 5px;
}

.playlist-preview-modal .tracks-count {
    font-size: 1rem;
    color: #888;
    font-weight: 500;
}

.playlist-preview-modal .tracks-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.playlist-preview-modal .track-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.playlist-preview-modal .track-item:last-child {
    border-bottom: none;
}

.playlist-preview-modal .track-item:hover {
    background-color: #f8f9fa;
}

.playlist-preview-modal .track-number {
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.playlist-preview-modal .track-info {
    flex: 1;
    min-width: 0;
}

.playlist-preview-modal .track-title {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-preview-modal .track-artist {
    display: block;
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-preview-modal .track-duration {
    font-size: 0.9rem;
    color: #888;
    margin-left: 15px;
    flex-shrink: 0;
}

.playlist-preview-modal .modal-footer {
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    border-top: 1px solid #e9ecef;
}

.playlist-preview-modal .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.playlist-preview-modal .btn-secondary {
    background: #6c757d;
    color: white;
}

.playlist-preview-modal .btn-secondary:hover {
    background: #5a6268;
}

.playlist-preview-modal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.playlist-preview-modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Modal de Loading da Playlist */
.playlist-loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-loading-modal.show {
    opacity: 1;
}

.playlist-loading-modal .loading-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    min-width: 300px;
}

.playlist-loading-modal.show .loading-content {
    transform: scale(1);
}

.playlist-loading-modal .loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.playlist-loading-modal .loading-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 20px;
}

.playlist-loading-modal .loading-progress {
    width: 100%;
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.playlist-loading-modal .progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Controles de seleção */
.playlist-controls {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.selection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input[type="checkbox"]:indeterminate + .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkbox-container input[type="checkbox"]:indeterminate + .checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 8px;
    height: 2px;
    background-color: white;
}

.checkbox-label {
    font-size: 0.95rem;
}

.selected-count {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* Itens da playlist com checkboxes */
.track-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
    gap: 12px;
}

.track-item:hover {
    background-color: #f8f9fa;
}

.track-item:last-child {
    border-bottom: none;
}

.track-checkbox {
    flex-shrink: 0;
}

.track-checkbox .checkmark {
    width: 18px;
    height: 18px;
    margin-right: 0;
}

.track-number {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background-color: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.track-info {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-weight: 500;
    color: #212529;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 0.9rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-duration {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    margin-left: 10px;
}

.track-actions {
    flex-shrink: 0;
    margin-left: 10px;
}

.btn-download-individual {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-download-individual:hover {
    background-color: #667eea;
    color: white;
    transform: translateY(-1px);
}

.btn-download-individual:active {
    transform: translateY(0);
}

.btn-download-individual svg {
    width: 16px;
    height: 16px;
}

/* Responsividade */
@media (max-width: 768px) {
    .playlist-preview-modal .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .playlist-preview-modal .modal-header {
        padding: 15px;
    }
    
    .playlist-preview-modal .modal-title {
        font-size: 1.3rem;
    }
    
    .playlist-preview-modal .modal-body {
        padding: 15px;
        flex: 1;
        overflow-y: auto;
    }
    
    .playlist-preview-modal .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .playlist-preview-modal .btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    .playlist-preview-modal .track-item {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .playlist-preview-modal .track-number {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .playlist-preview-modal .track-duration {
        font-size: 0.8rem;
        margin-left: 8px;
    }
    
    .playlist-loading-modal .loading-content {
        padding: 30px 20px;
        min-width: 280px;
    }
    
    .playlist-loading-modal .loading-spinner {
        width: 50px;
        height: 50px;
    }
    
    .playlist-loading-modal .loading-text {
        font-size: 1.1rem;
    }
    
    .playlist-controls {
        margin: 15px 0;
        padding: 12px;
    }
    
    .selection-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .track-item {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .track-number {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .track-duration {
        font-size: 0.8rem;
        margin-left: 8px;
    }
    
    .btn-download-individual {
        padding: 6px;
    }
    
    .btn-download-individual svg {
        width: 14px;
        height: 14px;
    }
}

/* Notificações */
@keyframes slideIn {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    color: white;
    border-radius: 8px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 350px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.notification strong {
    font-weight: 600;
}

.notification br {
    margin: 2px 0;
}

.notification.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.notification.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.notification.warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.notification.info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

@media (max-width: 768px) {
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
