/* ── Adıgüzel Genel Bilgi & Destek Asistanı CSS ── */

:root {
  --adg-genel-primary: #002b49;
  --adg-genel-primary-dark: #001c30;
  --adg-genel-accent: #ff7a1a;
  --adg-genel-whatsapp: #25d366;
  --adg-genel-whatsapp-dark: #128c7e;
  --adg-genel-bg: #f8fafc;
  --adg-genel-card-bg: #ffffff;
  --adg-genel-text: #1e293b;
  --adg-genel-text-muted: #64748b;
  --adg-genel-border: #e2e8f0;
  --adg-genel-radius: 16px;
  --adg-genel-shadow: 0 20px 45px -10px rgba(0, 43, 73, 0.22), 0 8px 16px -6px rgba(0, 0, 0, 0.1);
}

/* ── Yüzen Wrapper ── */
.adg-genel-wrapper {
  position: fixed;
  z-index: 999990;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--adg-genel-text);
  line-height: 1.5;
  box-sizing: border-box;
}

.adg-genel-wrapper *,
.adg-genel-wrapper *::before,
.adg-genel-wrapper *::after {
  box-sizing: border-box;
}

.adg-genel-bottom-right {
  bottom: 0;
  right: 24px;
}

.adg-genel-bottom-left {
  bottom: 0;
  left: 24px;
}

/* ── Inline / Sayfa İçi Mod ── */
.adg-genel-inline {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  width: 100%;
  margin: 20px auto;
  z-index: 10;
}

/* ── Yüzen Buton & Bar (Bottom 0 Canlı Destek) ── */
.adg-genel-toggle-btn {
  height: 44px;
  padding: 0 18px 0 16px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(135deg, var(--chat-color, var(--adg-genel-primary)), var(--adg-genel-primary-dark));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: none;
  box-shadow: 0 -4px 18px rgba(0, 43, 73, 0.28);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  outline: none;
  user-select: none;
}

.adg-genel-toggle-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 -6px 24px rgba(0, 43, 73, 0.4);
  background: linear-gradient(135deg, var(--adg-genel-primary-dark), var(--chat-color, var(--adg-genel-primary)));
}

.adg-genel-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.adg-genel-toggle-text {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.adg-genel-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: adgPulseDot 2s infinite;
}

@keyframes adgPulseDot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.75;
  }
}

/* ── Sohbet Penceresi ── */
.adg-genel-window {
  width: 570px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 70px);
  background: var(--adg-genel-card-bg);
  border-radius: var(--adg-genel-radius);
  box-shadow: var(--adg-genel-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 43, 73, 0.1);
  transition: all 0.3s ease;
  margin-bottom: 8px;
}

.adg-genel-inline .adg-genel-window {
  width: 100%;
  max-width: 100%;
  margin-bottom: 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* ── Header ── */
.adg-genel-header {
  background: linear-gradient(135deg, var(--chat-color, var(--adg-genel-primary)), var(--adg-genel-primary-dark));
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.adg-genel-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.adg-genel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.adg-genel-header-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  color: #ffffff;
}

.adg-genel-header-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.adg-genel-status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10b981;
}

.adg-genel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.adg-genel-btn-icon {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.adg-genel-btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.adg-genel-whatsapp-badge-btn {
  background: var(--adg-genel-whatsapp) !important;
  color: #ffffff !important;
  font-weight: 600;
}

.adg-genel-whatsapp-badge-btn:hover {
  background: var(--adg-genel-whatsapp-dark) !important;
}

/* ── Mesaj Alanı ── */
.adg-genel-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.adg-genel-message {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: adgFadeIn 0.25s ease-out;
}

@keyframes adgFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.adg-genel-message.adg-user {
  align-self: flex-end;
}

.adg-genel-message.adg-bot {
  align-self: flex-start;
}

.adg-genel-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.adg-user .adg-genel-bubble {
  background: var(--chat-color, var(--adg-genel-primary));
  color: #ffffff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 3px 10px rgba(0, 43, 73, 0.15);
}

.adg-bot .adg-genel-bubble {
  background: #ffffff;
  color: var(--adg-genel-text);
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.adg-bot .adg-genel-bubble strong {
  color: var(--adg-genel-primary-dark);
}

.adg-bot .adg-genel-bubble ul,
.adg-bot .adg-genel-bubble ol {
  margin: 6px 0;
  padding-left: 18px;
}

/* ── WhatsApp Yönlendirme Kartı (Önemli & Can Alıcı Bileşen) ── */
.adg-whatsapp-card {
  margin-top: 10px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adg-whatsapp-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 6px;
}

.adg-whatsapp-card-desc {
  font-size: 12px;
  color: #14532d;
  line-height: 1.4;
  margin: 0;
}

.adg-whatsapp-card-btn {
  background: linear-gradient(135deg, #25d366, #16a34a);
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none !important;
  padding: 9px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.adg-whatsapp-card-btn:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 211, 102, 0.4);
}

/* ── Yazıyor İndikatörü ── */
.adg-genel-typing .adg-genel-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.adg-genel-dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: adgWave 1.3s infinite ease-in-out;
}

.adg-genel-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.adg-genel-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes adgWave {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-5px);
    background: var(--chat-color, var(--adg-genel-primary));
  }
}

/* ── Hızlı Yanıt Butonları ── */
.adg-genel-quick-replies {
  padding: 8px 14px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.adg-genel-quick-replies::-webkit-scrollbar {
  height: 4px;
}

.adg-genel-quick-replies::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.adg-genel-quick-btn {
  background: #f1f5f9;
  color: var(--adg-genel-primary);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.adg-genel-quick-btn:hover {
  background: var(--chat-color, var(--adg-genel-primary));
  color: #ffffff;
  border-color: var(--chat-color, var(--adg-genel-primary));
}

/* ── Input Alanı ── */
.adg-genel-input-area {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.adg-genel-input-box {
  display: flex;
  align-items: flex-end;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 24px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s ease;
}

.adg-genel-input-box:focus-within {
  border-color: var(--chat-color, var(--adg-genel-primary));
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 43, 73, 0.08);
}

.adg-genel-textarea {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  padding: 8px 4px;
  resize: none;
  max-height: 100px;
  color: #0f172a !important;
}

.adg-genel-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--chat-color, var(--adg-genel-primary));
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.adg-genel-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  background: var(--adg-genel-primary-dark);
}

.adg-genel-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── 2 Sütunlu Sayfa Düzeni (Shortcode) ── */
.adg-genel-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin: 24px 0;
}

.adg-genel-hero-panel {
  background: linear-gradient(135deg, var(--chat-color, var(--adg-genel-primary)), var(--adg-genel-primary-dark));
  color: #ffffff;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.adg-genel-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 14px;
}

.adg-genel-hero-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: #ffffff;
  line-height: 1.25;
}

.adg-genel-hero-desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 24px 0;
}

.adg-genel-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.adg-genel-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.adg-genel-feature-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.adg-genel-direct-whatsapp-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ── Responsive & Mobil Uyumluluk ── */
@media (max-width: 768px) {
  .adg-genel-page-grid {
    grid-template-columns: 1fr;
    margin: 16px 0;
    border-radius: 16px;
  }

  .adg-genel-hero-panel {
    padding: 24px 20px;
  }

  .adg-genel-hero-title {
    font-size: 22px;
  }

  /* Yüzen Buton Konumu */
  .adg-genel-wrapper.adg-genel-bottom-right,
  .adg-genel-wrapper.adg-genel-bottom-left {
    bottom: 0;
    right: 14px;
    left: auto;
    z-index: 999998;
  }

  .adg-genel-toggle-btn {
    height: 42px;
    padding: 0 16px 0 14px;
    font-size: 13.5px;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -3px 15px rgba(0, 43, 73, 0.3);
  }

  /* Yüzen Sohbet Penceresi (Mobilde Tam Oturan Bottom Sheet Modal) */
  .adg-genel-wrapper .adg-genel-window {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 88dvh !important;
    height: 88vh;
    max-height: 88dvh !important;
    max-height: 88vh;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3) !important;
    z-index: 999999;
  }

  .adg-genel-wrapper.adg-open .adg-genel-toggle-btn {
    display: none !important;
  }

  .adg-genel-header {
    padding: 12px 14px;
  }

  .adg-genel-avatar {
    width: 36px;
    height: 36px;
    font-size: 18px;
    border-radius: 10px;
  }

  .adg-genel-header-title {
    font-size: 14px;
  }

  .adg-genel-header-sub {
    font-size: 11px;
  }

  .adg-genel-messages {
    padding: 14px 12px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .adg-genel-message {
    max-width: 90%;
  }

  .adg-genel-bubble {
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.45;
  }

  .adg-genel-quick-replies {
    padding: 6px 10px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .adg-genel-quick-replies::-webkit-scrollbar {
    display: none;
  }

  .adg-genel-quick-btn {
    padding: 5px 11px;
    font-size: 11.5px;
  }

  .adg-genel-input-area {
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    background: #ffffff;
  }

  .adg-genel-textarea {
    font-size: 16px !important; /* iOS Safari otomatik zoom yapmasını engeller */
    padding: 6px 4px;
    max-height: 80px;
  }

  .adg-genel-send-btn {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 380px) {
  .adg-genel-toggle-btn {
    padding: 0 12px 0 10px;
    font-size: 12.5px;
    gap: 6px;
  }

  .adg-genel-header-title {
    font-size: 13px;
  }

  .adg-genel-header-actions .adg-genel-whatsapp-badge-btn {
    display: none;
  }
}