/* Estilos específicos para o chatbot */

/* Botão de toggle do chat */
.chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chat-toggle i {
    font-size: 24px;
}

.chat-toggle:hover {
    transform: scale(1.05);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(109, 40, 217, 0); }
    100% { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0); }
}

/* Janela do chat */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: var(--dark);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transform: scale(0);
    opacity: 0;
    transform-origin: bottom right;
    transition: all 0.3s ease;
}

.chat-window.active {
    transform: scale(1);
    opacity: 1;
}

/* Cabeçalho do chat */
.chat-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.chat-header-info {
    display: flex;
    align-items: center;
}

.chat-logo {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header h3 {
    font-size: 16px;
    margin: 0;
}

.status {
    font-size: 12px;
    opacity: 0.8;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: scale(1.1);
}

/* Corpo do chat */
.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: rgba(15, 23, 42, 0.8);
    display: flex;
    flex-direction: column;
}

/* Mensagens */
.message {
    margin-bottom: 15px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

.bot .message-content {
    background-color: var(--dark);
    border-bottom-left-radius: 5px;
    color: var(--text);
}

.user .message-content {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-bottom-right-radius: 5px;
    color: white;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Indicador de digitação */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Área de opções */
.chat-options {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.option-btn {
    background-color: var(--dark);
    color: var(--text);
    border: 1px solid var(--primary);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background-color: var(--primary);
    transform: translateY(-2px);
}

/* Área de entrada */
.chat-input-area {
    padding: 10px 15px;
    display: flex;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#chatInput {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background-color: rgba(15, 23, 42, 0.6);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    word-wrap: break-word;
}

#chatInput:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-light);
}

#chatInput:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#sendMessage {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

#sendMessage:hover:not(:disabled) {
    transform: scale(1.05);
}

#sendMessage:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsividade */
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-toggle {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .chat-window {
        width: 320px;
        height: 450px;
    }
}
