/* Last Dance module specific styles (CSP-safe external file) */

/* Section Containers */
.ld-section {
    background: rgba(62, 40, 25, 0.5);
    border: 1px solid #5a3a24;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.ld-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #5a3a24;
}

.ld-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
}

.ld-section-title i {
    margin-right: 0.5rem;
    color: #d97706;
}

/* Playlists Grid */
.ld-playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ld-playlist-card {
    background: rgba(26, 14, 6, 0.6);
    border: 1px solid #5a3a24;
    border-radius: 0.5rem;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.ld-playlist-card:hover {
    border-color: #d97706;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
    transform: translateY(-2px);
}

.ld-playlist-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ld-playlist-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #d97706, #b45309);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ld-playlist-icon i {
    font-size: 1.5rem;
    color: white;
}

.ld-playlist-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.ld-playlist-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
}

.ld-playlist-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #94a3b8;
}

.ld-playlist-meta-item i {
    color: #d97706;
}

.ld-playlist-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Empty State */
.ld-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

/* Form Styles */
.ld-form {
    max-width: 100%;
}

.ld-form-group {
    margin-bottom: 1.5rem;
}

.ld-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ld-label i {
    margin-right: 0.5rem;
    color: #d97706;
}

.ld-help-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* Radio Group */
.ld-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ld-radio-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(26, 14, 6, 0.4);
    border: 1px solid #5a3a24;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ld-radio-label:hover {
    background: rgba(26, 14, 6, 0.6);
    border-color: #815739;
}

.ld-radio-label input[type="radio"] {
    margin-right: 0.75rem;
    accent-color: #d97706;
}

.ld-radio-label span {
    color: #e2e8f0;
    font-size: 0.875rem;
}

/* Songs List */
.ld-songs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(26, 14, 6, 0.4);
    border: 1px solid #5a3a24;
    border-radius: 0.375rem;
}

.ld-song-item {
    background: rgba(62, 40, 25, 0.6);
    border: 1px solid #5a3a24;
    border-left: 3px solid #d97706;
    border-radius: 0.375rem;
    padding: 0.75rem;
    cursor: grab;
    transition: all 0.2s;
}

.ld-song-item:hover {
    border-color: #815739;
    background: rgba(62, 40, 25, 0.8);
}

.ld-song-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.ld-song-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.ld-song-info {
    flex: 1;
}

.ld-song-title {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.875rem;
}

.ld-song-artist {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.ld-song-note {
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.ld-song-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.ld-btn-remove {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 0.375rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ld-btn-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* Song Artwork */
.ld-song-art {
    width: 70px;
    height: 70px;
    border-radius: 0.375rem;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #5a3a24;
    align-self: center;
}
.ld-song-art-generic {
    width: 70px;
    height: 70px;
    border-radius: 0.375rem;
    flex-shrink: 0;
    background: rgba(224, 156, 61, 0.12);
    border: 1px solid #5a3a24;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d97706;
    font-size: 1.25rem;
    align-self: center;
}

/* Drag Handle */
.ld-song-drag {
    color: #5a3a24;
    cursor: grab;
    padding: 0 0.25rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s;
}
.ld-song-drag:hover { color: #E09C3D; }
.ld-song-item.dragging .ld-song-drag { cursor: grabbing; }

/* Drag-over highlight */
.ld-song-item.drag-over {
    border-color: #E09C3D;
    box-shadow: 0 0 0 1px rgba(224,156,61,0.35);
}

/* Move buttons */
.ld-btn-move {
    background: none;
    border: 1px solid rgba(224,156,61,0.25);
    color: #DCA65B;
    border-radius: 0.375rem;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ld-btn-move:hover:not(:disabled) {
    background: rgba(224,156,61,0.15);
    border-color: #E09C3D;
}
.ld-btn-move:disabled {
    opacity: 0.25;
    cursor: default;
}

/* Edit button */
.ld-btn-edit {
    background: none;
    border: 1px solid rgba(96,165,250,0.3);
    color: #60a5fa;
    border-radius: 0.375rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ld-btn-edit:hover {
    background: rgba(96,165,250,0.15);
    border-color: #60a5fa;
}

/* Inline Edit Form */
.ld-edit-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.ld-edit-form .ld-input {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}
.ld-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.ld-btn-edit-save {
    background: rgba(34,197,94,0.2);
    border: 1px solid rgba(34,197,94,0.4);
    color: #4ade80;
    border-radius: 0.375rem;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s;
}
.ld-btn-edit-save:hover {
    background: rgba(34,197,94,0.3);
    border-color: #4ade80;
}
.ld-btn-edit-cancel {
    background: none;
    border: 1px solid rgba(148,163,184,0.3);
    color: #94a3b8;
    border-radius: 0.375rem;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s;
}
.ld-btn-edit-cancel:hover {
    background: rgba(148,163,184,0.1);
    border-color: #94a3b8;
}

/* Textarea */
.ld-textarea {
    appearance: none;
    padding: 0.75rem;
    border-radius: 0.375rem;
    background: rgba(26, 14, 6, 0.7);
    border: 1px solid #5a3a24;
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.5;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    width: 100%;
    resize: vertical;
}

.ld-textarea::placeholder {
    color: #64748b;
}

.ld-textarea:focus {
    outline: 2px solid #d97706;
    outline-offset: 2px;
    border-color: #d97706;
    box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.4);
}

/* Form Actions */
.ld-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #5a3a24;
}

/* Modal */
.ld-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ld-modal.hidden {
    display: none;
}

.ld-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.ld-modal-content {
    position: relative;
    background: #3E2819;
    border: 1px solid #5a3a24;
    border-radius: 0.5rem;
    max-width: 42rem;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.ld-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #5a3a24;
}

.ld-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
}

.ld-modal-title i {
    margin-right: 0.5rem;
    color: #d97706;
}

.ld-modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    color: #94a3b8;
    transition: all 0.2s;
}

.ld-modal-close:hover {
    background: #5a3a24;
    color: #f1f5f9;
}

.ld-modal-body {
    padding: 1.5rem;
}

/* Inputs */
.ld-input { 
    appearance: none; 
    padding: 0.5rem 0.75rem; 
    border-radius: 0.375rem; 
    background: rgba(26, 14, 6, 0.7); 
    border: 1px solid #374151; 
    color: #e2e8f0; 
    font-size: 0.875rem; 
    line-height: 1.25rem; 
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s; 
    width: 100%; 
}

.ld-input::placeholder { 
    color: #64748b; 
}

.ld-input:focus { 
    outline: 2px solid #E09C3D; 
    outline-offset: 2px; 
    border-color: #E09C3D; 
    box-shadow: 0 0 0 1px rgba(224, 156, 61, 0.4); 
}

/* Primary gradient button */
.ld-btn-primary { 
    padding: 0.5rem 1rem; 
    border-radius: 0.375rem; 
    background: linear-gradient(90deg, #E09C3D, #D46A2A); 
    color: #fff; 
    font-size: 0.875rem; 
    font-weight: 600; 
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.5); 
    transition: filter 0.18s, box-shadow 0.18s; 
    border: none;
    cursor: pointer;
}

.ld-btn-primary:hover { 
    filter: brightness(1.05); 
}

.ld-btn-primary:focus { 
    outline: 2px solid #E09C3D; 
    outline-offset: 2px; 
}

.ld-btn-primary:active { 
    filter: brightness(0.95); 
}

/* Secondary button */
.ld-btn-secondary { 
    padding: 0.5rem 1rem; 
    border-radius: 0.375rem; 
    background: #5a3a24; 
    border: 1px solid #815739; 
    color: #e2e8f0; 
    font-size: 0.875rem; 
    font-weight: 600; 
    transition: background 0.18s, border-color 0.18s; 
    cursor: pointer;
}

.ld-btn-secondary:hover { 
    background: #815739; 
}

.ld-btn-secondary:focus { 
    outline: 2px solid #64748b; 
    outline-offset: 2px; 
}

.ld-btn-secondary:active { 
    background: #3E2819; 
}

/* Small button variant */
.ld-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Danger button */
.ld-btn-danger {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fecaca;
}

.ld-btn-danger:hover {
    background: #991b1b;
}

.ld-btn-danger:active {
    background: #6b1a1a;
}

/* Track action buttons */
.ld-track-action { 
    width: 1.75rem; 
    height: 1.75rem; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 0.375rem; 
    background: #1e2533; 
    color: #94a3b8; 
    border: 1px solid #5a3a24; 
    font-size: 0.7rem; 
    transition: background 0.18s, color 0.18s, border-color 0.18s; 
    cursor: pointer;
}

.ld-track-action:hover { 
    background: #5a3a24; 
    color: #f1f5f9; 
}

.ld-track-action:focus-visible { 
    outline: 2px solid #d97706; 
    outline-offset: 2px; 
}

.ld-track-action i { 
    font-size: 0.65rem; 
}

/* Drag handle */
.ld-handle {
    cursor: grab;
    color: #64748b;
    padding: 0 0.25rem;
}

.ld-handle:active {
    cursor: grabbing;
}

/* Move buttons */
.ld-track-move { 
    width: 1.5rem; 
    height: 1.5rem; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 0.375rem; 
    background: #1e2533; 
    color: #94a3b8; 
    border: 1px solid #5a3a24; 
    font-size: 0.6rem; 
    transition: background 0.18s, color 0.18s, border-color 0.18s; 
    cursor: pointer;
}

.ld-track-move:hover:not([disabled]) { 
    background: #5a3a24; 
    color: #f1f5f9; 
}

.ld-track-move:focus-visible { 
    outline: 2px solid #d97706; 
    outline-offset: 2px; 
}

.ld-track-move[disabled] { 
    opacity: 0.35; 
    cursor: not-allowed; 
}

.ld-track-move i { 
    font-size: 0.55rem; 
}

/* Service-specific colors (CSP compliant) */
.ld-service-spotify .ld-service-icon { color: #1DB954; }
.ld-service-spotify { border-left-color: #1DB954 !important; }

.ld-service-youtube .ld-service-icon { color: #FF0000; }
.ld-service-youtube { border-left-color: #FF0000 !important; }

.ld-service-apple-music .ld-service-icon { color: #FA243C; }
.ld-service-apple-music { border-left-color: #FA243C !important; }

.ld-service-other .ld-service-icon { color: #d97706; }
.ld-service-other { border-left-color: #d97706 !important; }

.ld-service-icon { margin-right: 0.5rem; }

.ld-playlist-link { 
    color: #60a5fa; 
    text-decoration: none; 
}

.ld-playlist-link:hover { 
    text-decoration: underline; 
}

/* Print preview styles */
.ld-print-info { 
    color: #94a3b8; 
    font-size: 0.875rem; 
    margin-bottom: 1rem; 
    padding: 0.75rem; 
    background: rgba(0,0,0,0.2); 
    border-radius: 0.375rem; 
}

.ld-print-section { 
    margin-bottom: 1.5rem; 
}

.ld-print-section-title { 
    color: #cbd5e1; 
    font-weight: 600; 
}

.ld-print-list { 
    margin-top: 0.75rem; 
    padding-left: 0; 
    list-style: none; 
    color: #94a3b8; 
}

.ld-print-list-item { 
    margin-bottom: 0.75rem; 
    padding: 0.75rem; 
    background: rgba(62, 40, 25, 0.5); 
    border-radius: 0.375rem; 
    border-left-width: 3px; 
    border-left-style: solid; 
}

.ld-print-item-header { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
}

.ld-print-service { 
    color: #64748b; 
    font-size: 0.875rem; 
    margin-top: 0.25rem; 
}

.ld-print-description { 
    color: #64748b; 
    font-size: 0.875rem; 
    margin-top: 0.25rem; 
}

.ld-print-song-list { 
    margin-top: 0.75rem; 
    padding-left: 1.5rem; 
    color: #94a3b8; 
}

.ld-print-song-item { 
    margin-bottom: 0.5rem; 
}

.ld-print-song-title { 
    color: #e2e8f0; 
    font-weight: 600; 
}

.ld-print-song-artist { 
    color: #94a3b8; 
    font-size: 0.875rem; 
}

.ld-print-song-note { 
    color: #64748b; 
    font-size: 0.875rem; 
    font-style: italic; 
    margin-top: 0.25rem; 
}

.ld-print-content { 
    color: #e2e8f0; 
}

/* Service instructions box */
.ld-service-instructions {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    border-radius: 0.375rem;
}

/* Print preview styles */
.ld-print-section {
    margin-bottom: 1.5rem;
}

.ld-print-label {
    color: #cbd5e1;
    font-weight: bold;
}

.ld-print-list {
    margin-top: 0.75rem;
    padding-left: 0;
    list-style: none;
    color: #94a3b8;
}

.ld-print-list-item {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(62, 40, 25, 0.5);
    border-radius: 0.375rem;
}

.ld-print-link-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ld-print-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
}

.ld-print-service {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.ld-print-description {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.ld-print-ordered-list {
    margin-top: 0.75rem;
    padding-left: 1.5rem;
    color: #94a3b8;
}

.ld-print-song-item {
    margin-bottom: 0.5rem;
}

.ld-print-song-title {
    color: #e2e8f0;
    font-weight: 600;
}

.ld-print-song-artist {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 767px) {
    .ld-time-info { 
        display: none; 
    }
    
    .ld-section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .ld-playlists-grid {
        grid-template-columns: 1fr;
    }

    /* Song items: stack on mobile */
    .ld-song-header {
        flex-wrap: wrap;
    }

    .ld-song-drag {
        order: 0;
    }

    .ld-song-art,
    .ld-song-art-generic {
        order: 1;
    }

    .ld-song-actions {
        order: 2;
        margin-left: auto;
    }

    .ld-song-info {
        order: 3;
        width: 100%;
        flex-basis: 100%;
        padding-top: 0.5rem;
    }
}
