/* Asistente de Voz Premium - Aplyweb */

.voice-btn-float {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d10000 0%, #8b0000 100%);
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(209, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.voice-btn-float:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 12px 30px rgba(209, 0, 0, 0.6);
}

.voice-btn-float .pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #d10000;
    border-radius: 50%;
    animation: ring-pulse 2s infinite;
    opacity: 0;
}

@keyframes ring-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Modal de Asistente */
.voice-modal {
    position: fixed;
    bottom: -100%;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: hidden;
    transition: bottom 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.voice-modal.active {
    bottom: 90px;
}

.voice-modal-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.voice-modal-title {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-modal-title i {
    color: #d10000;
    font-size: 1.1rem;
}

.voice-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.voice-close-btn:hover {
    color: white;
}

.voice-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.voice-assistant-avatar {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(209, 0, 0, 0.1) 0%, rgba(209, 0, 0, 0.2) 100%);
    border-radius: 50%;
    border: 1.5px solid rgba(209, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    animation: pulse-avatar 2s infinite;
}

.voice-assistant-avatar i {
    font-size: 1.8rem;
    color: #d10000;
}

.voice-repeat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.voice-repeat-btn:hover {
    background: rgba(209, 0, 0, 0.22);
    border-color: rgba(209, 0, 0, 0.45);
}

/* Ondas de Sonido Dinámicas */
.sound-waves {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    height: 40px;
    margin: 10px 0;
}

.sound-waves span {
    width: 4px;
    height: 8px;
    background: #d10000;
    border-radius: 10px;
    transition: all 0.2s;
}

.sound-waves.listening span {
    animation: wave-animation 1.2s infinite ease-in-out;
}

.sound-waves.listening span:nth-child(1) { animation-delay: 0.1s; }
.sound-waves.listening span:nth-child(2) { animation-delay: 0.2s; }
.sound-waves.listening span:nth-child(3) { animation-delay: 0.3s; }
.sound-waves.listening span:nth-child(4) { animation-delay: 0.4s; }
.sound-waves.listening span:nth-child(5) { animation-delay: 0.5s; }

@keyframes wave-animation {
    0%, 100% { height: 8px; }
    50% { height: 35px; background: #ff4d4d; }
}

.voice-transcript-box {
    width: 100%;
    min-height: 50px;
    max-height: 80px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.03);
    font-style: italic;
}

.voice-response-box {
    font-size: 0.95rem;
    color: white;
    font-weight: 500;
    line-height: 1.5;
}

.voice-action-btn {
    width: 100%;
    padding: 12px;
    background: #d10000;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.voice-action-btn:hover {
    background: #b00000;
    color: white;
}

.voice-status-text {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Entrada escrita disponible también en móviles */
.voice-input-container {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.voice-input-container input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    color: white;
    font-size: 0.85rem;
    outline: none;
}

.voice-input-container button {
    width: 44px;
    min-width: 44px;
    background: #d10000;
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.voice-input-container button:hover {
    background: #b00000;
}

.voice-quick-options {
    width: 100%;
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.voice-quick-options button {
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #f8fafc;
    font-size: 0.78rem;
    cursor: pointer;
}

.voice-quick-options button:hover {
    background: rgba(209, 0, 0, 0.25);
    border-color: rgba(209, 0, 0, 0.45);
}

.voice-summary-box {
    width: 100%;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    text-align: left;
    color: #e2e8f0;
    font-size: 0.82rem;
    line-height: 1.35;
}

.voice-summary-box p {
    margin: 0 0 6px;
}

.voice-summary-box p:last-child {
    margin-bottom: 0;
}

@keyframes pulse-avatar {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
