/* www.trendbt.com — sohbet asistanı (assets/site/chat.js). Sitenin renkleriyle uyumlu, kendi değişkenleri vardır. */

.tbc {
    --tbc-navy: #0a1222;
    --tbc-ink: #0f1a2e;
    --tbc-muted: #5b6577;
    --tbc-line: #e3e8f0;
    --tbc-soft: #f4f7fb;
    --tbc-blue: #2c5fc4;
    --tbc-green: #8cc746;
    position: fixed; right: 20px; bottom: 20px; z-index: 150;
    font-family: "Urbanist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px; line-height: 1.45; color: var(--tbc-ink);
}
.tbc *, .tbc *::before, .tbc *::after { box-sizing: border-box; }
.tbc [hidden] { display: none !important; }
.tbc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tbc-launch {
    position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #8cc746 0%, #5c85ca 100%);
    box-shadow: 0 12px 28px -10px rgba(10, 18, 34, .55), 0 2px 6px rgba(10, 18, 34, .2);
    transition: transform .2s ease;
    margin-left: auto;
}
.tbc-launch:hover { transform: translateY(-2px); }
.tbc-launch > span { grid-area: 1 / 1; display: grid; place-items: center; transition: opacity .15s, transform .2s; }
.tbc-ic-close { opacity: 0; transform: rotate(-45deg); }
.tbc.is-open .tbc-ic-open { opacity: 0; transform: rotate(45deg); }
.tbc.is-open .tbc-ic-close { opacity: 1; transform: none; }
.tbc-badge {
    position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; border: 2px solid #fff;
}

.tbc-teaser {
    position: absolute; right: 0; bottom: 74px; width: 280px; background: #fff; border: 1px solid var(--tbc-line);
    border-radius: 16px 16px 4px 16px; padding: 12px 34px 12px 14px; cursor: pointer;
    box-shadow: 0 20px 40px -20px rgba(10, 18, 34, .45); animation: tbc-in .2s ease-out;
}
.tbc-teaser p { margin: 0; font-size: 14px; color: var(--tbc-ink); }
.tbc-teaser p b { display: block; font-size: 12px; color: var(--tbc-muted); margin-bottom: 2px; }
.tbc-teaser-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; background: none; color: var(--tbc-muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.tbc-teaser-x svg { width: 16px; height: 16px; }

.tbc-panel {
    position: absolute; right: 0; bottom: 76px; width: 380px; height: min(600px, calc(100vh - 120px));
    display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden;
    box-shadow: 0 30px 60px -24px rgba(10, 18, 34, .5), 0 0 0 1px rgba(10, 18, 34, .06);
    animation: tbc-in .2s ease-out;
}
@keyframes tbc-in { from { opacity: 0; transform: translateY(12px); } }

.tbc-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; background: var(--tbc-navy); color: #fff; flex: none; }
.tbc-head svg { flex: none; border-radius: 10px; }
.tbc-who { flex: 1; min-width: 0; }
.tbc-who b { display: block; font-size: 16px; }
.tbc-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #b8c1d3; }
.tbc-status i { width: 8px; height: 8px; border-radius: 50%; background: #8b95a9; flex: none; }
.tbc-status.on i { background: #6fd08a; box-shadow: 0 0 0 3px rgba(111, 208, 138, .25); }
.tbc-status em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbc-x { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: #c8d1e3; cursor: pointer; display: grid; place-items: center; flex: none; }
.tbc-x:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.tbc-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--tbc-soft); padding: 16px 14px; }
.tbc-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tbc-m { max-width: 85%; }
.tbc-label { display: block; font-size: 11.5px; font-weight: 700; color: var(--tbc-muted); margin: 0 0 3px 4px; }
.tbc-text { padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tbc-text a { color: inherit; text-decoration: underline; }
.tbc-text small { opacity: .85; }
.tbc-in { align-self: flex-start; }
.tbc-in .tbc-text { background: #fff; border: 1px solid var(--tbc-line); border-bottom-left-radius: 5px; }
.tbc-bot .tbc-text { background: #eef3fb; border-color: #dfe7f5; }
.tbc-out { align-self: flex-end; }
.tbc-out .tbc-text { background: var(--tbc-blue); color: #fff; border-bottom-right-radius: 5px; }

.tbc-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.tbc-quick button {
    border: 1px solid #c9d6ee; background: #fff; color: var(--tbc-blue); border-radius: 999px; padding: 7px 13px;
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tbc-quick button:hover { background: #eef3fb; }
.tbc-notice { align-self: center; font-size: 13px; color: #b92f2f; background: #fbe7e7; border-radius: 10px; padding: 8px 12px; text-align: center; }

.tbc-formwrap { max-width: 92%; }
.tbc-form { display: grid; gap: 8px; background: #fff; border: 1px solid var(--tbc-line); border-radius: 16px; border-bottom-left-radius: 5px; padding: 14px; }
.tbc-form b { font-size: 15px; }
.tbc-form input {
    width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--tbc-line); border-radius: 10px; background: var(--tbc-soft);
    font: inherit; font-size: 16px; color: var(--tbc-ink);
}
.tbc-form input:focus { outline: none; border-color: var(--tbc-blue); box-shadow: 0 0 0 3px rgba(44, 95, 196, .15); }
.tbc-form button {
    height: 42px; border: 0; border-radius: 10px; background: var(--tbc-navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.tbc-form button:disabled { opacity: .6; }
.tbc-form small { color: var(--tbc-muted); font-size: 12px; }
.tbc-err { margin: 0; color: #b92f2f; font-size: 13px; min-height: 0; }
.tbc-err:empty { display: none; }

.tbc-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--tbc-line); background: #fff; flex: none; }
.tbc-compose textarea {
    flex: 1; min-width: 0; height: 44px; max-height: 120px; resize: none; padding: 11px 14px; border-radius: 22px;
    border: 1px solid var(--tbc-line); background: var(--tbc-soft); font: inherit; font-size: 16px; color: var(--tbc-ink); line-height: 1.35;
    scrollbar-width: none;
}
.tbc-compose textarea::-webkit-scrollbar { display: none; }
.tbc-compose textarea:focus { outline: none; border-color: var(--tbc-blue); }
.tbc-send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--tbc-blue); color: #fff; cursor: pointer; display: grid; place-items: center; }
.tbc-send:hover { background: #234fa6; }
.tbc :focus-visible { outline: 3px solid #86aef0; outline-offset: 2px; }

/* Sohbet yalnız Türkçe/İngilizce yürür; Arapça sayfada da soldan sağa kalır. Yazılan metnin yönü içeriğe göre belirlenir. */
[dir="rtl"] .tbc { direction: ltr; }
.tbc-text, .tbc-compose textarea, .tbc-form input { unicode-bidi: plaintext; }

/* Geniş ekranda pencere büyür: daha çok mesaj kaydırmadan görünür. */
@media (min-width: 1024px) {
    .tbc-panel { width: 440px; height: min(720px, calc(100vh - 120px)); }
    .tbc-body { padding: 18px 18px; }
    .tbc-m { max-width: 80%; }
}
@media (min-width: 1440px) {
    .tbc-panel { width: 480px; height: min(800px, calc(100vh - 120px)); }
}

/* Telefonda pencere tam ekran açılır; boşluklar daraltılır ki kaydırma az olsun. */
@media (max-width: 520px) {
    .tbc { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .tbc-panel {
        position: fixed; inset: 0; width: auto; height: auto; border-radius: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .tbc-head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
    .tbc.is-open .tbc-launch { display: none; }
    .tbc-teaser { width: calc(100vw - 32px); }
    .tbc-head { padding-bottom: 10px; padding-left: 14px; }
    .tbc-head svg { width: 34px; height: 34px; }
    .tbc-body { padding: 12px 10px; }
    .tbc-msgs { gap: 6px; }
    .tbc-m { max-width: 90%; }
    .tbc-text { padding: 8px 11px; font-size: 14.5px; }
    .tbc-quick { gap: 6px; }
    .tbc-quick button { padding: 6px 11px; font-size: 13.5px; }
    .tbc-form { gap: 6px; padding: 12px; }
    .tbc-form input, .tbc-form button { height: 40px; }
    .tbc-compose { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .tbc-panel, .tbc-teaser { animation: none; }
    .tbc-launch, .tbc-launch > span { transition: none; }
}
