/* WhatsApp canlı sohbet — Bengu / Haldiz tarzı */
.guney-chat-wrap {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 100010;
  font-family: 'Inter', system-ui, sans-serif;
}
@media (max-width: 980px) {
  .guney-chat-wrap {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}
.guney-chat-wrap.is-ready .guney-chat-fab {
  animation: guney-fab-in 0.35s ease both;
}
@keyframes guney-fab-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.guney-chat-preview {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(300px, calc(100vw - 32px));
  background: #fff;
  border-radius: 14px 14px 4px 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  font-size: 0.88rem;
  line-height: 1.45;
  color: #1e293b;
  border-left: 3px solid #25d366;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.guney-chat-preview.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  cursor: pointer;
}
.guney-chat-preview.is-hidden { display: none; }
.guney-chat-preview.typing::after {
  content: '▋';
  animation: guney-chat-blink 0.65s step-end infinite;
  color: #25d366;
  margin-left: 2px;
}
@keyframes guney-chat-blink {
  50% { opacity: 0; }
}

.guney-chat-fab {
  position: relative;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.guney-chat-fab:active { transform: scale(0.95); }
.guney-chat-fab svg { width: 32px; height: 32px; }
.guney-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #ef4444;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}
.guney-chat-badge.is-pop {
  animation: guney-badge-pop 0.45s ease;
}
@keyframes guney-badge-pop {
  0% { transform: scale(0.4); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.guney-chat-fab.is-read .guney-chat-badge { display: none; }

.guney-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  background: #f4f6f5;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.guney-chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.guney-chat-header {
  background: linear-gradient(135deg, #128c7e, #075e54);
  color: #fff;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.guney-chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eceae6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.guney-chat-header-avatar img,
.guney-chat-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.guney-chat-header-text h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.guney-chat-wordmark {
  width: 22px;
  height: auto;
  border-radius: 4px;
  background: #eceae6;
  flex-shrink: 0;
}
.guney-chat-header-text p {
  margin: 2px 0 0;
  font-size: 0.7rem;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
}
.guney-chat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: guney-dot-pulse 1.6s ease infinite;
}
@keyframes guney-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.guney-chat-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.guney-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  max-height: 280px;
  -webkit-overflow-scrolling: touch;
}
.guney-chat-msg {
  background: #fff;
  border-radius: 10px 10px 10px 2px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #1e293b;
  border-left: 3px solid #25d366;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  white-space: pre-wrap;
}
.guney-chat-msg time {
  display: block;
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 5px;
}
.guney-chat-msg.typing::after {
  content: '▋';
  animation: guney-chat-blink 0.65s step-end infinite;
  color: #128c7e;
  margin-left: 2px;
}

.guney-chat-footer {
  padding: 10px 12px 12px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: center;
}
.guney-chat-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  background: #f8fafc;
}
.guney-chat-input:focus {
  border-color: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}
.guney-chat-wa-inline {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}
.guney-chat-wa-inline svg { width: 24px; height: 24px; }
