﻿:root { /* WhatsApp tonları */ --wa-header: #075E54; --wa-bg: #ECE5DD; --wa-in: #FFFFFF; --wa-out: #DCF8C6; --wa-text: #111B21; --wa-muted: #667781; --wa-btn: #25D366; --radius: 10px; --shadow: 0 1px 1px rgba(0,0,0,.12); /* JS visualViewport ile set eder */ --app-height: 100vh; --vv-top: 0px; }

/* ---------- PAGE MODE (standalone sayfa) ----------
   JS page modda html/body'ye cb-open ekler */
html.cb-open, body.cb-open { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; /* body kaymasın */ overscroll-behavior: none; background: var(--wa-bg); -webkit-text-size-adjust: 100%; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif; color: var(--wa-text); }

    /* Root chatbot container (page modda visualViewport’a kilit) */
    html.cb-open .enak-chatbot.chat-widget { position: fixed; left: 0; right: 0; top: var(--vv-top); height: var(--app-height); max-height: var(--app-height); display: flex; flex-direction: column; background: var(--wa-bg); }

/* Eğer widget shell içinde (panel) kullanırsan: panel kendi yüksekliğini yönetir */
.chatbot-panel .enak-chatbot.chat-widget { position: relative; top: auto; height: 100%; max-height: none; }

/* ---------- HEADER ---------- */
.enak-chatbot .chat-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--wa-header); padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); box-shadow: var(--shadow); }

.enak-chatbot .chat-title { display: flex; align-items: center; gap: 10px; min-width: 0; }

.enak-chatbot .chat-avatar { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 999px; overflow: hidden; }

    .enak-chatbot .chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.enak-chatbot .chat-name { font-weight: 700; color: #fff; line-height: 1.1; font-size: 15px; }

.enak-chatbot .chat-sub { font-size: 12px; color: rgba(255,255,255,.85); margin-top: 2px; line-height: 1.1; }

/* ---------- BODY (scroll alanı) ---------- */
.enak-chatbot .chat-body { background-color: #ECE5DD; background-image: url("/img/enakliyat_chat_bg_tile.webp"); background-repeat: repeat; background-size: 410px 410px; flex: 1 1 auto; min-height: 0; /* flex child scroll fix (kritik) */ overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px; overscroll-behavior: contain; }

.enak-chatbot #chatbox { display: flex; flex-direction: column; gap: 8px; }

/* ---------- BUBBLES ---------- */
.enak-chatbot .message { display: flex; width: 100%; }

    .enak-chatbot .message.user { justify-content: flex-end; }
    .enak-chatbot .message.bot { justify-content: flex-start; }

.enak-chatbot .bubble { position: relative; width: fit-content; max-width: 82%; padding: 6px 9px; /* padding küçüldü */ border-radius: var(--radius); box-shadow: 0 0 5px rgba(0,0,0,.12); border-bottom: 1px solid #d1d1d1; line-height: 1.28; font-size: 15px; word-break: break-word; color: var(--wa-text); }

@media (min-width:768px) {
    .enak-chatbot .bubble { max-width: 45%; }
}

.enak-chatbot .message.bot .bubble { background: var(--wa-in); }
.enak-chatbot .message.user .bubble { background: var(--wa-out); }

.enak-chatbot .bubble-name { font-size: 12px; font-weight: 700; color: #128C7E; margin: 0 0 3px 0; line-height: 1.1; }

/* kuyruklar */
.enak-chatbot .message.bot .bubble::after { content: ""; position: absolute; left: -6px; top: 12px; width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-right: 8px solid var(--wa-in); }
.enak-chatbot .message.user .bubble::after { content: ""; position: absolute; right: -6px; top: 12px; width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 8px solid var(--wa-out); }

/* ---------- INPUT BAR ---------- */
.enak-chatbot .chat-inputbar { flex: 0 0 auto; display: flex; align-items: stretch; gap: 10px; padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); background: #f0f2f5; border-top: 1px solid rgba(0,0,0,.06); }

.enak-chatbot textarea,
.enak-chatbot input { font-size: 16px; /* iOS focus zoom kırmak için kritik */ }

.enak-chatbot #inputText { flex: 1 1 auto; resize: none; line-height: 23px; min-height: 23px; max-height: 69px; border: none; outline: none; border-radius: 10px; background: #fff; padding: 10px 12px; font-size: 16px; box-sizing: content-box !important; box-shadow: var(--shadow); overflow-y: hidden; -webkit-overflow-scrolling: touch; }

.enak-chatbot .send-btn { width: 44px; border: none; border-radius: 14px; background: var(--wa-btn); color: #fff; cursor: pointer; box-shadow: var(--shadow); font-size: 18px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }

    .enak-chatbot .send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* typing indicator (varsa) */
.enak-chatbot .typing { display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; }
    .enak-chatbot .typing .dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(0,0,0,.25); animation: bounce 1.2s infinite ease-in-out; }
        .enak-chatbot .typing .dot:nth-child(2) { animation-delay: .15s; }
        .enak-chatbot .typing .dot:nth-child(3) { animation-delay: .30s; }

@keyframes bounce {
    0%,80%,100% { transform: translateY(0); opacity: .3; }
    40% { transform: translateY(-4px); opacity: .9; }
}

/* ---------- (Opsiyonel) Widget shell stilleri ----------
   Bu sayfada kullanmıyorsan bile çakışmaz; hepsi .chatbot-root/.chatbot-panel altında */
html.chatbot-open, body.chatbot-open { overflow: hidden !important; height: 100%; overscroll-behavior: none; }

.chatbot-root { position: fixed; inset: auto 16px 16px auto; z-index: 999999; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

.chatbot-launcher { width: 56px; height: 56px; border: 0; border-radius: 50%; background: #25D366; color: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.22); display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.chatbot-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

.chatbot-panel { position: fixed; right: 16px; bottom: 88px; width: min(420px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 120px)); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.22); overflow: hidden; transform: translateY(12px); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; background: #fff; }

    .chatbot-panel.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

@media (max-width:640px) {
    .chatbot-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}

/* Panel içinde iç widget mutlaka paneli tamamen doldursun */
.chatbot-panel > .enak-chatbot.chat-widget { width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--wa-bg); }

/* Panel dar ama viewport genişse (desktop), 45% yüzünden balonlar saçma daralmasın */
.chatbot-panel .enak-chatbot .bubble { max-width: 82%; }

.chat-close { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
    .chat-close:active { transform: translateY(1px); }

.chat-media-image { max-width: 180px; max-height: 180px; border-radius: 8px; display: block; }


/* Medya baloncukları */
.enak-chatbot .message.media-bubble .media-inner { position: relative; display: inline-block; }

/* Foto */
.enak-chatbot .chat-media-image { max-width: 180px; max-height: 180px; border-radius: 8px; display: block; }

/* Video */
.enak-chatbot .chat-media-video { position: relative; cursor: pointer; max-width: 200px; max-height: 200px; border-radius: 8px; display: block; background-color: #000000c6; object-fit: cover; }
    .enak-chatbot .chat-media-video::after { /* play butonu görünümü */ content: ""; position: absolute; width: 42px; height: 42px; left: 50%; top: 50%; margin-left: -21px; margin-top: -21px; border-radius: 50%; background: rgba(0,0,0,0.45); box-shadow: 0 2px 4px rgba(0,0,0,0.35); /* üçgen için borders vs. eklediysen onlar da kalacak */ pointer-events: none; }

/* Sol altta status yuvarlağı */
.enak-chatbot .media-status { position: absolute; left: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; background-color: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; }

/* Yükleniyor halinde: üç nokta */
.enak-chatbot .media-bubble.uploading .media-status-icon::before { content: "…"; }

/* Yüklendiğinde: check */
.enak-chatbot .media-bubble.uploaded .media-status-icon::before { content: "✓"; }

/* Lightbox genel */
.media-lightbox { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 99999; }

    .media-lightbox.open { display: flex; }

.media-lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.75); }

.media-lightbox-content { position: relative; z-index: 1; max-width: 96vw; max-height: 96vh; display: flex; align-items: center; justify-content: center; }

.lightbox-image,
.lightbox-video { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* Lightbox açıkken body scroll kilit */
body.lightbox-open { overflow: hidden; }

.enak-chatbot .chat-media-progress { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }

/* Play overlay (video baloncuğu) */
.enak-chatbot .media-inner .play-overlay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35); display: flex; align-items: center; justify-content: center; pointer-events: none; /* tıklama videoya geçsin */ }

    .enak-chatbot .media-inner .play-overlay::before { content: ""; display: block; width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 14px; border-color: transparent transparent transparent #fff; margin-left: 3px; }
.enak-chatbot .bubble-text .chat-link { display: inline-block; margin-top: 4px; color: #0b93f6; /* WhatsApp mavi tonu gibi */ font-weight: 600; text-decoration: none; }

    .enak-chatbot .bubble-text .chat-link:hover { text-decoration: underline; }
