/* SARA - Sistema de Asistencia Real Avanzada - Integration for Unimedic Index */
:root {
    --sara-glow: 0 0 20px rgba(14, 165, 233, 0.4);
    --sara-accent: #0ea5e9;
}

.sara-interface {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    font-family: 'Outfit', sans-serif;
}

/* Chat Visual Panel */
.sara-chat-panel {
    width: 320px;
    height: 400px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    display: flex;
    /* We'll control visibility with opacity/pointer-events */
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.sara-chat-panel.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.sara-chat-header {
    padding: 15px 20px;
    background: rgba(14, 165, 233, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sara-chat-header h3 {
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: var(--sara-accent);
    margin: 0;
    font-weight: 700;
}

.sara-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: none;
}

.sara-chat-messages::-webkit-scrollbar {
    display: none;
}

.sara-msg {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.85rem;
    line-height: 1.5;
    animation: saraFadeIn 0.3s ease-out;
}

@keyframes saraFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sara-msg.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.sara-msg.user {
    align-self: flex-end;
    background: var(--sara-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.sara-typing-status {
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 10px 20px;
}

/* Voice Button */
.sara-voice-btn {
    width: 65px;
    height: 65px;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--sara-accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
    color: var(--sara-accent);
    position: relative;
    overflow: hidden;
}

.sara-voice-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.4);
}

.sara-voice-btn.active {
    background: var(--sara-accent);
    color: #fff;
    box-shadow: 0 0 40px var(--sara-accent);
}

.sara-voice-btn svg {
    width: 28px;
    height: 28px;
}

/* Pulse animation for the button when listening */
.sara-voice-btn.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: saraPulse 1.5s infinite;
}

@keyframes saraPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Integration with Main Core */
.core-container.talking .core {
    animation: coreTalk 0.4s ease-in-out infinite alternate !important;
    box-shadow: 0 0 80px 20px rgba(14, 165, 233, 0.7) !important;
}

@keyframes coreTalk {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.15);
    }
}