/**
 * Zeo AI Agent - Floating Widget Styles
 * Brand: ZeoliteStone / CV. Riana Cuanderful Universal
 * Palette: Jade (#558B85), Dark (#0E1A18), Mint (#7EC4B8), Surface (#F4F9F8)
 */

:root {
  --zeo-color-primary: #558b85;
  --zeo-color-primary-hover: #44726d;
  --zeo-color-dark: #0e1a18;
  --zeo-color-dark-surface: #142825;
  --zeo-color-mint: #7ec4b8;
  --zeo-color-bg: #f8faf9;
  --zeo-color-card-border: #e2e8f0;
  --zeo-color-text: #1e293b;
  --zeo-color-muted: #64748b;
  --zeo-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Floating Launcher Button */
.zeo-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--zeo-color-dark);
  color: #ffffff;
  border: 1px solid rgba(126, 196, 184, 0.35);
  border-radius: 9999px;
  padding: 8px 16px 8px 10px;
  cursor: pointer;
  box-shadow: 0 10px 30px -5px rgba(14, 26, 24, 0.4), 0 0 0 1px rgba(85, 139, 133, 0.3);
  font-family: var(--zeo-font);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.zeo-launcher.zeo-position-left {
  right: auto;
  left: 24px;
}

.zeo-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 38px -4px rgba(14, 26, 24, 0.5), 0 0 0 2px var(--zeo-color-primary);
}

.zeo-launcher__avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #558b85, #356f68);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.zeo-launcher__avatar svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}

.zeo-launcher__dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid var(--zeo-color-dark);
  border-radius: 50%;
}

.zeo-launcher__info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.zeo-launcher__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.zeo-launcher__subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--zeo-color-mint);
  line-height: 1.2;
  margin-top: 2px;
}

/* Chat Window Container */
.zeo-widget-window {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 999998;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px -10px rgba(14, 26, 24, 0.35), 0 0 0 1px rgba(85, 139, 133, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--zeo-font);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.zeo-widget-window.zeo-position-left {
  right: auto;
  left: 24px;
}

.zeo-widget-window.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header */
.zeo-header {
  background: linear-gradient(135deg, #0e1a18 0%, #152b27 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(85, 139, 133, 0.3);
}

.zeo-header__profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zeo-header__avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #558b85, #356f68);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.zeo-header__avatar svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}

.zeo-header__dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: #10b981;
  border: 2px solid #0e1a18;
  border-radius: 50%;
}

.zeo-header__meta h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.zeo-header__badge {
  background: rgba(126, 196, 184, 0.2);
  color: var(--zeo-color-mint);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.zeo-header__meta p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #a3c9c4;
}

.zeo-header__close {
  background: transparent;
  border: none;
  color: #a3c9c4;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.zeo-header__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Chat Body / Messages Area */
.zeo-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  background: #f8faf9;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.zeo-body::-webkit-scrollbar {
  width: 6px;
}

.zeo-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Message Rows */
.zeo-message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  font-size: 13.5px;
  line-height: 1.55;
  animation: zeoFadeIn 0.25s ease forwards;
}

@keyframes zeoFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.zeo-message.is-user {
  align-self: flex-end;
}

.zeo-message.is-agent {
  align-self: flex-start;
}

.zeo-message__bubble {
  padding: 12px 16px;
  border-radius: 16px;
  word-break: break-word;
}

.zeo-message.is-user .zeo-message__bubble {
  background: var(--zeo-color-primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(85, 139, 133, 0.2);
}

.zeo-message.is-agent .zeo-message__bubble {
  background: #ffffff;
  color: var(--zeo-color-text);
  border: 1px solid var(--zeo-color-card-border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.zeo-message__bubble h3, 
.zeo-message__bubble h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--zeo-color-dark);
}

.zeo-message__bubble p {
  margin: 0 0 8px 0;
}

.zeo-message__bubble p:last-child {
  margin-bottom: 0;
}

.zeo-message__bubble ul, 
.zeo-message__bubble ol {
  margin: 4px 0 8px 0;
  padding-left: 18px;
}

.zeo-message__bubble li {
  margin-bottom: 4px;
}

.zeo-message__bubble strong {
  font-weight: 700;
  color: var(--zeo-color-dark);
}

.zeo-message.is-user .zeo-message__bubble strong {
  color: #ffffff;
}

.zeo-message__time {
  font-size: 10px;
  color: var(--zeo-color-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.zeo-message.is-user .zeo-message__time {
  text-align: right;
}

/* Quick Suggestion Chips */
.zeo-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.zeo-prompt-chip {
  background: #ffffff;
  color: #356f68;
  border: 1px solid #c9e6e0;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.zeo-prompt-chip:hover {
  background: #eaf5f2;
  border-color: var(--zeo-color-primary);
  transform: translateY(-1px);
}

/* Dynamic CTA Card Inside Chat */
.zeo-cta-card {
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid #dcebe8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(14, 26, 24, 0.06);
}

.zeo-cta-card__image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #f4f9f8;
}

.zeo-cta-card__content {
  padding: 12px 14px;
}

.zeo-cta-card__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--zeo-color-primary);
  background: #edf7f5;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.zeo-cta-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--zeo-color-dark);
  margin: 0 0 4px 0;
}

.zeo-cta-card__description {
  font-size: 12px;
  color: var(--zeo-color-muted);
  line-height: 1.45;
  margin: 0 0 10px 0;
}

.zeo-cta-card__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zeo-btn-cta-primary {
  display: block;
  text-align: center;
  background: var(--zeo-color-primary);
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.zeo-btn-cta-primary:hover {
  background: var(--zeo-color-primary-hover);
  color: #ffffff !important;
}

.zeo-btn-cta-secondary {
  display: block;
  text-align: center;
  background: #f4f9f8;
  color: var(--zeo-color-primary) !important;
  border: 1px solid #dcebe8;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.zeo-btn-cta-secondary:hover {
  background: #eaf5f2;
}

/* Typing Indicator */
.zeo-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--zeo-color-card-border);
  border-radius: 14px;
  align-self: flex-start;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.zeo-typing__dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: zeoPulse 1.2s infinite ease-in-out;
}

.zeo-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.zeo-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes zeoPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; background: var(--zeo-color-primary); }
}

/* Footer / Input Area */
.zeo-footer {
  background: #ffffff;
  padding: 12px 14px;
  border-top: 1px solid var(--zeo-color-card-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zeo-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zeo-input {
  flex: 1;
  background: #f8faf9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--zeo-color-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.zeo-input:focus {
  border-color: var(--zeo-color-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(85, 139, 133, 0.15);
}

.zeo-send-btn {
  background: var(--zeo-color-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.zeo-send-btn:hover {
  background: var(--zeo-color-primary-hover);
  transform: translateY(-1px);
}

.zeo-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zeo-send-btn svg {
  width: 17px;
  height: 17px;
  fill: #ffffff;
}

.zeo-watermark {
  font-size: 10.5px;
  color: #94a3b8;
  text-align: center;
  margin: 0;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .zeo-widget-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .zeo-launcher {
    bottom: 16px;
    right: 16px;
  }
}
