/* Chat IA - Estilos */

.chat-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    overflow: visible;
}

.chat-window {
    width: 100%;
    max-width: 90rem;
    height: 650px;
    background: rgba(45, 27, 78, 0.6);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: visible;
    position: relative;
}

/* Header - Removido */

/* Área de mensagens */
.messages-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    padding: 1.5rem 3rem 2rem 3rem;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-radius: 1rem;
}

.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
    background: #4a2573;
    border-radius: 10px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: #6b21a8;
}

/* Mensagens */
.message-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    animation: fadeSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.message-wrapper.message-user {
    flex-direction: row-reverse;
    margin-right: -2rem;
}

.message-wrapper.message-ai {
    margin-left: -2rem;
}

.avatar-small {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
    position: relative;
    overflow: hidden;
}

.avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-user {
    background: linear-gradient(135deg, #005c4b, #00a884);
    border: 2px solid #00a884;
}

.avatar-ai {
    background: white;
    border: 2px solid #7c3aed;
}

/* Container de conteúdo da mensagem */
.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 75%;
}

/* Label do remetente */
.sender-label {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.7;
    padding-left: 0.5rem;
}

.message-user .sender-label {
    color: #e4e7e6;
    text-align: right;
    padding-right: 0.5rem;
    padding-left: 0;
}

.message-ai .sender-label {
    color: #ffffff;
    text-align: left;
}

.message-bubble {
    width: 100%;
    padding: 0.5rem 0.875rem;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 5;
}

.message-user .message-bubble {
    background: #dcf8c7;
    color: rgb(0, 0, 0);
    border-radius: 0.5rem 0.5rem 0.125rem 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 92, 75, 0.5);
}

.message-ai .message-bubble {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 0.5rem 0.5rem 0.5rem 0.125rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message-bubble p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Mensagens de voz */
.voice-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.875rem;
}

.play-button {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: #128c7e;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(18, 140, 126, 0.4);
    position: relative;
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(18, 140, 126, 0.6);
    background: #0da58e;
}

.play-button:active {
    transform: scale(0.95);
}

.message-ai .play-button {
    background: #7c3aed;
}

.message-ai .play-button:hover {
    background: #8b5cf6;
}

/* Efeito pulsante verde para chamar atenção */
.play-button.pulse-attention {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: pulseGreen 1.5s ease-in-out infinite;
}

.play-button.pulse-attention::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.5);
    animation: ringPulse 1.5s ease-in-out infinite;
    z-index: -1;
}

.play-button.pulse-attention::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.3);
    animation: ringPulse 1.5s ease-in-out infinite;
    animation-delay: 0.3s;
    z-index: -2;
}

.audio-waves {
    display: flex;
    gap: 2px;
    flex: 1;
    align-items: center;
    height: 20px;
}

.wave-bar {
    width: 2px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.message-user .wave-bar {
    background: rgba(15, 14, 14, 0.7);
}

.audio-waves.playing .wave-bar {
    animation: waveAnimation 1s ease-in-out infinite;
}

.audio-waves.playing .wave-bar:nth-child(1) { animation-delay: 0s; }
.audio-waves.playing .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.audio-waves.playing .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.audio-waves.playing .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.audio-waves.playing .wave-bar:nth-child(5) { animation-delay: 0.4s; }
.audio-waves.playing .wave-bar:nth-child(6) { animation-delay: 0.5s; }
.audio-waves.playing .wave-bar:nth-child(7) { animation-delay: 0.6s; }
.audio-waves.playing .wave-bar:nth-child(8) { animation-delay: 0.7s; }
.audio-waves.playing .wave-bar:nth-child(9) { animation-delay: 0.8s; }
.audio-waves.playing .wave-bar:nth-child(10) { animation-delay: 0.9s; }

.audio-duration {
    font-size: 0.75rem;
    color: #000000;
    font-weight: 600;
    flex-shrink: 0;
}

.message-user .audio-duration {
    color: rgba(44, 44, 44, 0.95);
}

/* Indicador de digitação */
.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 1rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #a78bfa;
    border-radius: 50%;
    animation: bounce 1s ease-in-out infinite;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Área de input - Removida */

/* Animações */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes waveAnimation {
    0%, 100% {
        transform: scaleY(1);
        opacity: 0.6;
    }
    50% {
        transform: scaleY(1.5);
        opacity: 1;
    }
}

@keyframes ping {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes pulseGreen {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
    }
    50% {
        transform: scale(1.25);
        box-shadow: 0 8px 30px rgba(16, 185, 129, 0.8), 0 0 20px rgba(16, 185, 129, 0.5);
    }
}

@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .chat-window {
        max-width: 100%;
        height: 500px;
    }

    .message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .chat-window {
        height: 450px;
        border-radius: 0.75rem;
    }

    .messages-area {
        padding: 1rem;
    }

    .play-button {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }

    .audio-waves {
        height: 20px;
    }

    .wave-bar {
        width: 1.5px;
    }
}
