/* ============================================================
   AiVoroTech Chat Widget
   ============================================================ */

:root {
  --av-primary   : #3FB5FD;
  --av-secondary : #0B6EDA;
  --av-dark      : #000D27;
  --av-radius    : 18px;
  --av-shadow    : 0 8px 32px rgba(11, 110, 218, 0.22);
  --av-z         : 9999;
}

/* ── Kapsayıcı ─────────────────────────────────────────────── */
#av-chat-widget {
  position  : fixed;
  right     : 25px;
  bottom    : 35px;
  z-index   : var(--av-z);
  display   : flex;
  flex-direction: column;
  align-items: flex-end;
  gap       : 12px;
  font-family: 'DM Sans', 'Montserrat', system-ui, sans-serif;
  max-width     : 155px;
}

/* ── Aç/Kapat Butonu ───────────────────────────────────────── */
#av-chat-toggle {
  display        : flex;
  align-items    : center;
  gap            : 8px;
  padding        : 0 20px 0 14px;
  height         : 52px;
  border-radius  : 999px;
  border         : none;
  cursor         : pointer;
  background     : linear-gradient(135deg, var(--av-primary) 0%, var(--av-secondary) 100%);
  color          : #fff;
  font-size      : 14px;
  font-weight    : 700;
  letter-spacing : 0.3px;
  box-shadow     : var(--av-shadow);
  transition     : transform 0.25s ease, box-shadow 0.25s ease;
  white-space    : nowrap;
}

#av-chat-toggle:hover {
  transform  : translateY(-2px) scale(1.03);
  box-shadow : 0 12px 36px rgba(11, 110, 218, 0.35);
}

#av-chat-toggle .av-chat-icon-open  { font-size: 20px; transition: opacity 0.2s, transform 0.2s; }
#av-chat-toggle .av-chat-icon-close { font-size: 18px; display: none; transition: opacity 0.2s; }
#av-chat-toggle .av-chat-label      { font-size: 13px; }

#av-chat-toggle.av-open .av-chat-icon-open  { display: none; }
#av-chat-toggle.av-open .av-chat-icon-close { display: block; }

/* ── Panel ─────────────────────────────────────────────────── */
#av-chat-panel {
  width          : 360px;
  max-height     : 0;
  overflow       : hidden;
  border-radius  : var(--av-radius);
  background     : #fff;
  box-shadow     : var(--av-shadow);
  display        : flex;
  flex-direction : column;
  opacity        : 0;
  transform      : translateY(16px) scale(0.97);
  transition     : max-height 0.35s cubic-bezier(.4,0,.2,1),
                   opacity    0.3s ease,
                   transform  0.3s ease;
  pointer-events : none;
}

#av-chat-panel.av-open {
  max-height     : 520px;
  opacity        : 1;
  transform      : translateY(0) scale(1);
  pointer-events : auto;
}

/* ── Header ────────────────────────────────────────────────── */
.av-chat-header {
  display         : flex;
  align-items     : center;
  gap             : 10px;
  padding         : 14px 16px;
  background      : linear-gradient(135deg, var(--av-secondary) 0%, var(--av-dark) 100%);
  border-radius   : var(--av-radius) var(--av-radius) 0 0;
  flex-shrink     : 0;
}

.av-chat-logo {
  height    : 32px;
  width     : auto;
  object-fit: contain;
  filter    : brightness(0) invert(1);
}

.av-chat-logo-icon {
  width          : 36px;
  height         : 36px;
  border-radius  : 50%;
  background     : rgba(255,255,255,0.15);
  display        : flex;
  align-items    : center;
  justify-content: center;
  color          : #fff;
  font-size      : 18px;
  flex-shrink    : 0;
}

.av-chat-header-text {
  flex        : 1;
  display     : flex;
  flex-direction: column;
  overflow    : hidden;
}

.av-chat-title {
  color       : #fff;
  font-size   : 14px;
  font-weight : 700;
  line-height : 1.2;
  white-space : nowrap;
  overflow    : hidden;
  text-overflow: ellipsis;
}

.av-chat-subtitle {
  color       : rgba(255,255,255,0.72);
  font-size   : 11px;
  margin-top  : 2px;
  white-space : nowrap;
  overflow    : hidden;
  text-overflow: ellipsis;
}

.av-chat-close {
  background  : rgba(255,255,255,0.12);
  border      : none;
  color       : #fff;
  width       : 30px;
  height      : 30px;
  border-radius: 50%;
  cursor      : pointer;
  display     : flex;
  align-items : center;
  justify-content: center;
  font-size   : 13px;
  transition  : background 0.2s;
  flex-shrink : 0;
}

.av-chat-close:hover { background: rgba(255,255,255,0.25); }

/* ── Mesaj alanı ───────────────────────────────────────────── */
.av-chat-messages {
  flex         : 1;
  overflow-y   : auto;
  padding      : 16px;
  display      : flex;
  flex-direction: column;
  gap          : 10px;
  scroll-behavior: smooth;
}

.av-chat-messages::-webkit-scrollbar { width: 4px; }
.av-chat-messages::-webkit-scrollbar-track { background: transparent; }
.av-chat-messages::-webkit-scrollbar-thumb { background: #dde; border-radius: 4px; }

/* ── Mesaj balonları ───────────────────────────────────────── */
.av-msg {
  display  : flex;
  max-width: 88%;
}

.av-msg-user      { align-self: flex-end; justify-content: flex-end; }
.av-msg-assistant { align-self: flex-start; }

.av-bubble {
  padding      : 10px 14px;
  border-radius: 16px;
  font-size    : 13.5px;
  line-height  : 1.55;
  word-break   : break-word;
}

.av-msg-user .av-bubble {
  background   : linear-gradient(135deg, var(--av-primary) 0%, var(--av-secondary) 100%);
  color        : #fff;
  border-bottom-right-radius: 4px;
}

.av-msg-assistant .av-bubble {
  background   : #f1f4f8;
  color        : #1a1a2e;
  border-bottom-left-radius: 4px;
}

/* ── Typing indicator ──────────────────────────────────────── */
.av-chat-typing {
  display    : flex;
  align-items: center;
  gap        : 4px;
  padding    : 4px 16px 8px;
  flex-shrink: 0;
}

.av-chat-typing span {
  width           : 7px;
  height          : 7px;
  border-radius   : 50%;
  background      : var(--av-primary);
  animation       : av-bounce 1.2s infinite ease-in-out;
  display         : inline-block;
}

.av-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.av-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes av-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%            { transform: scale(1.1); opacity: 1;   }
}

.av-hidden { display: none !important; }

/* ── Footer / Input ────────────────────────────────────────── */
.av-chat-footer {
  display       : flex;
  align-items   : flex-end;
  gap           : 8px;
  padding       : 10px 12px 12px;
  border-top    : 1px solid #eef0f5;
  flex-shrink   : 0;
}

.av-chat-input {
  flex         : 1;
  border       : 1.5px solid #dde2ee;
  border-radius: 12px;
  padding      : 9px 13px;
  font-size    : 13px;
  font-family  : inherit;
  resize       : none;
  outline      : none;
  line-height  : 1.4;
  color        : #1a1a2e;
  background   : #f7f9fc;
  transition   : border-color 0.2s;
  max-height   : 120px;
  overflow-y   : auto;
}

.av-chat-input:focus { border-color: var(--av-primary); background: #fff; }
.av-chat-input::placeholder { color: #aab; }

.av-chat-send {
  width          : 40px;
  height         : 40px;
  border-radius  : 50%;
  border         : none;
  cursor         : pointer;
  background     : linear-gradient(135deg, var(--av-primary) 0%, var(--av-secondary) 100%);
  color          : #fff;
  font-size      : 14px;
  display        : flex;
  align-items    : center;
  justify-content: center;
  transition     : transform 0.2s, opacity 0.2s;
  flex-shrink    : 0;
}

.av-chat-send:hover    { transform: scale(1.1); }
.av-chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Mobil uyum ────────────────────────────────────────────── */
@media (max-width: 480px) {

  #av-chat-panel {
    width     : calc(100vw - 24px);
    max-height: 0;
  }

  #av-chat-panel.av-open {
    max-height: 480px;
  }

  #av-chat-toggle {
    padding: 0 16px 0 12px;
    height : 48px;
  }
}
/* WhatsApp AI Floating Button */
.whatsapp-float {
    position: fixed;
    left: 25px;
    bottom: 35px;
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    background-color: #25D366;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-family: 'DM Sans', 'Montserrat', system-ui, sans-serif;
}

.whatsapp-float:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.65);
    color: #fff;
}

.whatsapp-icon-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #25D366;
    font-size: 24px;
    flex-shrink: 0;
}

.whatsapp-ai-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: linear-gradient(135deg, #3FB5FD 0%, #0B6EDA 100%);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 8px;
    border: 2px solid #25D366;
    line-height: 1;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 6px rgba(11, 110, 218, 0.4);
}

.whatsapp-label {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    white-space: nowrap;
}

.whatsapp-label-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.2px;
}

.whatsapp-label-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
    font-weight: 500;
}

@media (max-width: 480px) {
    .whatsapp-float {
        padding: 5px 5px 5px 5px;
        gap: 0;
    }
    .whatsapp-label {
        display: none;
    }
    .whatsapp-icon-wrap {
        width: 44px;
        height: 44px;
    }
}