/* ═══════════════════════════════════════════════════════════
   EVONTA PHARMA — Chatbot Widget Styles
   evonta.com.tr
═══════════════════════════════════════════════════════════ */

/* ── Container ─────────────────────────────────────────── */
#evonta-chat {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Bubble Button ─────────────────────────────────────── */
.echat-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1A6B72, #0D2E5B);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(13,46,91,.35);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  margin-left: auto;
}
.echat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 30px rgba(13,46,91,.45);
}
.echat-bubble.echat-active {
  background: linear-gradient(135deg, #0D2E5B, #1A6B72);
}
.echat-bubble svg { width: 26px; height: 26px; }
.echat-icon-open  { display: block; }
.echat-icon-close { display: none;  }
.echat-active .echat-icon-open  { display: none;  }
.echat-active .echat-icon-close { display: block; }

/* Notification badge */
.echat-badge {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #e74c3c;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: echat-ping .8s ease infinite alternate;
}
@keyframes echat-ping {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}

/* ── Chat Window ───────────────────────────────────────── */
.echat-window {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 360px;
  max-height: 520px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 56px rgba(13,46,91,.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.97);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  border: 1px solid rgba(13,46,91,.08);
}
.echat-window.echat-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ────────────────────────────────────────────── */
.echat-header {
  background: linear-gradient(135deg, #0D2E5B 0%, #1A6B72 100%);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.echat-header-left {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.echat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.25);
}
.echat-title {
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
}
.echat-online {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  color: rgba(255,255,255,.7);
  margin-top: .15rem;
}
.echat-dot {
  width: 7px;
  height: 7px;
  background: #2ecc71;
  border-radius: 50%;
  flex-shrink: 0;
  animation: echat-blink 2s ease infinite;
}
@keyframes echat-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}
.echat-close-btn {
  background: rgba(255,255,255,.12);
  border: none;
  color: rgba(255,255,255,.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
}
.echat-close-btn:hover { background: rgba(255,255,255,.25); color: #fff; }

/* ── Messages ──────────────────────────────────────────── */
.echat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  scroll-behavior: smooth;
}
.echat-messages::-webkit-scrollbar { width: 4px; }
.echat-messages::-webkit-scrollbar-track { background: transparent; }
.echat-messages::-webkit-scrollbar-thumb { background: #d0dce4; border-radius: 2px; }

.echat-msg {
  display: flex;
  max-width: 88%;
}
.echat-bot  { align-self: flex-start; }
.echat-user { align-self: flex-end; flex-direction: row-reverse; }

.echat-bubble-msg {
  padding: .65rem .9rem;
  border-radius: 14px;
  font-size: .86rem;
  line-height: 1.6;
  word-break: break-word;
}
.echat-bot .echat-bubble-msg {
  background: #EAF4F5;
  color: #2C3E50;
  border-bottom-left-radius: 4px;
}
.echat-user .echat-bubble-msg {
  background: linear-gradient(135deg, #1A6B72, #0D2E5B);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.echat-bubble-msg a       { color: #1A6B72; font-weight: 600; text-decoration: underline; }
.echat-user .echat-bubble-msg a { color: rgba(255,255,255,.85); }
.echat-bubble-msg strong  { color: inherit; }

/* Typing indicator */
.echat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: .75rem .9rem !important;
}
.echat-typing span {
  width: 7px;
  height: 7px;
  background: #1A6B72;
  border-radius: 50%;
  animation: echat-bounce .9s ease infinite;
  opacity: .5;
}
.echat-typing span:nth-child(2) { animation-delay: .15s; }
.echat-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes echat-bounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: .5; }
  40%            { transform: translateY(-6px); opacity: 1;  }
}

/* ── Quick Replies ─────────────────────────────────────── */
.echat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .5rem 1rem .6rem;
}
.echat-qr-btn {
  background: #fff;
  border: 1.5px solid #1A6B72;
  color: #1A6B72;
  font-size: .76rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background .2s, color .2s;
  font-family: inherit;
  line-height: 1.3;
}
.echat-qr-btn:hover {
  background: #1A6B72;
  color: #fff;
}

/* ── Input Row ─────────────────────────────────────────── */
.echat-input-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-top: 1px solid #e8eef3;
  flex-shrink: 0;
  background: #fff;
}
.echat-input {
  flex: 1;
  border: 1.5px solid #d0dce4;
  border-radius: 50px;
  padding: .55rem 1rem;
  font-size: .86rem;
  font-family: inherit;
  color: #2C3E50;
  outline: none;
  transition: border-color .2s;
  background: #f8fafc;
}
.echat-input:focus {
  border-color: #1A6B72;
  background: #fff;
}
.echat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1A6B72, #0D2E5B);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .2s, box-shadow .2s;
}
.echat-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(26,107,114,.35);
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 480px) {
  #evonta-chat { bottom: 1rem; right: 1rem; }
  .echat-window {
    width: calc(100vw - 2rem);
    right: 0;
    bottom: 68px;
    max-height: 75vh;
  }
}
