/* ==========================================================================
   WEBSAHİBİ CANLI YARDIM ASİSTANI (CANSU) — HostTR Birebir Tasarım Mimarisi
   Renkler: Deep Corporate Navy (#0b1930), Websahibi Royal Blue (#1453b8), Açık Slate (#f4f7fc)
   ========================================================================== */

.ws-aic-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px 10px 13px;
  background: #0b1930;
  color: #ffffff;
  border: 1.5px solid #1e3a63;
  border-bottom: 3px solid #2563eb;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(7, 23, 48, 0.34);
  cursor: pointer;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.ws-aic-launcher:hover {
  transform: translateY(-2px);
  background: #102446;
  box-shadow: 0 18px 40px rgba(7, 23, 48, 0.44);
}

.ws-aic-launcher.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);
}

.ws-aic-launcher-ico {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1453b8;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  animation: wsAicIconPulse 10s ease-in-out -5s infinite;
}

.ws-aic-launcher:hover .ws-aic-launcher-ico {
  transform: scale(1.07);
}

.ws-aic-bubbles-svg {
  display: block;
  width: 24px;
  height: 24px;
  overflow: visible;
  transform-origin: center center;
  animation: wsAicOrbitWrap 20s linear -5s infinite;
}

.ws-aic-bubbles-svg .ws-aic-b1,
.ws-aic-bubbles-svg .ws-aic-b2 {
  fill: #ffffff;
  stroke: #1453b8;
  stroke-width: 1.55;
  paint-order: stroke fill;
  transform-box: fill-box;
  transform-origin: center;
}

.ws-aic-bubbles-svg .ws-aic-b1 {
  animation: wsAicBubbleCounter1 20s linear -5s infinite;
}

.ws-aic-bubbles-svg .ws-aic-b2 {
  animation: wsAicBubbleCounter2 20s linear -5s infinite;
}

/* Her 10 saniyede bir iki beyaz baloncuk dairenin içinde 180° dönüp yer değiştirir */
@keyframes wsAicIconPulse {
  0%, 64% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
  82% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.32); }
  100% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
}

@keyframes wsAicOrbitWrap {
  0%, 32% { transform: rotate(0deg); animation-timing-function: ease-in; }
  41% { transform: rotate(90deg); animation-timing-function: ease-out; }
  50%, 82% { transform: rotate(180deg); animation-timing-function: ease-in; }
  91% { transform: rotate(270deg); animation-timing-function: ease-out; }
  100% { transform: rotate(360deg); }
}

@keyframes wsAicBubbleCounter1 {
  0%, 32% { transform: translate(0px, 0px) rotate(0deg) scale(1); animation-timing-function: ease-in; }
  41% { transform: translate(-2.4px, -1.7px) rotate(-90deg) scale(1.06); animation-timing-function: ease-out; }
  50%, 82% { transform: translate(0px, 0px) rotate(-180deg) scale(1); animation-timing-function: ease-in; }
  91% { transform: translate(-2.4px, -1.7px) rotate(-270deg) scale(0.94); animation-timing-function: ease-out; }
  100% { transform: translate(0px, 0px) rotate(-360deg) scale(1); }
}

@keyframes wsAicBubbleCounter2 {
  0%, 32% { transform: translate(0px, 0px) rotate(0deg) scale(1); animation-timing-function: ease-in; }
  41% { transform: translate(2.4px, 1.7px) rotate(-90deg) scale(0.94); animation-timing-function: ease-out; }
  50%, 82% { transform: translate(0px, 0px) rotate(-180deg) scale(1); animation-timing-function: ease-in; }
  91% { transform: translate(2.4px, 1.7px) rotate(-270deg) scale(1.06); animation-timing-function: ease-out; }
  100% { transform: translate(0px, 0px) rotate(-360deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ws-aic-launcher-ico,
  .ws-aic-launcher-dot,
  .ws-aic-bubbles-svg,
  .ws-aic-bubbles-svg .ws-aic-b1,
  .ws-aic-bubbles-svg .ws-aic-b2 {
    animation: none !important;
  }
}

.ws-aic-launcher-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #0b1930;
  will-change: transform, opacity, box-shadow;
  animation: wsAicDotHeartbeat 1.8s ease-in-out infinite;
}

@keyframes wsAicDotHeartbeat {
  0%, 62%, 100% {
    background-color: #dc2626;
    opacity: 0.48;
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
  16% {
    background-color: #ff4d4f;
    opacity: 1;
    transform: scale(1.18);
    box-shadow: 0 0 9px 2.5px rgba(255, 59, 48, 0.9);
  }
  28% {
    background-color: #ef4444;
    opacity: 0.68;
    transform: scale(0.96);
    box-shadow: 0 0 2px 0 rgba(239, 68, 68, 0.3);
  }
  40% {
    background-color: #ff4d4f;
    opacity: 0.98;
    transform: scale(1.12);
    box-shadow: 0 0 8px 2px rgba(255, 59, 48, 0.78);
  }
}

.ws-aic-launcher-txt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.18;
  text-align: left;
}

.ws-aic-launcher-txt strong {
  font-family: 'Archivo', 'IBM Plex Sans', sans-serif;
  font-size: 13.75px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.ws-aic-launcher-txt small {
  font-size: 11px;
  font-weight: 600;
  color: #93c5fd;
}

.ws-aic-launcher.is-member .ws-aic-launcher-txt small {
  color: #86efac;
}

.ws-aic-launcher-note {
  font-size: 10.25px;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.2;
  margin-top: 1px;
}

/* Ana Sohbet Penceresi (HostTR 408x615 Birebir Oran) */
.ws-aic-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9995;
  width: 408px;
  max-width: calc(100vw - 28px);
  height: 615px;
  max-height: calc(100vh - 36px);
  background: #f4f7fc;
  border: 1.5px solid #1e3a63;
  border-top: 4px solid #1453b8;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(7, 23, 48, 0.36);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ws-aic-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Üstbilgi (Deep Corporate Navy) */
.ws-aic-header {
  background: #0b1930;
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.ws-aic-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.ws-aic-avatar {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #1453b8;
  color: #ffffff;
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ws-aic-head-info {
  min-width: 0;
}

.ws-aic-head-title {
  margin: 0;
  font-family: 'Archivo', sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff !important;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-aic-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
}

.ws-aic-mode-pill.is-member {
  color: #86efac;
}

.ws-aic-mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.ws-aic-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ws-aic-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  border: 1px solid #26426d;
  background: #13284a;
  color: #dbeafe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ws-aic-icon-btn:hover {
  background: #1453b8;
  border-color: #2563eb;
  color: #ffffff;
}

/* Mesaj Akışı */
.ws-aic-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.ws-aic-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}

.ws-aic-msg.is-user {
  align-self: flex-end;
  align-items: flex-end;
}

.ws-aic-msg.is-bot {
  align-self: flex-start;
  align-items: flex-start;
}

.ws-aic-bubble {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.56;
  word-break: break-word;
}

.ws-aic-msg.is-user .ws-aic-bubble {
  background: #0b1930;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.ws-aic-msg.is-bot .ws-aic-bubble {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #d9e2ef;
  border-left: 3px solid #1453b8;
  border-bottom-left-radius: 2px;
  box-shadow: 0 2px 6px rgba(11, 25, 48, 0.05);
}

.ws-aic-bubble p {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.56;
}

.ws-aic-bubble p:last-child {
  margin-bottom: 0;
}

.ws-aic-bubble ul,
.ws-aic-bubble ol {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.ws-aic-bubble li {
  margin-bottom: 4px;
}

.ws-aic-bubble code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  background: #eef4fc;
  color: #1453b8;
  padding: 1px 5px;
  border-radius: 4px;
}

.ws-aic-bubble a,
.ws-aic-bubble a.ws-aic-inline-link {
  display: inline-block;
  color: #1453b8;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ws-aic-bubble a.ws-aic-inline-link:hover {
  color: #0e3d8a;
}

.ws-aic-bubble h4 {
  margin: 8px 0 5px;
  font-family: 'Archivo', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  color: #0b1930;
}

.ws-aic-bubble h4:first-child {
  margin-top: 0;
}

.ws-aic-tbl-wrap {
  overflow-x: auto;
  margin: 6px 0 8px;
}

.ws-aic-tbl-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ws-aic-tbl-wrap th,
.ws-aic-tbl-wrap td {
  border: 1px solid #d9e2ef;
  padding: 5px 7px;
  text-align: left;
}

.ws-aic-tbl-wrap th {
  background: #f1f5fb;
  font-weight: 800;
  color: #0b1930;
}

/* Hızlı Başlangıç Çipleri */
.ws-aic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.ws-aic-chip {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.ws-aic-chip:hover {
  border-color: #1453b8;
  color: #1453b8;
  background: #f0f6ff;
}

/* Zengin Eylem Kartları (Paket, Domain, Ticket, Giriş) */
.ws-aic-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.ws-aic-card {
  background: #ffffff;
  border: 1px solid #d9e2ef;
  border-radius: 7px;
  padding: 11px 12px;
  box-shadow: 0 3px 10px rgba(11, 25, 48, 0.05);
}

.ws-aic-card.is-ticket {
  border-left: 4px solid #16a34a;
  background: #f0fdf4;
}

.ws-aic-card.is-login {
  border-left: 4px solid #1453b8;
}

.ws-aic-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ws-aic-card-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #0b1930;
  color: #ffffff;
}

.ws-aic-card.is-ticket .ws-aic-card-badge,
.ws-aic-card-badge.is-ok {
  background: #15803d;
}

.ws-aic-card-price {
  font-family: 'Archivo', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  color: #1453b8;
}

.ws-aic-card-title {
  font-family: 'Archivo', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  color: #0b1930;
  margin-bottom: 3px;
}

.ws-aic-card-sub {
  font-size: 12px;
  color: #475569;
  line-height: 1.42;
  margin-bottom: 8px;
}

.ws-aic-card-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ws-aic-cbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  border: 1px solid transparent;
}

.ws-aic-cbtn-primary {
  background: #1453b8;
  color: #ffffff !important;
}

.ws-aic-cbtn-primary:hover {
  background: #0f4296;
}

.ws-aic-cbtn-green {
  background: #15803d;
  color: #ffffff !important;
}

.ws-aic-cbtn-green:hover {
  background: #166534;
}

.ws-aic-cbtn-outline {
  background: #f8fafc;
  color: #0f172a !important;
  border-color: #cbd5e1;
}

.ws-aic-cbtn-outline:hover {
  border-color: #0b1930;
}

/* Websahibi Smart Shield Doğrulama Kartı */
.ws-aic-shield-box {
  background: #ffffff;
  border: 1.5px solid #0b1930;
  border-radius: 7px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.ws-aic-shield-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #f4f7fc;
  border: 1.5px solid #1e3a63;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0b1930;
  cursor: pointer;
}

.ws-aic-shield-btn:hover {
  border-color: #1453b8;
}

.ws-aic-shield-check {
  width: 18px;
  height: 18px;
  border: 2px solid #475569;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

/* Yazıyor Animasyonu */
.ws-aic-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  font-size: 12.5px;
  color: #475569;
}

.ws-aic-dots {
  display: inline-flex;
  gap: 3px;
}

.ws-aic-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1453b8;
  animation: wsAicBounce 1.2s infinite ease-in-out;
}

.ws-aic-dots span:nth-child(2) { animation-delay: 0.16s; }
.ws-aic-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes wsAicBounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* Alt Mesaj Yazma Çubuğu */
.ws-aic-footer {
  background: #ffffff;
  border-top: 1px solid #d9e2ef;
  padding: 10px 12px 9px;
  flex-shrink: 0;
}

.ws-aic-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

body.ws-body .ws-aic-input,
.ws-aic-input {
  flex: 1;
  resize: none;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 108px;
  overflow-y: hidden;
  padding: 9px 12px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-family: inherit;
  font-size: 13px !important;
  line-height: 1.45;
  color: #0f172a !important;
  background: #f8fafc !important;
  outline: none;
  box-sizing: border-box;
  margin: 0 !important;
}

body.ws-body .ws-aic-input:focus,
.ws-aic-input:focus {
  border-color: #1453b8 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(20, 83, 184, 0.12);
}

.ws-aic-send {
  height: 40px;
  padding: 0 15px;
  border: none;
  border-radius: 6px;
  background: #1453b8;
  color: #ffffff;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.ws-aic-send:hover {
  background: #0f4296;
}

.ws-aic-send:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.ws-aic-subbar {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  gap: 8px;
}

.ws-aic-subbar a {
  color: #1453b8;
  font-weight: 700;
  text-decoration: none;
}

.ws-aic-subbar a:hover {
  text-decoration: underline;
}

/* Gerçek zamanlı SSE akış imleci */
.ws-aic-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  margin-left: 3px;
  vertical-align: -2px;
  background: #1453b8;
  border-radius: 1px;
  animation: wsAicBlink 0.75s steps(2, start) infinite;
}

@keyframes wsAicBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (max-width: 540px) {
  .ws-aic-launcher {
    right: 14px;
    bottom: 14px;
    padding: 10px 15px 10px 12px;
  }
  .ws-aic-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 12px 12px 0 0;
  }
}
