/* ================================================================
   Balkanea AI Chat Widget — chat.css
   ================================================================ */

:root {
  --bea-color:        #1a6b4a;
  --bea-color-light:  #e8f5f0;
  --bea-color-dark:   #134d36;
  --bea-radius:       16px;
  --bea-shadow:       0 8px 32px rgba(0,0,0,.18);
  --bea-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bea-z:            99999;
}

/* ── Toggle button ──────────────────────────────────────────── */
#bea-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--bea-z);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bea-color);
  border: none;
  cursor: pointer;
  box-shadow: var(--bea-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, background .2s;
}
#bea-toggle:hover { background: var(--bea-color-dark); transform: scale(1.07); }
#bea-toggle svg   { width: 26px; height: 26px; fill: #fff; }

/* Unread badge */
#bea-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #e53e3e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  display: none;
}

/* ── Window ─────────────────────────────────────────────────── */
#bea-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: var(--bea-z);
  width: 370px;
  max-height: 560px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--bea-radius);
  box-shadow: var(--bea-shadow);
  font-family: var(--bea-font);
  font-size: 14px;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
#bea-window.bea-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ── Header ─────────────────────────────────────────────────── */
#bea-header {
  background: var(--bea-color);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
#bea-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
#bea-header-text h3 { margin: 0; font-size: 15px; font-weight: 600; }
#bea-header-text p  { margin: 0; font-size: 12px; opacity: .8; }

#bea-status {
  margin-left: auto;
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; opacity: .85;
}
#bea-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #68d391;
}

/* ── Messages ───────────────────────────────────────────────── */
#bea-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
#bea-messages::-webkit-scrollbar { width: 4px; }
#bea-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.bea-msg {
  max-width: 82%;
  line-height: 1.5;
  animation: beaFadeIn .2s ease;
}
@keyframes beaFadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.bea-msg-bot {
  align-self: flex-start;
}
.bea-msg-user {
  align-self: flex-end;
}

.bea-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.bea-msg-bot  .bea-bubble { background: var(--bea-color-light); color: #1a202c; border-bottom-left-radius: 4px; }
.bea-msg-user .bea-bubble { background: var(--bea-color); color: #fff; border-bottom-right-radius: 4px; }

.bea-msg-time {
  font-size: 11px; color: #999; margin-top: 3px;
  padding: 0 4px;
}
.bea-msg-bot  .bea-msg-time { text-align: left; }
.bea-msg-user .bea-msg-time { text-align: right; }

/* Typing indicator */
.bea-typing .bea-bubble {
  display: flex; gap: 5px; align-items: center;
  padding: 12px 16px;
}
.bea-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bea-color);
  animation: beaDot 1.2s infinite;
}
.bea-dot:nth-child(2) { animation-delay: .2s; }
.bea-dot:nth-child(3) { animation-delay: .4s; }
@keyframes beaDot {
  0%, 80%, 100% { transform: scale(.7); opacity:.4; }
  40%           { transform: scale(1);  opacity:1; }
}

/* ── Input area ─────────────────────────────────────────────── */
#bea-input-area {
  border-top: 1px solid #eee;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
#bea-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: var(--bea-font);
  resize: none;
  outline: none;
  max-height: 100px;
  min-height: 38px;
  line-height: 1.4;
  transition: border-color .15s;
  background: #fff;
}
#bea-input:focus { border-color: var(--bea-color); }
#bea-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bea-color);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}
#bea-send:hover   { background: var(--bea-color-dark); }
#bea-send:active  { transform: scale(.92); }
#bea-send:disabled{ opacity: .5; cursor: default; }
#bea-send svg { width: 18px; height: 18px; fill: #fff; }

/* Quick suggestions */
#bea-suggestions {
  padding: 0 12px 10px;
  display: flex; flex-wrap: wrap; gap: 6px;
  flex-shrink: 0;
}
.bea-suggestion {
  background: var(--bea-color-light);
  color: var(--bea-color-dark);
  border: 1px solid #c6e6d8;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.bea-suggestion:hover { background: #c6e6d8; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  #bea-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 80px;
    max-height: calc(100vh - 100px);
  }
  #bea-toggle { right: 16px; bottom: 16px; }
}
