/**
 * Estilos do ChatBot - Frontend
 * 
 * Copyright 2025 - FEMCA Consultoria e Desenvolvimento de Sistemas
 * Desenvolvido por Francisco Eduardo Meira de Castro Alves
 * 
 * @package FEMCA_WP_AI_Chatbot
 * @version 1.0.0
 */

:root {
    --chatbot-primary-color: #0084ff;
    --chatbot-bubble-color: #0084ff;
    --chatbot-bubble-icon-color: #ffffff;
    --chatbot-header-color: #0084ff;
    --chatbot-header-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --chatbot-bg-light: #ffffff;
    --chatbot-bg-dark: #1a1a1a;
    --chatbot-text-light: #333333;
    --chatbot-text-dark: #ffffff;
}

/* Container principal */
.chatbot-container {
    position: fixed !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chatbot-bottom-right {
    bottom: 20px !important;
    right: 20px !important;
}

.chatbot-bottom-left {
    bottom: 20px !important;
    left: 20px !important;
}

/* Botão flutuante */
.chatbot-bubble {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: var(--chatbot-bubble-color) !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chatbot-size-small .chatbot-bubble {
    width: 50px;
    height: 50px;
}

.chatbot-size-large .chatbot-bubble {
    width: 70px;
    height: 70px;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Pulsating Animation */
.chatbot-bubble.pulsating {
    animation: chatbot-pulse 2s ease-in-out infinite;
}

@keyframes chatbot-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 20px rgba(0, 132, 255, 0.4);
    }
}

.chatbot-bubble svg {
    width: 28px;
    height: 28px;
    color: var(--chatbot-bubble-icon-color) !important;
    fill: var(--chatbot-bubble-icon-color) !important;
}

.chatbot-bubble-icon,
.chatbot-bubble-close {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.chatbot-countdown {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background: #ff4444 !important;
    color: white !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: bold !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    z-index: 10 !important;
    animation: pulse 1s ease-in-out infinite !important;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.chatbot-bubble-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* Janela do chat */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    overflow: hidden;
    animation: chatbot-slideUp 0.3s ease;
}

/* When chatbot is open, use flexbox layout */
.chatbot-window[style*="display: block"] {
    display: flex !important;
}

.chatbot-bottom-right .chatbot-window {
    right: 0;
}

.chatbot-bottom-left .chatbot-window {
    left: 0;
}

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

/* Cabeçalho */
.chatbot-header {
    background: var(--chatbot-header-color);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
    flex: 0 0 auto !important;
}

.chatbot-header-info {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
}

.chatbot-status-indicator {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    background: #4caf50 !important;
    border-radius: 50% !important;
    animation: pulse 2s infinite !important;
    flex-shrink: 0 !important;
}

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

.chatbot-title {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: var(--chatbot-header-font) !important;
    color: white !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.chatbot-header-image {
    max-height: 50px !important;
    max-width: 150px !important;
    height: auto !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
}

.chatbot-context-indicator {
    margin-top: 2px;
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.chatbot-header button {
    background: transparent;
    border: none;
    color: var(--chatbot-header-icons-color) !important;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.chatbot-header button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chatbot-header button svg {
    width: 20px;
    height: 20px;
    color: var(--chatbot-header-icons-color) !important;
    fill: var(--chatbot-header-icons-color) !important;
}

.chatbot-clear:hover {
    background: rgba(255, 67, 54, 0.2) !important;
}

/* Tooltip para atalhos */
.chatbot-clear {
    position: relative;
}

.chatbot-clear:hover::after {
    content: 'Ctrl+Shift+L';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Modal de confirmação customizado */
.chatbot-confirm-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 280px;
    animation: slideIn 0.2s ease;
}

.chatbot-confirm-dialog h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.chatbot-confirm-dialog p {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #666;
}

.chatbot-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.chatbot-confirm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-confirm-btn-cancel {
    background: #f0f0f0;
    color: #333;
}

.chatbot-confirm-btn-cancel:hover {
    background: #e0e0e0;
}

.chatbot-confirm-btn-clear {
    background: #ff4444;
    color: white;
}

.chatbot-confirm-btn-clear:hover {
    background: #ff3333;
}

.chatbot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Advertisement Container */
.chatbot-ad-container {
    position: relative;
    flex: 1 1 auto !important;
    overflow: hidden;
}

/* Área de mensagens */
.chatbot-messages {
    flex: 1 1 auto !important;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #f5f5f5;
    scroll-behavior: smooth;
}

/* Força scrollbar sempre visível para melhor UX */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.chatbot-message {
    display: flex;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

.chatbot-message-user {
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative !important;
    overflow: hidden !important;
}

.chatbot-message-user .chatbot-message-avatar {
    background: var(--chatbot-primary-color);
}

.chatbot-message-avatar svg {
    width: 20px;
    height: 20px;
    color: #666;
}

.chatbot-message-user .chatbot-message-avatar svg {
    color: white;
}

.chatbot-avatar-image {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

.chatbot-message-content {
    margin: 0 12px;
    max-width: 70%;
}

.chatbot-message-bubble {
    background: white;
    padding: 10px 14px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

/* Estilos para conteúdo HTML formatado */
.chatbot-message-bubble p {
    margin: 0 0 10px 0;
}

.chatbot-message-bubble p:last-child {
    margin-bottom: 0;
}

.chatbot-message-bubble strong,
.chatbot-message-bubble b {
    font-weight: 600;
    color: inherit;
}

.chatbot-message-bubble em,
.chatbot-message-bubble i {
    font-style: italic;
}

.chatbot-message-bubble code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.chatbot-message-bubble pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.chatbot-message-bubble pre code {
    background: transparent;
    padding: 0;
}

.chatbot-message-bubble ul,
.chatbot-message-bubble ol {
    margin: 10px 0;
    padding-left: 20px;
}

.chatbot-message-bubble li {
    margin: 5px 0;
}

.chatbot-message-bubble a {
    color: var(--chatbot-primary-color);
    text-decoration: underline;
}

.chatbot-message-bubble a:hover {
    text-decoration: none;
}

.chatbot-message-bubble h2,
.chatbot-message-bubble h3,
.chatbot-message-bubble h4 {
    margin: 10px 0 5px 0;
    font-weight: 600;
}

.chatbot-message-bubble h2 {
    font-size: 18px;
}

.chatbot-message-bubble h3 {
    font-size: 16px;
}

.chatbot-message-bubble h4 {
    font-size: 15px;
}

.chatbot-message-bubble blockquote {
    border-left: 3px solid var(--chatbot-primary-color);
    padding-left: 10px;
    margin: 10px 0;
    font-style: italic;
    color: #666;
}

.chatbot-message-user .chatbot-message-bubble {
    background: var(--chatbot-primary-color);
    color: white;
}

.chatbot-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

/* Controles de áudio */
.chatbot-audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.chatbot-audio-button,
.chatbot-audio-download {
    background: var(--chatbot-primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-audio-button:hover,
.chatbot-audio-download:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.chatbot-audio-button:disabled,
.chatbot-audio-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-audio-button svg,
.chatbot-audio-download svg {
    width: 16px;
    height: 16px;
}

.chatbot-audio-download {
    background: #4caf50;
}

.chatbot-audio-download:hover {
    background: #45a049;
}

.chatbot-audio-progress {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.chatbot-audio-progress-bar {
    height: 100%;
    background: var(--chatbot-primary-color);
    border-radius: 2px;
    transition: width 0.1s;
    width: 0%;
}

.chatbot-audio-time {
    font-size: 11px;
    color: #666;
    min-width: 45px;
}

.chatbot-audio-loading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.chatbot-audio-loading-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: var(--chatbot-primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Botão de gerar áudio */
.chatbot-generate-audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 4px 10px;
    background: transparent;
    color: var(--chatbot-primary-color);
    border: 1px solid var(--chatbot-primary-color);
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-generate-audio-btn:hover {
    background: var(--chatbot-primary-color);
    color: white;
}

.chatbot-generate-audio-btn svg {
    width: 14px;
    height: 14px;
}

/* Indicador de digitação */
.chatbot-typing {
    padding: 10px 20px;
    background: #f5f5f5;
    flex: 0 0 auto !important;
}

.chatbot-typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

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

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

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

/* Área de input */
.chatbot-input-area {
    padding: 8px 12px;
    background: white;
    border-top: 1px solid #e0e0e0;
    flex: 0 0 auto !important;
    box-sizing: border-box;
}

.chatbot-form {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    margin: 0;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    background: white;
    min-width: 0;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.chatbot-input:focus {
    border-color: var(--chatbot-header-color);
}

.chatbot-send-button {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    background: var(--chatbot-send-button-color) !important;
    border: none !important;
    color: var(--chatbot-send-icon-color) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chatbot-send-button:hover {
    background: var(--chatbot-send-button-color) !important;
    transform: scale(1.05);
}

.chatbot-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-button svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    color: var(--chatbot-send-icon-color) !important;
    fill: var(--chatbot-send-icon-color) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Tema escuro */
.chatbot-theme-dark .chatbot-window {
    background: #2a2a2a;
}

.chatbot-theme-dark .chatbot-messages {
    background: #1a1a1a;
}

.chatbot-theme-dark .chatbot-message-bubble {
    background: #3a3a3a;
    color: #e0e0e0;
}

.chatbot-theme-dark .chatbot-message-bubble code {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
}

.chatbot-theme-dark .chatbot-message-bubble pre {
    background: rgba(255, 255, 255, 0.05);
}

.chatbot-theme-dark .chatbot-message-bubble blockquote {
    border-left-color: var(--chatbot-primary-color);
    color: #aaa;
}

.chatbot-theme-dark .chatbot-message-bubble h2,
.chatbot-theme-dark .chatbot-message-bubble h3,
.chatbot-theme-dark .chatbot-message-bubble h4 {
    color: #f0f0f0;
}

.chatbot-theme-dark .chatbot-input-area {
    background: #2a2a2a;
    border-top-color: #3a3a3a;
}

.chatbot-theme-dark .chatbot-input {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #e0e0e0;
}

.chatbot-theme-dark .chatbot-typing {
    background: #1a1a1a;
}

.chatbot-theme-dark .chatbot-typing-indicator {
    background: #3a3a3a;
}

/* Responsivo */
@media (max-width: 480px) {
    .chatbot-window {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        bottom: 0;
        right: 0 !important;
        left: 0 !important;
        border-radius: 0;
        position: fixed;
    }

    .chatbot-bubble {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-header {
        border-radius: 0;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .chatbot-window {
        width: 350px;
        height: 500px;
        max-height: 70vh;
    }
}

/* Botão customizado */
.chatbot-trigger-button,
.chatbot-custom-button {
    background: var(--chatbot-primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.chatbot-trigger-button:hover,
.chatbot-custom-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

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

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

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

/* Animação de minimizar */
.chatbot-window.minimized {
    animation: chatbot-slideDown 0.3s ease;
    display: none;
}

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

/* Debug Modal */
.chatbot-debug-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: chatbot-debug-fadeIn 0.3s ease;
}

@keyframes chatbot-debug-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chatbot-debug-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: chatbot-debug-slideUp 0.3s ease;
}

.chatbot-theme-dark .chatbot-debug-modal-content {
    background: #2a2a2a;
    color: #fff;
}

@keyframes chatbot-debug-slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chatbot-debug-modal-header {
    background: var(--chatbot-primary-color);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-debug-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-debug-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-debug-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chatbot-debug-close svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.chatbot-debug-modal-body {
    padding: 20px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
}

.chatbot-debug-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--chatbot-primary-color);
}

.chatbot-theme-dark .chatbot-debug-section {
    background: #1a1a1a;
}

.chatbot-debug-section h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--chatbot-primary-color);
}

.chatbot-debug-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.chatbot-theme-dark .chatbot-debug-item {
    border-bottom-color: #333;
}

.chatbot-debug-item:last-child {
    border-bottom: none;
}

.chatbot-debug-label {
    font-weight: 600;
    color: #495057;
    min-width: 150px;
    font-size: 14px;
    line-height: 1.4;
}

.chatbot-theme-dark .chatbot-debug-label {
    color: #aaa;
}

.chatbot-debug-value {
    color: #212529;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.chatbot-theme-dark .chatbot-debug-value {
    color: #fff;
}

/* Scrollbar para o debug modal */
.chatbot-debug-modal-body::-webkit-scrollbar {
    width: 8px;
}

.chatbot-debug-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-theme-dark .chatbot-debug-modal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.chatbot-debug-modal-body::-webkit-scrollbar-thumb {
    background: var(--chatbot-primary-color);
    border-radius: 4px;
}

.chatbot-debug-modal-body::-webkit-scrollbar-thumb:hover {
    background: #0066cc;
}

/* Textarea do conteúdo da página no debug modal */
.chatbot-debug-content-wrapper {
    width: 100%;
    margin-top: 10px;
}

.chatbot-debug-content-textarea {
    width: 100% !important;
    min-height: 200px !important;
    max-height: 400px !important;
    padding: 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    resize: vertical !important;
    background: #f9f9f9 !important;
    color: #333 !important;
    overflow-y: auto !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
}

.chatbot-theme-dark .chatbot-debug-content-textarea {
    background: #0a0a0a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

.chatbot-debug-content-textarea:focus {
    outline: 2px solid var(--chatbot-primary-color) !important;
    outline-offset: -2px !important;
}

/* Scrollbar para o textarea */
.chatbot-debug-content-textarea::-webkit-scrollbar {
    width: 8px;
}

.chatbot-debug-content-textarea::-webkit-scrollbar-track {
    background: #e0e0e0;
}

.chatbot-theme-dark .chatbot-debug-content-textarea::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.chatbot-debug-content-textarea::-webkit-scrollbar-thumb {
    background: var(--chatbot-primary-color);
    border-radius: 4px;
}

.chatbot-debug-content-textarea::-webkit-scrollbar-thumb:hover {
    background: #0066cc;
}

/* Responsividade do debug modal */
@media (max-width: 768px) {
    .chatbot-debug-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .chatbot-debug-section {
        padding: 10px;
    }

    .chatbot-debug-item {
        flex-direction: column;
        gap: 5px;
    }

    .chatbot-debug-label {
        min-width: auto;
    }

    .chatbot-debug-value {
        text-align: left;
    }

    .chatbot-debug-content-textarea {
        min-height: 150px !important;
        font-size: 13px !important;
    }
}
