/* ===========================================================
   ZIA WIDGET (rev2)
   Full CSS for public/widget.css
   Compatible with widget.js rev2 and chat.php rev3
   Last update: 2025-11-08
   =========================================================== */

/* ---------- RESET & BASE ---------- */
:root {
  --zomo-primary: #4b7bec;
  --zomo-bg: #fff;
  --zomo-bg-alt: #f5f7fb;
  --zomo-text: #1a1a1a;
  --zomo-border: #ddd;
  --zomo-bubble-user: #e2edff;
  --zomo-bubble-assistant: #ffffff;
  --zomo-shadow: rgba(0,0,0,0.34);
}
[data-zomo-theme='dark'] {
  --zomo-primary: #70a1ff;
  --zomo-bg: #1e1e2e;
  --zomo-bg-alt: #2b2b3c;
  --zomo-text: #f0f0f0;
  --zomo-border: #444;
  --zomo-bubble-user: #334266;
  --zomo-bubble-assistant: #2b2b3c;
  --zomo-shadow: rgba(0,0,0,0.4);
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--zomo-text);
}

/* ---------- LAUNCHER BUBBLE ---------- */
#zomo-bubble {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--zomo-primary);
  box-shadow: 0 4px 10px var(--zomo-shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#zomo-bubble:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px var(--zomo-shadow);
}
#zomo-bubble img {
  width: 40px;
  height: 40px;
  user-select: none;
}

/* ---------- WIDGET CONTAINER ---------- */
#zomo-widget {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 380px;
  max-height: 80vh;
  background: var(--zomo-bg);
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--zomo-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
}

/* ---------- HEADER ---------- */
#zomo-header {
  background: var(--zomo-primary);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#zomo-header .logo {
  height: 32px;
}
#zomo-header .title {
  flex-grow: 1;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.05em;
  font-size: 1.1rem;
}
#zomo-header .actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.zomo-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: opacity 0.2s ease;
}
.zomo-btn:hover {
  opacity: 0.8;
}

/* ---------- HERO ---------- */
#zomo-hero {
  background: var(--zomo-bg-alt);
  padding: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--zomo-border);
}
#zomo-hero .square-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
#zomo-hero .square {
  width: 100px;
  height: auto;
}
#zomo-hero .hero-text {
  color: var(--zomo-text);
  line-height: 1.4;
}

/* ---------- MESSAGES ---------- */
#zomo-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: var(--zomo-bg);
}
.message {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.message .avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  user-select: none;
}
.message .bubble {
  padding: 0.6rem 0.9rem;
  margin-left: 0.5rem;
  border-radius: 14px;
  box-shadow: 0 1px 3px var(--zomo-shadow);
  max-width: 80%;
  word-wrap: break-word;
  position: relative;
}
.message.user .bubble {
  background: var(--zomo-bubble-user);
  align-self: flex-end;
}
.message.assistant .bubble {
  background: var(--zomo-bubble-assistant);
}
/* Fără subliniere la linkurile din mesajele asistentului */
.message.assistant .bubble a {
  color: var(--zomo-primary);
  text-decoration: none !important;
}

.message.assistant .bubble a:hover {
  text-decoration: none !important;
}

/* Fără subliniere în mesajele utilizatorului */
.message.user .bubble a {
  text-decoration: none !important;
}

/* ---------- BUBBLE TOOLS (COPY BUTTON) ---------- */
.bubble-tools {
  position: absolute;
  bottom: 4px;
  right: 6px;
  display: flex;
  gap: 0.2rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.bubble:hover .bubble-tools {
  opacity: 1;
}
.copy-btn {
  border: none;
  background: transparent;
  color: var(--zomo-primary);
  cursor: pointer;
  font-size: 0.9rem;
}
.copy-btn:hover {
  opacity: 0.8;
}

/* ---------- INPUT BAR ---------- */
#zomo-input {
  display: flex;
  border-top: 1px solid var(--zomo-border);
  background: var(--zomo-bg-alt);
  padding: 0.5rem;
  align-items: center;
  gap: 0.4rem;
}
#zomo-text {
  flex: 1;
  border: 1px solid var(--zomo-border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: var(--zomo-bg);
  color: var(--zomo-text);
}
#zomo-text:focus {
  outline: none;
  border-color: var(--zomo-primary);
}
#zomo-send {
  background: var(--zomo-primary);
  border: none;
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
#zomo-send:hover {
  opacity: 0.9;
}

/* ---------- FOOTER ---------- */
#zomo-footer {
  font-size: 0.75rem;
  text-align: center;
  color: #888;
  background: var(--zomo-bg-alt);
  padding: 0.3rem 0.5rem;
  border-top: 1px solid var(--zomo-border);
}

/* ---------- TYPING ANIMATION ---------- */
.message.assistant.typing .bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #7b88a8;
}
.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.typing-label {
  opacity: 0.85;
  font-size: 13px;
}
.typing-dots {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}
.typing-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--zomo-primary);
  opacity: 0.35;
  animation: zomo-pulse 1.2s ease-in-out infinite;
}
.typing-dots .dot:nth-child(2) {
  animation-delay: 0.18s;
}
.typing-dots .dot:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes zomo-pulse {
  0% { transform: scale(0.65); opacity: 0.35; }
  45% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.65); opacity: 0.35; }
}

/* ---------- SCROLLBAR STYLING ---------- */
#zomo-messages::-webkit-scrollbar {
  width: 8px;
}
#zomo-messages::-webkit-scrollbar-thumb {
  background: var(--zomo-border);
  border-radius: 4px;
}
#zomo-messages::-webkit-scrollbar-thumb:hover {
  background: var(--zomo-primary);
}

/* Dimensiune font mesaje Zia și utilizator */
.message.assistant .bubble,
.message.user .bubble {
  font-size: 0.9rem;   /* ✅ 0.9 rem = ~14.4px */
  line-height: 1.5;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  #zomo-widget {
    width: 95%;
    right: 2.5%;
    bottom: 1rem;
    max-height: 85vh;
  }
}