/* Estilos do Chatbot Gráfica */

/* Widget flutuante do chat */
.chatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.chatbot-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.chatbot-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.chatbot-widget.top-right {
    top: 20px;
    right: 20px;
}

.chatbot-widget.top-left {
    top: 20px;
    left: 20px;
}

/* Botão de toggle do chat */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbot-primary-color, #007cba);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chatbot-toggle.active {
    background: #dc3545;
}

/* Container do chat */
.chatbot-container {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.chatbot-container.show {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cabeçalho do chat */
.chatbot-header {
    background: var(--chatbot-primary-color, #007cba);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Área de mensagens */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chatbot-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
}

.chatbot-message.user {
    justify-content: flex-end;
}

.chatbot-message.bot {
    justify-content: flex-start;
}

.chatbot-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chatbot-message.user .chatbot-message-content {
    background: var(--chatbot-primary-color, #007cba);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message.bot .chatbot-message-content {
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 4px;
}

/* Mensagem de arquivo */
.file-message {
    display: flex;
    align-items: center;
    background: #f8f9fa !important;
    color: #333 !important;
    border: 1px solid #e1e5e9 !important;
}

.file-icon {
    font-size: 24px;
    margin-right: 12px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-word;
}

.file-download {
    color: var(--chatbot-primary-color, #007cba);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}

.file-download:hover {
    text-decoration: underline;
}

/* Avatar do bot */
.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chatbot-primary-color, #007cba);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Indicador de digitação */
.chatbot-typing {
    display: none;
    align-items: center;
    margin-bottom: 16px;
}

.chatbot-typing.show {
    display: flex;
}

.chatbot-typing-dots {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.chatbot-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.chatbot-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.chatbot-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Indicador de upload */
.chatbot-uploading {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.uploading-content {
    margin-left: 8px;
}

.uploading-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.uploading-progress {
    width: 100px;
    height: 4px;
    background: #e1e5e9;
    border-radius: 2px;
    overflow: hidden;
}

.uploading-progress::after {
    content: '';
    display: block;
    width: 50%;
    height: 100%;
    background: var(--chatbot-primary-color, #007cba);
    animation: uploading 1.5s infinite ease-in-out;
}

@keyframes uploading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* Área de input */
.chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 20px;
    max-height: 80px;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary-color, #007cba);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Botão de upload */
.chatbot-upload-btn {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    background: none;
    border: none;
    font-size: 18px;
    transition: background-color 0.2s;
}

.chatbot-upload-btn:hover {
    background: #f0f0f0;
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--chatbot-primary-color, #007cba);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    background: var(--chatbot-primary-color-dark, #005a87);
}

.chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Mensagem de erro */
.chatbot-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Responsividade */
@media (max-width: 480px) {
    .chatbot-container {
        width: 320px;
        height: 450px;
    }
    
    .chatbot-widget.bottom-right,
    .chatbot-widget.top-right {
        right: 10px;
    }
    
    .chatbot-widget.bottom-left,
    .chatbot-widget.top-left {
        left: 10px;
    }
    
    .chatbot-widget.bottom-right .chatbot-container,
    .chatbot-widget.bottom-left .chatbot-container {
        bottom: 70px;
    }
    
    .chatbot-widget.top-right .chatbot-container,
    .chatbot-widget.top-left .chatbot-container {
        top: 70px;
    }
}

/* Shortcode do chat */
.chatbot-shortcode {
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.chatbot-shortcode .chatbot-header {
    background: var(--chatbot-primary-color, #007cba);
    color: white;
    padding: 16px 20px;
}

.chatbot-shortcode .chatbot-messages {
    background: #f8f9fa;
    min-height: 300px;
}

.chatbot-shortcode .chatbot-input-area {
    background: white;
    border-top: 1px solid #e1e5e9;
}

/* Scrollbar personalizada */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}