/* ============================================================================
   BERABER GEZELİM — DENİZLİ LÜKS EDİTORYAL AI CONCIERGE (CHATBOT)
   Sıcak Bazalt (#100f0e), Karahayıt Bakır (#dc8e62), Mineral Turkuaz (#6cc2cf)
   ============================================================================ */

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

/* 1. Yüzen Mimari Concierge Tetikleyici */
.gr-ai-trigger {
  position: fixed;
  right: 26px;
  bottom: 24px;
  z-index: 6600;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  height: 48px;
  padding: 0 1.15rem 0 0.9rem;
  background: rgba(14, 13, 12, 0.92);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  border: 1px solid rgba(220, 142, 98, 0.45);
  border-radius: 0;
  color: #f6f2ea;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  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::before,
.gr-ai-trigger::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-color: #dc8e62;
  border-style: solid;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.gr-ai-trigger::before {
  top: -1px;
  left: -1px;
  border-width: 1.5px 0 0 1.5px;
}

.gr-ai-trigger::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1.5px 1.5px 0;
}

.gr-ai-trigger:hover {
  transform: translateY(-2px);
  border-color: #dc8e62;
  background: rgba(20, 18, 16, 0.96);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.64), 0 0 0 1px rgba(220, 142, 98, 0.18);
}

.gr-ai-trigger.is-open {
  border-color: #dc8e62;
  background: #dc8e62;
  color: #14110f;
}

.gr-ai-trigger.is-open .gr-ai-trigger-dot {
  background: #14110f;
  box-shadow: none;
}

.gr-ai-trigger.is-open .gr-ai-trigger-badge {
  background: rgba(20, 17, 15, 0.14);
  border-color: rgba(20, 17, 15, 0.28);
  color: #14110f;
}

.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.2);
  animation: grAiPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

.gr-ai-trigger-badge {
  padding: 0.16rem 0.42rem;
  background: rgba(220, 142, 98, 0.14);
  border: 1px solid rgba(220, 142, 98, 0.38);
  color: #e9a37b;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  line-height: 1;
}

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

/* 2. Ana Editoryal Concierge Paneli */
#chatbot-popup {
  position: fixed;
  right: 26px;
  bottom: 84px;
  width: min(416px, calc(100vw - 32px));
  height: min(610px, calc(100vh - 116px));
  max-height: 650px;
  z-index: 6900;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(18, 16, 14, 0.97) 0%, rgba(11, 10, 9, 0.985) 100%);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(220, 142, 98, 0.3);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f6f2ea;
  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: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(220, 142, 98, 0.78) 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ı */
.chatbot-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.95rem;
  background: rgba(23, 21, 19, 0.94);
  border-bottom: 1px solid rgba(246, 242, 234, 0.1);
}

.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: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #dc8e62;
}

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

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

.gr-ai-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  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, 255, 255, 0.03);
  border: 1px solid rgba(246, 242, 234, 0.12);
  border-radius: 0;
  color: rgba(246, 242, 234, 0.76);
  font-family: "JetBrains Mono", monospace;
  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 {
  width: 14px;
  height: 14px;
  display: block;
}

.gr-ai-icon-btn:hover,
#close-chatbot:hover {
  border-color: rgba(220, 142, 98, 0.68);
  background: rgba(220, 142, 98, 0.12);
  color: #e9a37b;
}

/* 4. Hızlı Soru Önerileri Şeridi */
.gr-ai-suggestions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  padding: 0.65rem 1.05rem;
  overflow-x: auto;
  background: rgba(11, 10, 9, 0.72);
  border-bottom: 1px solid rgba(246, 242, 234, 0.08);
  scrollbar-width: none;
}

.gr-ai-suggestions::-webkit-scrollbar {
  display: none;
}

.gr-ai-chip {
  flex: 0 0 auto;
  padding: 0.38rem 0.72rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(246, 242, 234, 0.13);
  border-radius: 0;
  color: rgba(246, 242, 234, 0.82);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.gr-ai-chip:hover {
  border-color: rgba(220, 142, 98, 0.64);
  background: rgba(220, 142, 98, 0.12);
  color: #e9a37b;
}

/* 5. Mesaj Akışı */
#chatbox {
  flex: 1;
  padding: 1.1rem 1.1rem 1rem;
  overflow-y: auto;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  color: #f6f2ea;
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 142, 98, 0.35) transparent;
}

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

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

#chatbox::-webkit-scrollbar-thumb {
  background: rgba(220, 142, 98, 0.35);
}

.message {
  position: relative;
  max-width: 88%;
  padding: 0.85rem 1rem;
  border-radius: 0;
  font-size: 0.86rem;
  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.38rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.72;
}

.bot-message {
  margin-right: auto;
  background: rgba(255, 255, 255, 0.036);
  border: 1px solid rgba(246, 242, 234, 0.09);
  border-left: 2px solid #dc8e62;
  color: rgba(246, 242, 234, 0.93);
  box-shadow: none;
}

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

.bot-message strong {
  color: #fbf8f2;
  font-weight: 600;
}

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

.user-message {
  margin-left: auto;
  background: rgba(220, 142, 98, 0.14);
  border: 1px solid rgba(220, 142, 98, 0.36);
  color: #faf6ef;
  box-shadow: none;
}

.user-message::before {
  content: "SEN";
  text-align: right;
  color: rgba(233, 163, 123, 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.5rem;
  background: rgba(220, 142, 98, 0.13);
  border: 1px solid rgba(220, 142, 98, 0.42);
  color: #e9a37b !important;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.71rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  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: #dc8e62;
  border-color: #dc8e62;
  color: #14110f !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.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(246, 242, 234, 0.09);
  border-left: 2px solid #dc8e62;
  border-radius: 0;
  box-shadow: none;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dc8e62;
  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: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.54rem;
  letter-spacing: 0.16em;
  color: rgba(233, 163, 123, 0.85);
}

@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(108, 194, 207, 0.1);
  border-top: 1px solid rgba(108, 194, 207, 0.28);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  color: #6cc2cf;
}

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

.gr-ai-loc-clear {
  background: transparent;
  border: 0;
  color: rgba(246, 242, 234, 0.65);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0 0.2rem;
}

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

/* 7. Giriş Alanı (Birleşik Mimari Kutu + GPS Konum Düğmesi) */
.chatbot-input-container {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.78rem 0.95rem 0.65rem;
  background: rgba(14, 13, 12, 0.96);
  border-top: 1px solid rgba(246, 242, 234, 0.1);
}

.gr-ai-loc-btn {
  width: 42px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(246, 242, 234, 0.15);
  border-radius: 0;
  color: rgba(246, 242, 234, 0.76);
  cursor: pointer;
  transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.gr-ai-loc-btn:hover {
  border-color: rgba(108, 194, 207, 0.65);
  color: #6cc2cf;
  background: rgba(108, 194, 207, 0.1);
}

.gr-ai-loc-btn.is-active {
  border-color: #6cc2cf;
  background: rgba(108, 194, 207, 0.18);
  color: #6cc2cf;
}

#userInput {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 0.85rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(246, 242, 234, 0.14);
  border-radius: 0;
  outline: none;
  color: #f6f2ea;
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  transition: border-color 0.22s ease, background-color 0.22s ease;
}

#userInput::placeholder {
  color: rgba(246, 242, 234, 0.42);
}

#userInput:focus {
  border-color: rgba(220, 142, 98, 0.74);
  background: rgba(255, 255, 255, 0.055);
}

.send-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc8e62;
  color: #14110f;
  border: 1px solid #dc8e62;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.92rem;
  box-shadow: none;
  transition: background-color 0.22s ease, transform 0.22s ease, opacity 0.22s ease;
}

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

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

.gr-ai-footnote {
  padding: 0 1rem 0.65rem;
  background: rgba(14, 13, 12, 0.96);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 242, 234, 0.36);
  text-align: center;
}

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

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

  #chatbot-popup {
    left: 12px;
    right: 12px;
    bottom: 68px;
    width: auto;
    height: min(76dvh, 560px);
  }

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

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

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

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