* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 1200px;
    height: 700px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tamanho maior para desktop */
@media (min-width: 1024px) {
    .chat-container {
        max-width: 1400px;
        height: 800px;
    }
}

.chat-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.chat-header h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
    font-weight: 600;
}

.chat-header p {
    opacity: 0.9;
    font-size: 0.9em;
}

.status-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    animation: slideIn 0.3s ease-out;
}

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

.message-content {
    padding: 15px 20px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

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

.user-message .message-content {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

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

.ai-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

#messageInput:focus {
    border-color: #4facfe;
}

.help-btn, .send-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
}

.help-btn {
    background: #28a745;
    color: white;
}

.help-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.send-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-indicator {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #4facfe;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots 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;
    }
}

/* Links clicáveis */
.message-content a {
    color: #4facfe;
    text-decoration: underline;
    transition: color 0.3s;
}

.message-content a:hover {
    color: #0056b3;
}

.ai-message .message-content a {
    color: #007bff;
}

.user-message .message-content a {
    color: #ffffff;
    text-decoration: underline;
}

/* Scrollbar personalizada */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .chat-container {
        height: 90vh;
        max-width: 100%;
    }
    
    .input-container {
        flex-direction: column;
        gap: 10px;
    }
    
    #messageInput {
        width: 100%;
    }
    
    .help-btn, .send-btn {
        width: 100%;
    }
    
    .message {
        max-width: 95%;
    }
    
    .chat-header h1 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .chat-container {
        border-radius: 10px;
        height: 95vh;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .chat-input-area {
        padding: 15px;
    }
}


/* Estilo para mensagens da IA */
.ai-message-wrapper {
    align-self: flex-start;
    max-width: 65%; /* Reduzido de 80% para 65% */
}

.ai-message-wrapper .message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    padding: 0; /* Removido padding para reorganizar */
}

/* Estilo para nome da IA com selo - DENTRO da caixa */
.ai-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #666;
    font-weight: 600;
    padding: 12px 20px 8px 20px; /* Padding superior e lateral */
    border-bottom: 1px solid #f0f0f0; /* Linha separadora sutil */
    background: #f8f9fa; /* Fundo levemente diferente */
    border-radius: 18px 18px 0 0; /* Bordas arredondadas apenas no topo */
}

.verification-badge {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* Conteúdo da mensagem da IA */
.ai-message-content {
    padding: 15px 20px; /* Padding apenas para o conteúdo */
}
