/* ===== CHATBOT STYLES - VERSÃO COM FOCO NAS MENSAGENS ===== */

/* Container principal - MAIOR */
#chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 480px; /* Aumentado de 450px */
    max-width: 90vw;
    height: 750px; /* Aumentado de 700px */
    max-height: 85vh;
    background: linear-gradient(135deg, 
        var(--color-primary, #0f0f0f) 0%,
        var(--color-secondary, #1a1a1a) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(139, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
}

/* Estados do chat */
.chatbot-hidden {
    transform: translateY(100px) scale(0.9);
    opacity: 0;
    visibility: hidden;
}

.chatbot-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Header mais compacto para dar mais espaço às mensagens */
.chatbot-header {
    background: linear-gradient(135deg, 
        var(--color-accent, #8B0000) 0%,
        #700000 100%);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 70px; /* Reduzido de 85px */
    flex-shrink: 0; /* Não encolhe */
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1;
}

.chatbot-title i {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.chatbot-title-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.chatbot-title h3 {
    margin: 0;
    font-size: 1.25rem;
    color: white;
    font-weight: 700;
    line-height: 1.2;
}

.chatbot-subtitle {
    font-size: 0.8125rem;
    opacity: 0.9;
    font-weight: 400;
}

.chatbot-status {
    font-size: 0.75rem;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.chatbot-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulseOnline 2s infinite;
}

/* ===== ÁREA DE MENSAGENS - MUITO MAIOR ===== */
.chatbot-messages {
    flex: 1; /* Ocupa todo o espaço disponível */
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: linear-gradient(180deg, 
        rgba(15, 15, 15, 0.95) 0%,
        rgba(26, 26, 26, 0.98) 100%);
    min-height: 300px; /* Altura mínima garantida */
}

/* Scrollbar mais visível */
.chatbot-messages::-webkit-scrollbar {
    width: 10px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin: 5px 0;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        var(--color-accent, #8B0000) 0%,
        #600000 100%);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        var(--color-accent-light, #a00000) 0%,
        #700000 100%);
}

/* ===== MENSAGENS GRANDES E CLARAS ===== */
.message {
    max-width: 90%;
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem; /* Aumentado para melhor legibilidade */
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: messageAppear 0.3s ease-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    margin: 0.25rem 0;
}

/* Mensagem do bot - MAIOR */
.message-bot {
    background: linear-gradient(135deg, 
        rgba(42, 42, 42, 0.95) 0%,
        rgba(34, 34, 34, 0.95) 100%);
    align-self: flex-start;
    border-bottom-left-radius: 8px;
    border-left: 4px solid var(--color-accent, #8B0000);
    margin-right: auto;
    max-width: 85%; /* Ligeiramente menor para melhor leitura */
}

/* Mensagem do usuário - MAIOR */
.message-user {
    background: linear-gradient(135deg, 
        var(--color-accent, #8B0000) 0%,
        #700000 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 8px;
    border-right: 4px solid var(--color-gold, #D4AF37);
    margin-left: auto;
    max-width: 85%;
}

/* Mensagem de serviço - MAIOR */
.message-service {
    background: linear-gradient(135deg, 
        rgba(139, 0, 0, 0.15) 0%,
        rgba(212, 175, 55, 0.08) 100%);
    border: 1px solid rgba(139, 0, 0, 0.25);
    border-left: 4px solid var(--color-accent, #8B0000);
    padding: 1.5rem;
    margin: 0.75rem 0;
    border-radius: 18px;
    width: 92%;
    align-self: center;
    backdrop-filter: blur(20px);
}

/* Imagens dentro das mensagens - NÃO CORTA MAIS */
.message img,
.message-service img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
    margin: 1rem 0;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: contain; /* Garante que a imagem inteira seja visível */
}

/* Conteúdo dentro das mensagens */
.message strong {
    color: var(--color-gold, #D4AF37);
    font-weight: 700;
    font-size: 1.05rem;
}

.message-service strong {
    color: var(--color-accent, #8B0000);
    font-size: 1.1rem;
}

.message ul,
.message ol,
.message-service ul,
.message-service ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.message li,
.message-service li {
    margin: 0.5rem 0;
    color: inherit;
    font-size: 0.95rem;
}

/* ===== CARROSSEL DE OPÇÕES - MAIS COMPACTO ===== */
.chatbot-options {
    padding: 1.25rem;
    background: rgba(26, 26, 26, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 180px; /* Reduzido de 240px */
    overflow-y: auto;
    flex-shrink: 0; /* Não encolhe */
}

.option-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.875rem;
    padding-bottom: 0.25rem;
}

/* Item de opção mais compacto */
.option-item {
    background: linear-gradient(135deg, 
        rgba(42, 42, 42, 0.9) 0%,
        rgba(34, 34, 34, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 120px; /* Reduzido de 150px */
}

.option-item:hover {
    transform: translateY(-3px);
    border-color: var(--color-accent, #8B0000);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.2);
}

.option-icon {
    font-size: 1.5rem; /* Reduzido de 2rem */
    color: var(--color-gold, #D4AF37);
    margin-bottom: 0.75rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 12px;
}

.option-title {
    font-size: 0.9375rem; /* Reduzido de 1rem */
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--color-gray-100, #fff);
    line-height: 1.3;
}

.option-desc {
    font-size: 0.75rem; /* Reduzido de 0.8125rem */
    color: var(--color-gray-80, #ccc);
    line-height: 1.4;
}

/* ===== FORMULÁRIO - COMPACTO ===== */
.chatbot-form {
    padding: 1.5rem;
    background: var(--color-primary, #0f0f0f);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0; /* Não encolhe */
}

.form-step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.4s ease-out;
}

.chatbot-form input {
    padding: 0.875rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-gray-100, #fff);
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    min-height: 48px;
}

/* Botões do formulário - compactos */
.btn-chat-next, 
.btn-chat-submit {
    background: linear-gradient(135deg, 
        var(--color-accent, #8B0000) 0%,
        #700000 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9375rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.25px;
}

/* ===== BOTÕES DE AÇÃO DENTRO DAS MENSAGENS ===== */
.action-btn {
    background: rgba(139, 0, 0, 0.15);
    border: 1px solid rgba(139, 0, 0, 0.25);
    color: var(--color-gray-100, #fff);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    margin: 0.25rem 0;
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: rgba(139, 0, 0, 0.25);
    transform: translateX(5px);
    border-color: var(--color-accent, #8B0000);
}

/* ===== BOTÃO FLUTUANTE ===== */
#chatToggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, 
        var(--color-accent, #8B0000) 0%,
        #700000 100%);
    border-radius: 18px;
    border: none;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.4);
}

#chatToggle:hover {
    background: linear-gradient(135deg, 
        var(--color-accent-light, #a00000) 0%,
        #800000 100%);
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(139, 0, 0, 0.5);
}

#chatToggle.chat-active {
    background: var(--color-tertiary, #2a2a2a);
    transform: rotate(90deg);
}

/* ===== ANIMAÇÕES ===== */
@keyframes slideInUp {
    from {
        transform: translateY(100px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseOnline {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    #chatbot-container {
        width: calc(100vw - 32px);
        height: 80vh; /* Aumentado para mobile */
        right: 16px;
        bottom: 90px;
        border-radius: 20px;
        max-height: 80vh;
    }
    
    /* Área de mensagens maior no mobile */
    .chatbot-messages {
        padding: 1.25rem;
        gap: 1rem;
        min-height: 250px;
    }
    
    .message {
        max-width: 92%;
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
        border-radius: 18px;
    }
    
    .message-service {
        padding: 1.25rem;
        width: 95%;
    }
    
    /* Carrossel mais compacto no mobile */
    .chatbot-options {
        max-height: 150px;
        padding: 1rem;
    }
    
    .option-carousel {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    
    .option-item {
        min-height: 110px;
        padding: 0.875rem;
    }
    
    .option-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .option-title {
        font-size: 0.875rem;
    }
    
    .option-desc {
        font-size: 0.6875rem;
    }
    
    /* Formulário compacto no mobile */
    .chatbot-form {
        padding: 1.25rem;
    }
    
    .chatbot-form input {
        padding: 0.75rem 1rem;
        min-height: 44px;
        font-size: 0.875rem;
    }
    
    .btn-chat-next,
    .btn-chat-submit {
        padding: 0.75rem 1.25rem;
        min-height: 44px;
        font-size: 0.875rem;
    }
    
    /* Botão flutuante menor no mobile */
    #chatToggle {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        bottom: 20px;
        right: 20px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    #chatbot-container {
        width: calc(100vw - 24px);
        height: 75vh;
        right: 12px;
        bottom: 80px;
    }
    
    .chatbot-messages {
        padding: 1rem;
        gap: 0.875rem;
    }
    
    .message {
        max-width: 94%;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .message-service {
        padding: 1rem;
    }
    
    /* Carrossel uma coluna no mobile muito pequeno */
    .option-carousel {
        grid-template-columns: 1fr;
    }
    
    .option-item {
        min-height: auto;
        height: auto;
        padding: 1rem;
    }
    
    /* Formulário ajustado */
    .chatbot-form {
        padding: 1rem;
    }
    
    .lgpd-checkbox {
        padding: 0.875rem;
        margin: 1rem 0;
    }
}

/* Ajuste para telas altas */
@media (min-height: 900px) {
    #chatbot-container {
        height: 800px;
        max-height: 75vh;
    }
    
    .chatbot-messages {
        min-height: 350px;
    }
}

/* Garantir que as imagens nunca sejam cortadas */
.message img,
.message-service img,
.file-preview-item img {
    max-width: 100% !important;
    max-height: 300px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0.75rem auto !important;
}

/* Ajuste específico para imagens em mensagens do usuário */
.message-user img {
    max-width: 95% !important;
}

/* Melhorar visualização de listas longas */
.message-service ul,
.message-service ol {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.message-service ul::-webkit-scrollbar,
.message-service ol::-webkit-scrollbar {
    width: 4px;
}

.message-service ul::-webkit-scrollbar-thumb,
.message-service ol::-webkit-scrollbar-thumb {
    background: rgba(139, 0, 0, 0.3);
    border-radius: 2px;
}