/* LuxeBot — Tanıtım sayfası satış chatbot'u (sadece web / masaüstü) */

.luxebot-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 12px 14px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: #1a1205;
    background: linear-gradient(135deg, #f5d78e 0%, #d4af37 55%, #b8902b 100%);
    box-shadow: 0 10px 30px rgba(184, 144, 43, .45), 0 2px 6px rgba(0,0,0,.2);
    font: 600 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    transition: transform .18s ease, box-shadow .18s ease, opacity .2s ease;
}
.luxebot-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(184, 144, 43, .55); }
.luxebot-fab svg { width: 22px; height: 22px; flex: 0 0 auto; }
.luxebot-fab .luxebot-fab-dot {
    position: absolute; top: 8px; right: 10px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.25);
}
.luxebot-hidden { display: none !important; }

/* ── Sayfa modu (chatbot/page.php) ─────────────────────────────
   Sohbet ayrı, tam bir sayfada gösterilir. Overlay/klavye çakışması olmaz.
   Panel tüm ekranı kaplar; yükseklik JS ile visualViewport'a göre ayarlanır. */
.luxebot-page.luxebot-panel {
    position: fixed;
    inset: 0;
    right: 0;
    left: 0;
    top: 0;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    animation: none;
}

/* Panel */
.luxebot-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(20, 18, 14, .92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(212, 175, 55, .35);
    box-shadow: 0 24px 70px rgba(0,0,0,.5);
    color: #f4efe4;
    font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    animation: luxebot-in .22s ease;
    box-sizing: border-box;
}
/* Panelin tüm alt öğeleri kutu modelinde border-box olsun ki
   dolgu/kenarlıklar genişliği aşıp yatay taşmaya yol açmasın. */
.luxebot-panel * { box-sizing: border-box; }
@keyframes luxebot-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.luxebot-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(212,175,55,.22), rgba(212,175,55,.06));
    border-bottom: 1px solid rgba(212,175,55,.25);
    flex: 0 0 auto;   /* başlık asla küçülmesin/kaymasın */
}
.luxebot-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #f5d78e, #d4af37);
    color: #1a1205; flex: 0 0 auto;
}
.luxebot-avatar svg { width: 20px; height: 20px; }
.luxebot-title { font-weight: 700; font-size: 15px; }
.luxebot-sub { font-size: 11.5px; color: #16c07a; display: flex; align-items: center; gap: 5px; }
.luxebot-sub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #16c07a; }
.luxebot-close {
    margin-left: auto; background: transparent; border: none; cursor: pointer;
    color: #d8cba7; font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.luxebot-close:hover { background: rgba(255,255,255,.08); color: #fff; }

.luxebot-body {
    flex: 1 1 auto; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    scrollbar-width: thin; scrollbar-color: rgba(212,175,55,.4) transparent;
    /* KRİTİK: min-height:0 olmadan flex çocuğu içeriğe göre büyür ve
       footer'ı (yazma alanını) ekran dışına iter. Bu, iç kaydırmayı açar. */
    min-height: 0;
    overscroll-behavior: contain;
}
.luxebot-body::-webkit-scrollbar { width: 6px; }
.luxebot-body::-webkit-scrollbar-thumb { background: rgba(212,175,55,.4); border-radius: 3px; }

.luxebot-msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.luxebot-msg.bot { align-self: flex-start; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-bottom-left-radius: 4px; }
.luxebot-msg.user { align-self: flex-end; background: linear-gradient(135deg, #d4af37, #b8902b); color: #1a1205; border-bottom-right-radius: 4px; }

.luxebot-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; }
.luxebot-typing span { width: 7px; height: 7px; border-radius: 50%; background: #d4af37; opacity: .6; animation: luxebot-blink 1.2s infinite; }
.luxebot-typing span:nth-child(2) { animation-delay: .2s; }
.luxebot-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes luxebot-blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.luxebot-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 6px; flex: 0 0 auto; }
.luxebot-chip {
    font-size: 12px; padding: 6px 11px; border-radius: 999px; cursor: pointer;
    background: rgba(212,175,55,.12); border: 1px solid rgba(212,175,55,.35); color: #f0e6c8;
    transition: background .15s ease;
}
.luxebot-chip:hover { background: rgba(212,175,55,.25); }

.luxebot-foot { padding: 12px; border-top: 1px solid rgba(212,175,55,.2); flex: 0 0 auto; }
.luxebot-inputrow { display: flex; gap: 8px; align-items: flex-end; }
.luxebot-input {
    flex: 1 1 auto; min-width: 0;  /* min-width:0 olmadan textarea küçülmez, gönder butonunu dışarı iter */
    resize: none; max-height: 90px; min-height: 42px;
    padding: 10px 12px; border-radius: 12px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
    color: #f4efe4; font: inherit; outline: none;
    font-size: 16px;  /* iOS'ta odakta otomatik zoom'u (ve titreşimi) engeller */
}
.luxebot-input:focus { border-color: rgba(212,175,55,.6); }
.luxebot-input::placeholder { color: #a99f88; }
.luxebot-send {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; border: none; cursor: pointer;
    display: grid; place-items: center; color: #1a1205;
    background: linear-gradient(135deg, #f5d78e, #d4af37);
}
.luxebot-send:disabled { opacity: .5; cursor: not-allowed; }
.luxebot-send svg { width: 20px; height: 20px; }
.luxebot-note { text-align: center; font-size: 10.5px; color: #8f866f; margin-top: 8px; }

/* Mobil: kayan FAB butonu gizlenir — sohbet mobil menüdeki "Chatbot"
   bağlantısından (window.LuxeBot.open()) açılır. Panel ise modundan
   bağımsız olarak mobilde HER ZAMAN tam ekran gösterilir. */
@media (max-width: 640px) {
    .luxebot-fab { display: none !important; }

    /* Mobilde tam ekran sohbet. top:0/left:0/right:0 sabittir (body panel
       açıkken position:fixed ile kilitli olduğundan sayfa kayamaz); yükseklik
       yalnızca JS ile visualViewport.height'a göre ayarlanır (klavye alanı
       otomatik düşer). */
    .luxebot-panel {
        right: 0;
        left: 0;
        top: 0;
        bottom: auto;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;      /* dvh desteklemeyen eski tarayıcılar için yedek */
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        box-sizing: border-box;
        overflow: hidden;   /* iç taşmayı kes */
        overflow-x: hidden; /* yatayda kesinlikle taşma yok */
    }
    /* İç öğelerin yatayda taşmasını engelle */
    .luxebot-panel .luxebot-head,
    .luxebot-panel .luxebot-body,
    .luxebot-panel .luxebot-suggestions,
    .luxebot-panel .luxebot-foot,
    .luxebot-panel .luxebot-inputrow,
    .luxebot-panel .luxebot-input {
        box-sizing: border-box;
        max-width: 100%;
    }
}

/* Panel açıkken arka sayfanın kaymasını engelle (mobil tam ekran). */
html.luxebot-lock, html.luxebot-lock body {
    overflow: hidden !important;
    overscroll-behavior: none;
}
/* Alt güvenli alan (home indicator) için giriş satırına boşluk (mobil tam ekran). */
@media (max-width: 640px) {
    .luxebot-panel .luxebot-foot {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
}

/* Panel modunda kendi kayan FAB'ı hiçbir ekranda görünmez (buton dışarıdan tetiklenir). */
.luxebot-fab.luxebot-panelmode { display: none !important; }
