/* ============================================================================
   BERABER GEZELİM — DENİZLİ VİZON & KREM CONCIERGE (AI GEZİ ASİSTANI)
   Sıcak Krem (#f8f3eb), Vizon (#e4d5c0), Karahayıt Bakır (#b0562c), Mineral (#146673)
   ============================================================================ */

/* Eski <img> tetikleyiciyi gizle; yerine yuvarlatılmış mimari kapsül buton gelir */
img#chatbot-trigger.gr-ai-legacy-hidden {
  display: none !important;
}

/* 1. Yüzen Concierge Tetikleyici (Kapsül — koyu hero ve kırık beyaz üzerinde yüksek kontrast) */
.gr-ai-trigger {
  position: fixed;
  right: 26px;
  bottom: 24px;
  z-index: 6600;
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  height: 48px;
  padding: 0 1.15rem 0 0.92rem;
  background: rgba(28, 23, 19, 0.94);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  border: 1px solid rgba(218, 174, 134, 0.48);
  border-radius: 999px;
  color: #faf5ed;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 14px 34px rgba(24, 18, 14, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.35s ease;
}

.gr-ai-trigger:hover {
  transform: translateY(-2px);
  border-color: rgba(233, 163, 123, 0.85);
  background: rgba(38, 31, 26, 0.97);
  box-shadow:
    0 18px 42px rgba(24, 18, 14, 0.44),
    0 0 0 1px rgba(218, 174, 134, 0.22);
}

.gr-ai-trigger.is-open {
  border-color: #b0562c;
  background: #b0562c;
  color: #fffdf9;
  box-shadow: 0 14px 34px rgba(176, 86, 44, 0.38);
}

.gr-ai-trigger.is-open .gr-ai-trigger-dot {
  background: #fffdf9;
  box-shadow: 0 0 0 4px rgba(255, 253, 249, 0.2);
}

.gr-ai-trigger.is-open .gr-ai-trigger-badge {
  background: rgba(255, 253, 249, 0.18);
  border-color: rgba(255, 253, 249, 0.36);
  color: #fffdf9;
}

.gr-ai-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.gr-ai-trigger-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.gr-ai-trigger-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6cc2cf;
  box-shadow: 0 0 0 4px rgba(108, 194, 207, 0.22);
  animation: grAiPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

.gr-ai-trigger-badge {
  padding: 0.18rem 0.48rem;
  background: rgba(218, 162, 122, 0.16);
  border: 1px solid rgba(218, 162, 122, 0.42);
  border-radius: 999px;
  color: #f0be97;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

@keyframes grAiPulse {
  0%, 100% {
    opacity: 0.9;
    box-shadow: 0 0 0 3px rgba(108, 194, 207, 0.2);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 6px rgba(108, 194, 207, 0.06);
  }
}

/* 2. Ana Vizon & Krem Concierge Paneli */
#chatbot-popup {
  position: fixed;
  right: 26px;
  bottom: 84px;
  width: min(424px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 116px));
  max-height: 660px;
  z-index: 6900;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8f3eb 0%, #f1e8da 100%);
  border: 1px solid rgba(132, 111, 90, 0.32);
  box-shadow:
    0 28px 72px rgba(24, 18, 14, 0.28),
    0 6px 20px rgba(24, 18, 14, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #241e1a;
  transform-origin: bottom right;
}

#chatbot-popup.is-open {
  display: flex;
  animation: grPanelIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#chatbot-popup::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, rgba(176, 86, 44, 0.42) 50%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

@keyframes grPanelIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 3. Başlık Bandı (Sıcak Vizon) */
.chatbot-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.15rem;
  background: linear-gradient(180deg, #ece1d1 0%, #e4d6c3 100%);
  border-bottom: 1px solid rgba(118, 97, 78, 0.2);
}

.gr-ai-header-brand {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.gr-ai-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #964a24;
}

.gr-ai-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #146673;
  flex-shrink: 0;
}

.chatbot-header h3 {
  margin: 0;
  font-family: "Unbounded", "Inter", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: #1d1713;
  line-height: 1.25;
}

.gr-ai-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  flex-shrink: 0;
}

.gr-ai-icon-btn,
#close-chatbot {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid rgba(128, 106, 84, 0.26);
  border-radius: 10px;
  color: #4a3d32;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.gr-ai-icon-btn svg,
#close-chatbot svg {
  width: 14px;
  height: 14px;
  display: block;
}

.gr-ai-icon-btn:hover,
#close-chatbot:hover {
  border-color: #b0562c;
  background: #fffdf9;
  color: #964a24;
}

/* 4. Hızlı Soru Önerileri Şeridi (Wrap — tüm 4 çip kırpılmadan tam görünür) */
.gr-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  padding: 0.65rem 1.05rem;
  background: #f0e7d9;
  border-bottom: 1px solid rgba(118, 97, 78, 0.14);
}

.gr-ai-chip {
  flex: 0 0 auto;
  padding: 0.36rem 0.74rem;
  background: #fffdf9;
  border: 1px solid rgba(132, 111, 90, 0.28);
  border-radius: 999px;
  color: #3a3027;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease, transform 0.2s ease;
}

.gr-ai-chip:hover {
  border-color: #b0562c;
  background: #b0562c;
  color: #fffdf9;
  transform: translateY(-1px);
}

/* 5. Mesaj Akışı (Açık Krem Zemin) */
#chatbox {
  flex: 1;
  padding: 1.05rem 1.05rem 0.95rem;
  overflow-y: auto;
  background: linear-gradient(180deg, #f8f3eb 0%, #f3ece0 100%);
  display: flex;
  flex-direction: column;
  gap: 0.88rem;
  color: #241e1a;
  scrollbar-width: thin;
  scrollbar-color: rgba(132, 111, 90, 0.36) transparent;
}

#chatbox::-webkit-scrollbar {
  width: 5px;
}

#chatbox::-webkit-scrollbar-track {
  background: transparent;
}

#chatbox::-webkit-scrollbar-thumb {
  background: rgba(132, 111, 90, 0.36);
  border-radius: 999px;
}

.message {
  position: relative;
  max-width: 89%;
  padding: 0.85rem 1rem;
  font-size: 0.865rem;
  line-height: 1.65;
  word-break: break-word;
  animation: grMsgIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes grMsgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message::before {
  display: block;
  margin-bottom: 0.35rem;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.bot-message {
  margin-right: auto;
  background: #fffdf9;
  border: 1px solid rgba(132, 111, 90, 0.22);
  border-left: 3px solid #b0562c;
  border-radius: 4px 16px 16px 16px;
  color: #241e1a;
  box-shadow: 0 4px 14px rgba(48, 36, 24, 0.055);
}

.bot-message::before {
  content: "ASİSTAN · DENİZLİ AI";
  color: #964a24;
  opacity: 0.9;
}

.bot-message strong {
  color: #14100d;
  font-weight: 700;
}

.bot-message em {
  color: #8f4420;
  font-style: italic;
}

.user-message {
  margin-left: auto;
  background: #e4d5c0;
  border: 1px solid rgba(128, 106, 84, 0.3);
  border-radius: 16px 4px 16px 16px;
  color: #1d1713;
  box-shadow: 0 2px 10px rgba(48, 36, 24, 0.05);
}

.user-message::before {
  content: "SEN";
  text-align: right;
  color: #6d523a;
  opacity: 0.92;
}

/* Chatbot içi şık tıklanabilir rota çipleri */
#chatbox a.qa-link {
  display: inline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  margin: 0 0.1rem;
  padding: 0.14rem 0.52rem;
  background: rgba(176, 86, 44, 0.1);
  border: 1px solid rgba(176, 86, 44, 0.32);
  border-radius: 7px;
  color: #8a3e1a !important;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-decoration: none !important;
  line-height: 1.85;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#chatbox a.qa-link:hover {
  background: #b0562c;
  border-color: #b0562c;
  color: #fffdf9 !important;
}

/* Chatbot içi "Rotam'a Ekle" & Paylaşım Çubuğu */
.gr-ai-route-actions {
  margin-top: 0.78rem;
  padding-top: 0.68rem;
  border-top: 1px dashed rgba(132, 111, 90, 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.gr-ai-route-actions-head {
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #146673;
}

.gr-ai-route-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.gr-ai-trip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.44rem 0.72rem;
  border-radius: 9px;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.gr-ai-trip-btn.is-primary {
  background: #b0562c;
  border: 1px solid #b0562c;
  color: #fffdf9;
}

.gr-ai-trip-btn.is-primary:hover {
  background: #944420;
  border-color: #944420;
  transform: translateY(-1px);
}

.gr-ai-trip-btn.is-secondary {
  background: #f4ece0;
  border: 1px solid rgba(128, 106, 84, 0.32);
  color: #2d241d;
}

.gr-ai-trip-btn.is-secondary:hover {
  background: #ebe0cf;
  border-color: #b0562c;
  color: #8a3e1a;
}

.gr-ai-trip-btn.is-done {
  background: rgba(20, 102, 115, 0.12) !important;
  border-color: #146673 !important;
  color: #115661 !important;
}

/* 6. Yazıyor / Rota Hazırlanıyor Göstergesi */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin-right: auto;
  padding: 0.65rem 0.92rem;
  background: #fffdf9;
  border: 1px solid rgba(132, 111, 90, 0.22);
  border-left: 3px solid #b0562c;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 4px 12px rgba(48, 36, 24, 0.05);
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b0562c;
  display: inline-block;
  opacity: 0.35;
}

.typing-indicator span:nth-child(1) {
  animation: grTypingPulse 1.15s infinite 0s;
}

.typing-indicator span:nth-child(2) {
  animation: grTypingPulse 1.15s infinite 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation: grTypingPulse 1.15s infinite 0.4s;
}

.typing-indicator::after {
  content: "ROTA HAZIRLANIYOR";
  margin-left: 0.25rem;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: #8f4420;
}

@keyframes grTypingPulse {
  0%, 100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Aktif GPS Konum Şeridi (Chatbot içi) */
.gr-ai-loc-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: rgba(20, 102, 115, 0.09);
  border-top: 1px solid rgba(20, 102, 115, 0.22);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #125c68;
}

.gr-ai-loc-bar.is-visible {
  display: flex;
}

.gr-ai-loc-clear {
  background: transparent;
  border: 0;
  color: #5c4d40;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0 0.25rem;
}

.gr-ai-loc-clear:hover {
  color: #1d1713;
}

/* 7. Giriş Alanı (Vizon Dock + Krem Input & GPS Konum Düğmesi) */
.chatbot-input-container {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.75rem 0.95rem 0.6rem;
  background: #ebe1d2;
  border-top: 1px solid rgba(118, 97, 78, 0.18);
}

.gr-ai-loc-btn {
  width: 42px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fffdf9;
  border: 1px solid rgba(128, 106, 84, 0.3);
  border-radius: 11px;
  color: #544538;
  cursor: pointer;
  transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.gr-ai-loc-btn:hover {
  border-color: #146673;
  color: #146673;
  background: rgba(20, 102, 115, 0.1);
}

.gr-ai-loc-btn.is-active {
  border-color: #146673;
  background: rgba(20, 102, 115, 0.14);
  color: #146673;
}

#userInput {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 0.88rem;
  background: #fffdf9;
  border: 1px solid rgba(128, 106, 84, 0.3);
  border-radius: 11px;
  outline: none;
  color: #1f1915;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.87rem;
  font-weight: 500;
  transition: border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}

#userInput::placeholder {
  color: rgba(74, 60, 48, 0.56);
}

#userInput:focus {
  border-color: #b0562c;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(176, 86, 44, 0.14);
}

.send-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #b0562c;
  color: #fffdf9;
  border: 1px solid #b0562c;
  border-radius: 11px;
  cursor: pointer;
  font-size: 0.92rem;
  box-shadow: 0 4px 12px rgba(176, 86, 44, 0.22);
  transition: background-color 0.22s ease, border-color 0.22s ease, transform 0.22s ease, opacity 0.22s ease;
}

.send-button:hover {
  background: #944420;
  border-color: #944420;
  transform: translateY(-1px);
}

.send-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.gr-ai-footnote {
  padding: 0 1rem 0.65rem;
  background: #ebe1d2;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(74, 60, 48, 0.58);
  text-align: center;
}

/* 8. Mobil Uyum */
@media (max-width: 720px) {
  .gr-ai-trigger {
    right: 14px;
    bottom: 14px;
    height: 44px;
    padding: 0 0.92rem 0 0.78rem;
    gap: 0.55rem;
    font-size: 0.58rem;
  }

  .gr-ai-trigger-badge {
    display: none;
  }

  #chatbot-popup {
    left: 12px;
    right: 12px;
    bottom: 70px;
    width: auto;
    height: min(76dvh, 570px);
    border-radius: 16px;
  }

  .chatbot-header {
    padding: 0.85rem 0.95rem;
  }

  .gr-ai-suggestions {
    padding: 0.55rem 0.9rem;
    gap: 0.36rem;
  }

  #chatbox {
    padding: 0.9rem;
    gap: 0.75rem;
  }

  .message {
    max-width: 92%;
    font-size: 0.84rem;
    padding: 0.78rem 0.88rem;
  }

  #userInput {
    font-size: 16px;
  }
}
