/* Elena Dating AI widget */
/* Launcher styles live in elena-aquarium.css */

#elena-panel {
  position: fixed;
  right: 18px;
  bottom: 180px;
  z-index: 41;
  width: min(420px, calc(100vw - 24px));
  height: min(640px, calc(100vh - 200px));
  display: none;
  flex-direction: column;
  background: #1a1340;
  color: #f4f0ff;
  border: 1px solid rgba(180, 160, 255, .28);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(10, 6, 30, .55);
}
#elena-panel.open { display: flex; }

.elena-header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: linear-gradient(120deg, #3a2a78, #241a52);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.elena-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #6b4fc4;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.elena-title { font: 800 14px/1.25 Manrope, system-ui, sans-serif; }
.elena-sub { font: 500 11px/1.3 Manrope, system-ui, sans-serif; opacity: .85; margin-top: 2px; }
.elena-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.elena-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0,0,0,.18);
  font: 600 11px/1.3 Manrope, system-ui, sans-serif;
}
.elena-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.elena-badge.active { background: rgba(46, 204, 113, .22); color: #b8f5d0; }
.elena-battery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 140px;
}
.elena-battery-shell {
  width: 72px;
  height: 12px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 3px;
  overflow: hidden;
  background: rgba(0,0,0,.25);
  position: relative;
}
.elena-battery-shell::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 3px;
  width: 3px;
  height: 6px;
  background: rgba(255,255,255,.35);
  border-radius: 0 1px 1px 0;
}
#elena-battery-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7CF5B0, #2ecc71);
  transition: width .25s ease, background .25s ease;
}
#elena-battery-fill.low { background: linear-gradient(90deg, #f7b267, #e67e22); }
#elena-battery-fill.empty { background: linear-gradient(90deg, #ff7675, #c0392b); }
#elena-cooldown-banner {
  display: none;
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(231, 76, 60, .18);
  color: #ffd4d1;
}
#elena-cooldown-banner.show { display: block; }

#elena-messages {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.elena-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font: 500 13px/1.45 Manrope, system-ui, sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
}
.elena-msg.bot { align-self: flex-start; background: rgba(255,255,255,.08); }
.elena-msg.user { align-self: flex-end; background: #5b3d9a; }
.elena-msg blockquote {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: rgba(0,0,0,.22);
  border-left: 3px solid #b59bff;
  border-radius: 8px;
  font-style: normal;
}
.elena-tip { margin-top: 8px; opacity: .95; }
.elena-cards { display: grid; gap: 8px; margin-top: 8px; }
.elena-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(0,0,0,.22);
  align-items: center;
}
.elena-card img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #2a2158;
}
.elena-card strong { display: block; font-size: 13px; }
.elena-card span { display: block; font-size: 11px; opacity: .8; margin: 2px 0 6px; }
.elena-open-profile {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: #7c5cbf;
  color: #fff;
  font: 700 11px Manrope, system-ui, sans-serif;
  cursor: pointer;
}

#elena-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  max-height: 96px;
  overflow: auto;
}
.elena-chip {
  border: 1px solid rgba(190,170,255,.35);
  background: rgba(255,255,255,.06);
  color: #efeaff;
  border-radius: 999px;
  padding: 6px 10px;
  font: 600 11px/1.2 Manrope, system-ui, sans-serif;
  cursor: pointer;
}
.elena-chip:hover { background: rgba(255,255,255,.12); }

.elena-composer {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 6px;
  align-items: end;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.1);
  background: #140e33;
}
.elena-icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}
#chatbot-mic-btn.listening {
  background: #c0392b;
  animation: elena-pulse 1s infinite;
}
@keyframes elena-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .55); }
  50% { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0); }
}
#chatbot-input {
  width: 100%;
  min-height: 76px;
  max-height: 140px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #fff;
  padding: 10px 12px;
  font: 500 14px/1.4 Manrope, system-ui, sans-serif;
  box-sizing: border-box;
}
#chatbot-input::placeholder { color: rgba(255,255,255,.45); }
#chatbot-send-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #7c5cbf, #4f2f8f);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}
#elena-photo-preview {
  display: none;
  padding: 0 10px 8px;
  font: 500 11px Manrope, system-ui, sans-serif;
  opacity: .85;
}
#elena-photo-preview.show { display: block; }

@media (max-width: 640px) {
  #elena-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    height: min(78vh, 640px);
    border-radius: 18px 18px 0 0;
  }
  #chatbot-input { font-size: 16px; min-height: 76px; }
}
