/* ===== ESTILOS DO CHATBOT OPENAI V3 ===== */

/* Resetar estilos padrão para evitar conflitos */
#ocv3-chatbot-container,
#ocv3-chatbot-container *,
#ocv3-chatbot-launcher {
    box-sizing: border-box;
}

/* ===== CONTAINER DO CHATBOT ===== */
#ocv3-chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    display: none !important;
    flex-direction: column;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    z-index: 2147483647 !important;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: #333;
}

#ocv3-chatbot-container.active {
    display: flex !important;
}

/* ===== HEADER DO CHATBOT ===== */
#ocv3-chatbot-header {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid #e0e0e0;
}

#ocv3-bot-name-display {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
}

#ocv3-chatbot-close {
    background: none !important;
    border: none !important;
    color: #ffffff !important;
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    margin: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

#ocv3-chatbot-close:hover {
    opacity: 0.8;
}

/* ===== ÁREA DE MENSAGENS ===== */
#ocv3-chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrollbar customizada */
#ocv3-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#ocv3-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#ocv3-chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#ocv3-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ===== MENSAGENS ===== */
.ocv3-msg {
    padding: 12px 14px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    animation: slideIn 0.3s ease-out;
}

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

/* Mensagem do usuário */
.ocv3-user-msg {
    background: #0073aa;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    margin-left: auto;
}

/* Mensagem do bot */
.ocv3-bot-msg {
    background: #e9ecef;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

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

.ocv3-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* ===== ÁREA DE INPUT ===== */
#ocv3-chatbot-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e0e0e0;
    background: #ffffff;
    flex-shrink: 0;
}

#ocv3-user-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

#ocv3-user-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

#ocv3-user-input::placeholder {
    color: #999;
}

#ocv3-send-btn {
    background: #0073aa !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 18px !important;
    border-radius: 20px !important;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    flex-shrink: 0;
}

#ocv3-send-btn:hover {
    background: #005a87 !important;
}

#ocv3-send-btn:active {
    transform: scale(0.95);
}

/* ===== BOTÃO LAUNCHER ===== */
#ocv3-chatbot-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    z-index: 2147483647 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
}

#ocv3-chatbot-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

#ocv3-chatbot-launcher:active {
    transform: scale(0.95);
}

#ocv3-chatbot-launcher.hidden {
    display: none !important;
}

/* ===== RESPONSIVIDADE PARA TABLETS ===== */
@media screen and (max-width: 768px) {
    #ocv3-chatbot-container {
        width: calc(100% - 20px);
        height: 60vh;
        max-height: 600px;
        bottom: 90px;
        right: 10px;
        left: 10px;
    }
    
    #ocv3-chatbot-launcher {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
}

/* ===== RESPONSIVIDADE PARA MOBILE ===== */
@media screen and (max-width: 480px) {
    #ocv3-chatbot-container {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        z-index: 2147483647 !important;
    }
    
    #ocv3-chatbot-launcher {
        bottom: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    .ocv3-msg {
        max-width: 90%;
    }
}

/* ===== IMPRESSÃO ===== */
@media print {
    #ocv3-chatbot-container,
    #ocv3-chatbot-launcher {
        display: none !important;
    }
}
