/* MyStory Voice Agent Styles */

#voice-agent-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: inherit;
}

#voice-agent-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-center;
    position: relative;
    overflow: hidden;
}

#voice-agent-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#voice-agent-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

#voice-agent-button:hover::before {
    opacity: 1;
}

#voice-agent-button:active {
    transform: scale(0.95);
}

#voice-agent-button.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(245, 87, 108, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(245, 87, 108, 0.8);
    }
}

/* Floating bubble */
#voice-agent-bubble {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#voice-agent-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.voice-agent-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.voice-agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.voice-agent-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.voice-agent-message {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}

#voice-agent-status {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

#voice-agent-status.listening {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    animation: breathe 2s infinite;
}

#voice-agent-status.speaking {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    animation: wave 1s infinite;
}

@keyframes breathe {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes wave {

    0%,
    100% {
        transform: scaleX(1);
    }

    50% {
        transform: scaleX(1.05);
    }
}

/* Visualizer bars */
.voice-visualizer {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 40px;
    margin-top: 12px;
    justify-content: center;
}

.voice-bar {
    width: 4px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.voice-bar.active {
    animation: bounce 0.6s infinite;
}

.voice-bar:nth-child(1) {
    animation-delay: 0s;
}

.voice-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.voice-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.voice-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.voice-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    100% {
        height: 8px;
    }

    50% {
        height: 32px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #voice-agent-container {
        bottom: 15px;
        right: 15px;
    }

    #voice-agent-button {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    #voice-agent-bubble {
        width: 280px;
        bottom: 80px;
    }
}

/* Accessibility */
#voice-agent-button:focus {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

/* Tooltip */
.voice-agent-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    margin-bottom: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#voice-agent-button:hover .voice-agent-tooltip {
    opacity: 1;
}