/* ====================================================================
   SISTEMA CHAT - Morada do Mar
   CSS Estrutural e de Layout
   Versão: 4.8
   ==================================================================== */

:root {
    --vdsc-theme: #25D366;
    --vdsc-btn-opt-bg: #ffffff;
    --vdsc-btn-opt-border: #25D366;
    --vdsc-btn-opt-text: #25D366;
    --vdsc-promo-title-bg: #fff3cd;
    --vdsc-promo-title-border: #ffc107;
    --vdsc-promo-title-text: #333333;
    --vdsc-btn-promo-bg: #ff6b6b;
    --vdsc-btn-promo-text: #ffffff;
    --vdsc-btn-action-bg: #25D366;
    --vdsc-btn-action-text: #ffffff;
    --vdsc-btn-site-bg: #0056b3;
    --vdsc-btn-site-text: #ffffff;
    --vdsc-btn-att-box-bg: #f8f9fa;
    --vdsc-btn-att-bg: #ffffff;
    --vdsc-btn-att-text: #334155;
}

.vdsc-chat-container { position: fixed; bottom: 30px; right: 30px; z-index: 999999; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.vdsc-chat-icon { width: 60px; height: 60px; background: linear-gradient(135deg, var(--vdsc-theme) 0%, #128C7E 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.15); transition: all 0.3s ease; border: none; padding: 0; overflow: hidden; }
.vdsc-chat-icon:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(0,0,0,0.2); }
.vdsc-chat-icon img { width: 100%; height: 100%; object-fit: cover; }
.vdsc-chat-icon svg { width: 32px; height: 32px; fill: white; }
.vdsc-chat-window { position: absolute; bottom: 80px; right: 0; width: 380px; max-width: calc(100vw - 40px); height: 550px; max-height: calc(100vh - 120px); background: white; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); display: none; flex-direction: column; overflow: hidden; animation: vdsc-slide-up 0.3s ease; }
.vdsc-chat-window.active { display: flex; }
@keyframes vdsc-slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.vdsc-chat-embed { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.vdsc-chat-embed .vdsc-chat-window-embed { width: 100%; height: 100%; display: flex; flex-direction: column; }
.vdsc-chat-full-container { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; width: 100% !important; }
.vdsc-chat-full-container .vdsc-chat-window-full { width: 100%; height: 100%; display: flex; flex-direction: column; }
.vdsc-chat-header { background: linear-gradient(135deg, var(--vdsc-theme) 0%, #128C7E 100%); color: white; padding: 20px; display: flex; align-items: center; gap: 12px; }
.vdsc-chat-header-icon { width: 40px; height: 40px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vdsc-chat-header-icon img { width: 100%; height: 100%; object-fit: cover; }
.vdsc-chat-header-icon svg { width: 24px; height: 24px; fill: white; }
.vdsc-chat-header-text h3 { margin: 0; font-size: 16px; font-weight: 600; }
.vdsc-chat-header-text p { margin: 4px 0 0 0; font-size: 12px; opacity: 0.9; }
.vdsc-chat-messages { flex: 1; overflow-y: auto; padding: 20px; background: #f5f5f5; scroll-behavior: smooth; }
.vdsc-message { margin-bottom: 16px; display: flex; flex-direction: column; animation: vdsc-fade-in 0.3s ease; }
@keyframes vdsc-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.vdsc-message.bot { align-items: flex-start; }
.vdsc-message.user { align-items: flex-end; }
.vdsc-message-bubble { max-width: 85%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.vdsc-message.bot .vdsc-message-bubble { background: white; color: #333; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.vdsc-message.user .vdsc-message-bubble { background: var(--vdsc-theme); color: white; border-bottom-right-radius: 4px; }
.vdsc-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.vdsc-option-btn { background: var(--vdsc-btn-opt-bg); border: 2px solid var(--vdsc-btn-opt-border); color: var(--vdsc-btn-opt-text); padding: 10px 16px; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s ease; text-align: left; }
.vdsc-option-btn:hover { background: var(--vdsc-btn-opt-border); color: white; transform: translateX(4px); }
.vdsc-promo-btn { background: linear-gradient(135deg, var(--vdsc-btn-promo-bg) 0%, #ee5a6f 100%); border: none; color: var(--vdsc-btn-promo-text); padding: 12px 16px; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all 0.2s ease; text-align: center; box-shadow: 0 2px 8px rgba(238, 90, 111, 0.3); }
.vdsc-promo-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(238, 90, 111, 0.4); }
.vdsc-promo-title { font-weight: 700; font-size: 15px; color: var(--vdsc-promo-title-text); margin: 15px 0 10px 0; padding: 8px 12px; background: var(--vdsc-promo-title-bg); border-radius: 8px; border-left: 4px solid var(--vdsc-promo-title-border); }
.vdsc-chat-input { padding: 16px; background: white; border-top: 1px solid #e0e0e0; display: flex; gap: 8px; flex-direction: column; }
.vdsc-chat-input input[type='text'], .vdsc-chat-input input[type='email'], .vdsc-chat-input input[type='tel'], .vdsc-chat-input input[type='number'] { width: 100%; padding: 10px 16px; border: 1px solid #e0e0e0; border-radius: 12px; font-size: 15px; outline: none; box-sizing: border-box; }
.vdsc-chat-input input[type='date'] { width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 15px; outline: none; background: white; cursor: pointer; box-sizing: border-box; }
.vdsc-chat-input input[type='date']:focus, .vdsc-chat-input input[type='number']:focus { border-color: var(--vdsc-theme); }
.vdsc-chat-input button { background: var(--vdsc-btn-action-bg); color: var(--vdsc-btn-action-text); border: none; padding: 12px 20px; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 500; transition: background 0.2s ease; }
.vdsc-chat-input button:hover { opacity: 0.9; }
.vdsc-chat-input button:disabled { background: #ccc; cursor: not-allowed; }
.vdsc-booking-btn { background: var(--vdsc-btn-site-bg); color: var(--vdsc-btn-site-text); border: none; padding: 14px 20px; border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 600; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s ease; width: 100%; text-decoration: none; box-sizing: border-box; text-align: center; line-height: 1.3; }
.vdsc-booking-btn:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3); }
.vdsc-whatsapp-btn { background: var(--vdsc-btn-action-bg); color: var(--vdsc-btn-action-text); border: none; padding: 12px 20px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s ease; width: 100%; text-decoration: none; }
.vdsc-whatsapp-btn:hover { opacity: 0.9; }
.vdsc-chat-messages::-webkit-scrollbar { width: 6px; }
.vdsc-chat-messages::-webkit-scrollbar-track { background: #f1f1f1; }
.vdsc-chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.vdsc-date-label, .vdsc-number-label { font-weight: 600; margin-bottom: 8px; display: block; color: #333; font-size: 14px; }
.vdsc-ages-container { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; margin-bottom: 12px; }
.vdsc-age-row { display: flex; align-items: center; gap: 10px; }
.vdsc-age-row label { font-weight: 600; font-size: 13px; color: #555; min-width: 70px; }
.vdsc-age-row input { flex: 1; padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; }
.vdsc-confirm-ages-btn { background: var(--vdsc-btn-action-bg); color: var(--vdsc-btn-action-text); border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 500; width: 100%; margin-top: 5px; }
.vdsc-confirm-ages-btn:disabled { background: #ccc; cursor: not-allowed; }
.vdsc-fallback-box { background: var(--vdsc-btn-att-box-bg); border: 1px dashed #cbd5e1; border-radius: 12px; padding: 15px; margin-top: 15px; text-align: center; }
.vdsc-fallback-title { font-size: 14px; color: #334155; margin-bottom: 12px; font-weight: 600; line-height: 1.4; }
.vdsc-fallback-btns { display: flex; gap: 8px; justify-content: center; }
.vdsc-fallback-btn { flex: 1; background: var(--vdsc-btn-att-bg); border: 1px solid #cbd5e1; color: var(--vdsc-btn-att-text); padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.vdsc-fallback-btn:hover { background: #f1f5f9; border-color: #94a3b8; transform: translateY(-1px); }
.vdsc-origin-info { font-size: 11px; color: #6b7280; margin-top: 8px; padding: 6px 10px; background: #f3f4f6; border-radius: 6px; border-left: 3px solid #9ca3af; }
.vdsc-origin-info a { color: #2563eb; text-decoration: none; word-break: break-all; }
.vdsc-origin-info a:hover { text-decoration: underline; }

/* ====================================================================
   NOVO v4.8: Menu de Opções Personalizáveis
   ==================================================================== */

.vdsc-menu-options { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.vdsc-menu-option-btn {
    background: var(--vdsc-btn-opt-bg);
    border: 2px solid var(--vdsc-btn-opt-border);
    color: var(--vdsc-btn-opt-text);
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vdsc-menu-option-btn:hover {
    background: var(--vdsc-btn-opt-border);
    color: white;
    transform: translateX(4px);
}

.vdsc-menu-option-btn .vdsc-menu-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.vdsc-menu-option-btn .vdsc-menu-text {
    flex: 1;
}

/* ====================================================================
   NOVO v4.8: Conteúdo Rich Text (COM BULLETS FUNCIONANDO)
   ==================================================================== */

.vdsc-rich-content {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.vdsc-rich-content::-webkit-scrollbar { width: 6px; }
.vdsc-rich-content::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.vdsc-rich-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.vdsc-rich-content h1,
.vdsc-rich-content h2,
.vdsc-rich-content h3,
.vdsc-rich-content h4 {
    margin: 12px 0 8px 0;
    color: #333;
    line-height: 1.3;
}

.vdsc-rich-content h1 { font-size: 18px; }
.vdsc-rich-content h2 { font-size: 16px; }
.vdsc-rich-content h3 { font-size: 15px; }
.vdsc-rich-content h4 { font-size: 14px; }

.vdsc-rich-content p {
    margin: 8px 0;
}

/* BULLETS E LISTAS - CORREÇÃO v4.8 */
.vdsc-rich-content ul {
    list-style-type: disc !important;
    list-style-position: outside !important;
    margin: 10px 0 !important;
    padding-left: 28px !important;
    display: block !important;
}

.vdsc-rich-content ol {
    list-style-type: decimal !important;
    list-style-position: outside !important;
    margin: 10px 0 !important;
    padding-left: 28px !important;
    display: block !important;
}

.vdsc-rich-content ul ul,
.vdsc-rich-content ol ol,
.vdsc-rich-content ul ol,
.vdsc-rich-content ol ul {
    margin: 4px 0 !important;
}

.vdsc-rich-content li {
    display: list-item !important;
    margin: 6px 0 !important;
    line-height: 1.5 !important;
    padding-left: 4px !important;
    text-align: left !important;
}

.vdsc-rich-content li::marker {
    color: var(--vdsc-theme);
    font-weight: bold;
}

.vdsc-rich-content a {
    color: #2563eb;
    text-decoration: underline;
}

.vdsc-rich-content a:hover {
    color: #1d4ed8;
}

.vdsc-rich-content strong,
.vdsc-rich-content b {
    font-weight: 700;
}

.vdsc-rich-content em,
.vdsc-rich-content i {
    font-style: italic;
}

.vdsc-rich-content u {
    text-decoration: underline;
}

.vdsc-rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}

.vdsc-rich-content blockquote {
    border-left: 4px solid var(--vdsc-theme);
    padding-left: 12px;
    margin: 10px 0;
    color: #555;
    font-style: italic;
}

/* Botão Voltar */
.vdsc-back-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vdsc-back-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Botão Atendente Condicional */
.vdsc-atendente-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    width: 100%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.vdsc-atendente-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.vdsc-atendente-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progresso de Leitura */
.vdsc-reading-progress {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.vdsc-progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.vdsc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}