/**
 * Estilos para Identificación en Cascada
 * AcoustID → Deezer → iTunes → Last.fm
 */

/* ==========================================
   BOTÓN IDENTIFICAR
   ========================================== */

#btnIdentify {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#btnIdentify:hover:not(:disabled) {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#btnIdentify:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#btnIdentify .btn-icon {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

#btnIdentify .btn-spinner {
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: identify-spin 0.8s linear infinite;
}

@keyframes identify-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   MODAL OVERLAY
   ========================================== */

.identify-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 1rem;
}

.identify-modal-overlay.show {
    opacity: 1;
}

/* ==========================================
   MODAL
   ========================================== */

.identify-modal {
    background: linear-gradient(180deg, #1e1e2f 0%, #151521 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.identify-modal-overlay.show .identify-modal {
    transform: scale(1) translateY(0);
}

.identify-modal-sm {
    max-width: 420px;
}

.identify-modal-lg {
    max-width: 800px;
}

/* Header */
.identify-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.identify-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.source-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.source-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.identify-score {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
}

/* Fuentes consultadas */
.sources-tried {
    display: flex;
    gap: 0.375rem;
}

.source-badge {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.source-badge.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.source-badge.failed {
    background: rgba(239, 68, 68, 0.1);
    color: rgba(239, 68, 68, 0.5);
}

.source-badge svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Body */
.identify-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

/* Comparación lado a lado */
.identify-comparison {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.identify-column {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 1rem;
}

.identify-column.highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

.identify-column h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-source {
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
}

/* Carátula identificada */
.identify-cover {
    width: 100%;
    aspect-ratio: 1;
    max-width: 120px;
    margin: 0 auto 0.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.identify-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.identify-field {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.identify-field:last-child {
    margin-bottom: 0;
}

.identify-field.changed {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
}

.identify-field .label {
    display: block;
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.identify-field .value {
    display: block;
    font-size: 0.875rem;
    color: white;
    word-break: break-word;
}

/* Flecha central */
.identify-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* ==========================================
   ALTERNATIVAS
   ========================================== */

.identify-alternatives {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.identify-alternatives h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
}

.alternatives-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alternative-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.alternative-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.alt-cover {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alt-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alt-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.alt-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alt-artist {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alt-source {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.alt-source svg {
    width: 0.875rem;
    height: 0.875rem;
}

.alt-use-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    background: rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.alt-use-btn:hover {
    background: rgba(99, 102, 241, 0.5);
    border-color: rgba(99, 102, 241, 0.6);
}

/* ==========================================
   NO ENCONTRADO - FUENTES CONSULTADAS
   ========================================== */

.sources-tried-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.source-tried-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.source-icon-sm {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.source-icon-sm svg {
    width: 0.625rem;
    height: 0.625rem;
}

/* ==========================================
   FOOTER
   ========================================== */

.identify-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.identify-modal-footer .btn-cancel {
    flex: 1;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.identify-modal-footer .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.identify-modal-footer .btn-apply {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.identify-modal-footer .btn-apply:hover {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* ==========================================
   COLORES DE FUENTES
   ========================================== */

.bg-purple-500 { background-color: #8b5cf6; }
.bg-orange-500 { background-color: #f97316; }
.bg-pink-500 { background-color: #ec4899; }
.bg-red-500 { background-color: #ef4444; }
.bg-green-500 { background-color: #22c55e; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-gray-500 { background-color: #6b7280; }

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 640px) {
    .identify-comparison {
        flex-direction: column;
    }

    .identify-arrow {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }

    .identify-modal-footer {
        flex-direction: column;
    }

    #btnIdentify .btn-text {
        display: none;
    }

    #btnIdentify {
        padding: 0.5rem;
    }

    .header-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }

    .identify-modal-header {
        flex-wrap: wrap;
    }

    .alternative-item {
        flex-wrap: wrap;
    }

    .alt-info {
        order: 1;
        flex-basis: calc(100% - 3.5rem);
    }

    .alt-source {
        order: 0;
    }

    .alt-use-btn {
        order: 2;
        flex-basis: 100%;
        margin-top: 0.5rem;
    }
}
