/* Estilos para el modal nativo de Shazam */

.shazam-modal-native {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 120px;
    padding-right: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.shazam-modal-native.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-backdrop {
    display: none;
}

.modal-container {
    position: relative;
    background: linear-gradient(135deg, #1A1A1A, #2C3E50);
    border-radius: 12px;
    padding: 0;
    max-width: 350px;
    width: 350px;
    max-height: 300px;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shazam-modal-native.show .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(139, 92, 246, 0.1));
}

.shazam-logo-large {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shazam-logo-large .shazam-logo {
    width: 40px;
    height: 40px;
    fill: var(--neon-blue);
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

.modal-header h3 {
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.close-btn:hover {
    background: rgba(255, 0, 128, 0.1);
    color: var(--neon-pink);
    transform: scale(1.1);
}

.modal-body {
    padding: 16px 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.shazam-status {
    text-align: center;
    width: 100%;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: pulse 2s infinite;
}

.status-text {
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.status-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.status-indicator.starting {
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    animation: rotate 2s linear infinite;
}

.status-indicator.listening {
    background: linear-gradient(45deg, var(--neon-green), var(--neon-blue));
    animation: pulse 1.5s infinite;
}

.status-indicator.processing {
    background: linear-gradient(45deg, var(--neon-purple), var(--neon-pink));
    animation: rotate 1s linear infinite;
}

.status-indicator.success {
    background: var(--neon-green);
    animation: successPulse 0.6s ease-out;
}

.status-indicator.error {
    background: var(--neon-pink);
    animation: errorShake 0.5s ease-out;
}

.status-indicator.timeout {
    background: #FFA500;
    animation: timeoutFade 1s ease-out;
}

.shazam-result {
    width: 100%;
    text-align: center;
    animation: slideInUp 0.5s ease-out;
}

.result-artwork {
    margin-bottom: 20px;
}

.artwork-placeholder {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: 16px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.artwork-placeholder i {
    font-size: 2.5rem;
    color: white;
}

.artwork-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.artwork-placeholder img:hover {
    transform: scale(1.05);
}

.result-info {
    margin-bottom: 24px;
}

.result-title {
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.result-artist {
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 1rem;
    margin: 0;
    opacity: 0.8;
}

.result-genre {
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    margin: 4px 0 0 0;
    opacity: 0.7;
}

.result-count {
    color: var(--neon-blue);
    font-family: var(--font-primary);
    font-size: 0.8rem;
    margin: 4px 0 0 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-count::before {
    content: "🎵";
    font-size: 0.7rem;
}

.result-album {
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    margin: 4px 0 0 0;
    opacity: 0.8;
    font-style: italic;
}

.result-year {
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.8rem;
    margin: 2px 0 0 0;
    opacity: 0.6;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.modal-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.stop-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--neon-pink), #FF6B6B);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 128, 0.4);
}

/* Animaciones */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes successPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes timeoutFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para el botón de Shazam mejorado */
.floating-shazam-button {
    position: relative;
    margin-left: 16px;
}

.shazam-button-container {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.shazam-button-container:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.4);
}

.shazam-button-container.listening {
    animation: shazamPulse 1.5s infinite;
    background: linear-gradient(135deg, var(--neon-green), var(--neon-blue));
}

.shazam-logo-container {
    position: relative;
    z-index: 2;
}

.shazam-logo-container .shazam-logo {
    width: 30px;
    height: 30px;
    fill: white;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

@keyframes shazamPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 30px rgba(0, 255, 136, 0.5);
    }
}

/* Notificaciones mejoradas */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--dark-surface), #2C3E50);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--neon-blue);
    z-index: 10001;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

.notification-success {
    border-left-color: var(--neon-green);
}

.notification-error {
    border-left-color: var(--neon-pink);
}

.notification-warning {
    border-left-color: #FFA500;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.notification-message {
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

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

/* Responsive */
@media (max-width: 768px) {
    .shazam-modal-native {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    .shazam-modal-native .modal-backdrop {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(6px);
    }

    .modal-container {
        position: relative;
        z-index: 1;
        width: 100%;
        max-width: 100%;
        max-height: min(72dvh, 520px);
        margin: 0;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-header {
        padding: 16px 16px 12px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 12px 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .modal-container {
        border-radius: 12px 12px 0 0;
    }

    .modal-header h3 {
        font-size: 0.95rem;
    }

    .shazam-logo-large .shazam-logo {
        width: 34px;
        height: 34px;
    }
}
