/* ===================================================================
   MİRA Destek Merkezi — Ticari Bulut
   style.css  (UTF-8)
   =================================================================== */

:root {
  /* Marka renkleri (Ticari Bulut logosundan) */
  --cyan: #00afe6;
  --cyan-600: #0096c7;
  --cyan-700: #0079a8;
  --navy: #316698;
  --navy-700: #274f78;

  /* Koyu kenar çubuğu */
  --ink: #0d1320;
  --ink-2: #131c2d;
  --ink-3: #1b2740;
  --line-dark: rgba(255, 255, 255, 0.08);
  --txt-on-dark: #eaf2f8;
  --txt-muted: #8b97aa;

  /* Aydınlık sohbet paneli */
  --panel: #ffffff;
  --chat-bg: #f7f9fc;
  --bubble-bot: #ffffff;
  --bubble-bot-border: #e7ecf3;
  --txt: #1d2733;
  --txt-soft: #5a6675;
  --line: #eef1f6;

  --green: #22c55e;
  --wa: #25d366;

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --shadow-soft: 0 10px 40px rgba(15, 30, 60, 0.08);
  --shadow-pop: 0 24px 60px rgba(8, 20, 45, 0.18);

  --font-disp: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  color: var(--txt);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ====================== UYGULAMA İSKELETİ ====================== */
.tb-app {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ============================ KENAR ÇUBUĞU ============================ */
.tb-side {
  position: relative;
  background:
    radial-gradient(900px 500px at -10% -10%, rgba(0, 175, 230, 0.18), transparent 60%),
    radial-gradient(700px 600px at 120% 120%, rgba(49, 102, 152, 0.22), transparent 55%),
    linear-gradient(160deg, var(--ink-2), var(--ink));
  color: var(--txt-on-dark);
  padding: 38px 40px 30px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tb-side::before,
.tb-side::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 175, 230, 0.10), rgba(0, 175, 230, 0) 70%);
  pointer-events: none;
}
.tb-side::before { width: 360px; height: 360px; top: -120px; right: -120px; }
.tb-side::after  { width: 460px; height: 460px; bottom: -180px; left: -160px; background: radial-gradient(circle at 40% 40%, rgba(49, 102, 152, 0.18), transparent 70%); }

/* Logo bloğu */
.tb-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}
.tb-brand img {
  height: 80px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 175, 230, 0.35));
}

/* Başlık alanı */
.tb-side-head {
  margin-top: 54px;
  position: relative;
  z-index: 2;
}
.tb-side-head h1 {
  font-family: var(--font-disp);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.5px;
}
.tb-side-head h1 .ac { color: var(--cyan); }
.tb-side-head p {
  color: var(--txt-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 16px 0 0;
  max-width: 340px;
}

/* MİRA robot görseli (kenar çubuğu) */
.tb-side-robot {
  position: relative;
  z-index: 2;
  margin: 26px 0 4px;
  display: flex;
  justify-content: flex-start;
}
.tb-side-robot .ring {
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(0, 175, 230, 0.22), rgba(0, 175, 230, 0) 68%);
}
.tb-side-robot .ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(0, 175, 230, 0.35);
  animation: tb-spin 26s linear infinite;
}
.tb-side-robot img {
  width: 150px;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}
@keyframes tb-spin { to { transform: rotate(360deg); } }

/* Alt bilgiler */
.tb-side-foot {
  margin-top: auto;
  position: relative;
  z-index: 2;
  padding-top: 24px;
}
.tb-label {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin: 0 0 12px;
  font-weight: 700;
}

.tb-contact { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.tb-contact-row { display: flex; align-items: center; gap: 12px; }
.tb-contact-ic {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--ink-3);
  border: 1px solid var(--line-dark);
  color: var(--cyan);
}
.tb-contact-ic svg { width: 18px; height: 18px; }
.tb-contact-row .meta { display: flex; flex-direction: column; line-height: 1.2; }
.tb-contact-row .meta small {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--txt-muted);
}
.tb-contact-row .meta span { font-size: 14px; color: var(--txt-on-dark); font-weight: 600; }

.tb-hours { display: flex; flex-direction: column; gap: 9px; margin-bottom: 26px; }
.tb-hours-row {
  display: flex; justify-content: space-between; font-size: 13.5px;
  color: var(--txt-muted); padding-bottom: 9px; border-bottom: 1px solid var(--line-dark);
}
.tb-hours-row:last-child { border-bottom: none; padding-bottom: 0; }
.tb-hours-row b { color: var(--txt-on-dark); font-weight: 600; }
.tb-hours-row .acc { color: var(--cyan); }

.tb-status {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.32);
  color: #8ef0b3;
  padding: 9px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; align-self: flex-start;
}
.tb-status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: tb-pulse 2s infinite;
}
@keyframes tb-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ============================ ANA PANEL ============================ */
.tb-main {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
}

/* Üst bar */
.tb-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.tb-bar-ava {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--chat-bg) center/cover no-repeat;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.tb-bar-id { display: flex; flex-direction: column; line-height: 1.25; }
.tb-bar-id strong { font-size: 15.5px; font-weight: 700; color: var(--txt); font-family: var(--font-disp); }
.tb-bar-id .on { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--green); font-weight: 600; }
.tb-bar-id .on .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.tb-bar-actions { margin-left: auto; display: flex; gap: 6px; }
.tb-bar-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid transparent;
  color: var(--txt-soft); font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; transition: .18s;
}
.tb-bar-btn:hover { background: var(--chat-bg); color: var(--cyan-700); }
.tb-bar-btn.on { background: rgba(0, 175, 230, 0.1); color: var(--cyan-600); border-color: rgba(0, 175, 230, 0.3); }
.tb-bar-btn svg { width: 15px; height: 15px; }

/* Mesaj alanı */
.tb-msgs {
  flex: 1; overflow-y: auto;
  padding: 26px clamp(16px, 5vw, 60px);
  background: var(--chat-bg);
  scroll-behavior: smooth;
}
.tb-msgs::-webkit-scrollbar { width: 10px; }
.tb-msgs::-webkit-scrollbar-thumb { background: #d7dee8; border-radius: 99px; border: 3px solid var(--chat-bg); }

.tb-track { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* Karşılama ekranı */
.tb-welcome {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 18px 0 6px; animation: tb-rise .5s ease both;
}
.tb-welcome img { height: 224px; width: auto; filter: drop-shadow(0 22px 28px rgba(20,40,70,.18)); }
.tb-welcome h2 { font-family: var(--font-disp); font-size: 23px; font-weight: 800; margin: 14px 0 6px; color: var(--txt); }
.tb-welcome p { color: var(--txt-soft); font-size: 14.5px; margin: 0; max-width: 460px; line-height: 1.6; }

.tb-faq { width: 100%; max-width: 640px; margin-top: 24px; text-align: left; }
.tb-faq-h { font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: #9aa6b4; font-weight: 700; margin: 0 0 12px; padding-left: 2px; }
.tb-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.tb-chip {
  border: 1px solid var(--line); background: #fff; color: var(--txt);
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  padding: 11px 15px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px; transition: .16s;
  box-shadow: 0 1px 2px rgba(20,40,70,.04);
}
.tb-chip:hover { border-color: var(--cyan); color: var(--cyan-700); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,175,230,.14); }
.tb-chip .ic { color: var(--cyan); display: inline-flex; }
.tb-chip .ic svg { width: 16px; height: 16px; }

/* Mesaj balonları */
.tb-row { display: flex; gap: 10px; align-items: flex-end; animation: tb-rise .32s ease both; }
.tb-row.me { justify-content: flex-end; }
.tb-row.bot .av {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: #fff center/cover no-repeat; border: 1px solid var(--line);
  align-self: flex-start; margin-top: 2px;
}
.tb-bubble {
  max-width: min(78%, 540px);
  padding: 12px 16px; border-radius: 16px; font-size: 14.5px; line-height: 1.6;
  word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
}
.tb-row.bot .tb-bubble {
  background: var(--bubble-bot); border: 1px solid var(--bubble-bot-border);
  color: var(--txt); border-bottom-left-radius: 6px;
}
.tb-row.me .tb-bubble {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-600));
  color: #fff; border-bottom-right-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,150,199,.28);
}
.tb-bubble a { color: var(--cyan-700); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(0,150,199,.3); }
.tb-bubble a:hover { border-bottom-color: var(--cyan-700); }
.tb-row.me .tb-bubble a { color: #fff; border-bottom-color: rgba(255,255,255,.6); }

/* Yazıyor göstergesi */
.tb-typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 18px; }
.tb-typing i { width: 8px; height: 8px; border-radius: 50%; background: #b9c4d2; display: inline-block; animation: tb-bounce 1.2s infinite; }
.tb-typing i:nth-child(2) { animation-delay: .18s; }
.tb-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes tb-bounce { 0%,60%,100%{ transform: translateY(0); opacity:.5;} 30%{ transform: translateY(-5px); opacity:1;} }

/* YouTube video kartı */
.tb-video {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px 10px 10px; cursor: pointer; transition: .16s; text-align: left;
  font-family: var(--font-body); width: 100%; max-width: 320px;
}
.tb-video:hover { border-color: #ff3b30; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(255,59,48,.16); }
.tb-video .play {
  width: 46px; height: 46px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, #ff4b3a, #e60023); color: #fff;
  display: grid; place-items: center;
}
.tb-video .play svg { width: 20px; height: 20px; margin-left: 2px; }
.tb-video .vt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.tb-video .vt strong { font-size: 13.5px; color: var(--txt); font-weight: 700; }
.tb-video .vt small { font-size: 12px; color: var(--txt-soft); }

/* WhatsApp butonu */
.tb-wa {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 10px;
  background: var(--wa); color: #fff !important; text-decoration: none;
  padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: 13.5px;
  transition: .16s; border: none; cursor: pointer;
}
.tb-wa:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(37,211,102,.3); }
.tb-wa svg { width: 18px; height: 18px; }

/* Uygulama içi rapor butonu */
.tb-rapor {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 10px;
  background: linear-gradient(135deg, #00afe6, #0096c7); color: #fff !important;
  text-decoration: none; padding: 11px 16px; border-radius: 12px;
  font-weight: 700; font-size: 13.5px; transition: .16s; border: none; cursor: pointer;
}
.tb-rapor:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,150,199,.3); }
.tb-rapor svg { width: 18px; height: 18px; }

/* Geri bildirim (beğen / beğenme) */
.tb-fb { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px 42px; }
.tb-fb-q { font-size: 12px; color: #9aa6b4; margin-right: 2px; }
.tb-fb-btn {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; display: grid; place-items: center; transition: .15s; color: #8895a6;
}
.tb-fb-btn svg { width: 15px; height: 15px; }
.tb-fb-btn:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.tb-fb-btn.up.on { background: #e9f9ef; border-color: #34d77e; color: #16a34a; }
.tb-fb-btn.down.on { background: #fdeceb; border-color: #f4a8a3; color: #dc2626; }
.tb-fb-btn.locked { pointer-events: none; opacity: .55; }
.tb-fb-thx { font-size: 12px; color: #16a34a; font-weight: 600; animation: tb-rise .3s ease both; }

/* Giriş çubuğu */
.tb-input-wrap { padding: 14px clamp(12px, 4vw, 40px) 18px; background: #fff; border-top: 1px solid var(--line); }
.tb-input { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.tb-attach {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--line); background: var(--chat-bg); color: #8895a6;
  cursor: pointer; display: grid; place-items: center; transition: .16s;
}
.tb-attach:hover { color: var(--cyan); border-color: var(--cyan); }
.tb-attach svg { width: 19px; height: 19px; }
.tb-field {
  flex: 1; display: flex; align-items: center;
  border: 1px solid #dde4ec; border-radius: 26px; background: #fff;
  padding: 4px 6px 4px 20px; transition: .16s;
}
.tb-field:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(0,175,230,.12); }
.tb-field input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 14.5px; color: var(--txt); padding: 12px 6px;
}
.tb-field input::placeholder { color: #9aa6b4; }
.tb-send {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; border: none;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-600)); color: #fff;
  cursor: pointer; display: grid; place-items: center; transition: .16s;
  box-shadow: 0 6px 16px rgba(0,150,199,.32);
}
.tb-send:hover:not(:disabled) { transform: scale(1.06); }
.tb-send:disabled { opacity: .45; cursor: default; box-shadow: none; }
.tb-send svg { width: 19px; height: 19px; margin-left: 2px; }

.tb-foot-note { max-width: 760px; margin: 10px auto 0; text-align: center; font-size: 11.5px; color: #aab4c0; }
.tb-foot-note b { color: var(--cyan-700); font-weight: 700; }

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

/* ============================ MOBİL ============================ */
.tb-side-toggle { display: none; }
/* Backdrop masaüstünde akıştan çıkar (grid hücresi işgal etmesin) */
.tb-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(5,10,20,.5);
  z-index: 55; opacity: 0; transition: opacity .3s; pointer-events: none;
}

@media (max-width: 900px) {
  .tb-app { grid-template-columns: 1fr; }
  .tb-side {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    transform: translateX(-100%); transition: transform .3s ease;
    width: min(86vw, 420px);
  }
  .tb-side.open { transform: translateX(0); box-shadow: 30px 0 80px rgba(0,0,0,.4); }
  .tb-backdrop.show { display: block; opacity: 1; pointer-events: auto; }

  .tb-main { height: 100vh; height: 100dvh; }
  .tb-side-toggle {
    display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 10px; border: 1px solid var(--line); background: var(--chat-bg);
    color: var(--txt-soft); cursor: pointer; flex-shrink: 0;
  }
  .tb-side-toggle svg { width: 19px; height: 19px; }
  .tb-bar-btn span { display: none; }
  .tb-bar { padding: 12px 14px; gap: 10px; }
  .tb-welcome img { height: 168px; }
  .tb-welcome h2 { font-size: 20px; }
}

@media (max-width: 420px) {
  .tb-bubble { max-width: 84%; }
  .tb-fb { margin-left: 42px; }
}
