/* Alobera Chatbot Widget — scoped, no global leakage */
:root {
  --alobera-primary: #1a3d2e;       /* deep forest green */
  --alobera-accent: #c9a35e;        /* warm wood gold */
  --alobera-bg: #ffffff;
  --alobera-text: #1a1a1a;
  --alobera-muted: #6b7280;
  --alobera-border: #e5e7eb;
  --alobera-user-bg: #1a3d2e;
  --alobera-user-text: #ffffff;
  --alobera-assistant-bg: #f5f1ea;
  --alobera-assistant-text: #1a1a1a;
  --alobera-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

#alobera-chat-root,
#alobera-chat-root * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#alobera-chat-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999999;
}

.alobera-launcher {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--alobera-primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--alobera-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease;
}

.alobera-launcher:hover {
  transform: scale(1.05);
  background: #25553f;
}

.alobera-launcher svg {
  width: 28px;
  height: 28px;
}

.alobera-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: var(--alobera-bg);
  border-radius: 16px;
  box-shadow: var(--alobera-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--alobera-border);
}

.alobera-panel.open {
  display: flex;
  animation: alobera-slide-in 0.2s ease;
}

@keyframes alobera-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alobera-header {
  background: var(--alobera-primary);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alobera-header-text {
  flex: 1;
  min-width: 0;
}

.alobera-header-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.alobera-header-subtitle {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}

.alobera-lang-select {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}

.alobera-lang-select option {
  color: var(--alobera-text);
  background: var(--alobera-bg);
}

.alobera-close,
.alobera-clear {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.85;
}

.alobera-close { font-size: 20px; }
.alobera-clear {
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 3px 7px;
}

.alobera-close:hover,
.alobera-clear:hover { opacity: 1; }

.alobera-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #fafaf7;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alobera-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.alobera-msg.user {
  align-self: flex-end;
  background: var(--alobera-user-bg);
  color: var(--alobera-user-text);
  border-bottom-right-radius: 4px;
}

.alobera-msg.assistant {
  align-self: flex-start;
  background: var(--alobera-assistant-bg);
  color: var(--alobera-assistant-text);
  border-bottom-left-radius: 4px;
}

.alobera-msg.error {
  align-self: center;
  background: #fee2e2;
  color: #991b1b;
  font-size: 12px;
  padding: 6px 10px;
}

.alobera-typing {
  align-self: flex-start;
  color: var(--alobera-muted);
  font-size: 13px;
  font-style: italic;
  padding: 4px 6px;
}

.alobera-input-row {
  border-top: 1px solid var(--alobera-border);
  padding: 10px;
  display: flex;
  gap: 8px;
  background: white;
}

.alobera-input {
  flex: 1;
  border: 1px solid var(--alobera-border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 100px;
  font-family: inherit;
}

.alobera-input:focus {
  border-color: var(--alobera-primary);
}

.alobera-send {
  background: var(--alobera-primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.alobera-send:hover { background: #25553f; }
.alobera-send:disabled { opacity: 0.5; cursor: not-allowed; }

.alobera-disclaimer {
  font-size: 10px;
  color: var(--alobera-muted);
  text-align: center;
  padding: 6px 10px;
  background: white;
  border-top: 1px solid var(--alobera-border);
  line-height: 1.3;
}
