/* Live chat widget. Uses the same custom properties as main.css (--evergreen, --wheat, etc.)
   — this file loads after main.css (see inc/class-chat-widget.php), so :root is already set. */

#foothills-chat-widget {
  position: fixed;
  z-index: 9999;
  right: 1.25rem;
  bottom: 1.25rem;
}

.foothills-chat__bubble {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--evergreen);
  color: var(--surface);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(42, 36, 28, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.foothills-chat__bubble:hover {
  background: var(--evergreen-deep);
  transform: scale(1.05);
}

.foothills-chat__bubble--hidden {
  display: none;
}

.foothills-chat__bubble-icon {
  line-height: 1;
}

.foothills-chat__panel {
  display: none;
  flex-direction: column;
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: min(22rem, calc(100vw - 2.5rem));
  height: min(32rem, calc(100vh - 2.5rem));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(42, 36, 28, 0.3);
  overflow: hidden;
  font-family: var(--font-body);
}

.foothills-chat__panel--open {
  display: flex;
}

.foothills-chat__header {
  background: var(--evergreen);
  color: var(--surface);
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.foothills-chat__close {
  background: none;
  border: none;
  color: var(--surface);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.foothills-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.foothills-chat__message {
  max-width: 85%;
  padding: 0.55rem 0.8rem;
  border-radius: 0.9rem;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.foothills-chat__message--assistant {
  align-self: flex-start;
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--ink);
  border-bottom-left-radius: 0.2rem;
}

.foothills-chat__message--user {
  align-self: flex-end;
  background: var(--wheat);
  color: var(--ink);
  border-bottom-right-radius: 0.2rem;
}

.foothills-chat__form {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 0.6rem;
  gap: 0.5rem;
}

.foothills-chat__input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
}

.foothills-chat__input:focus {
  outline: 2px solid var(--wheat-deep);
  outline-offset: 1px;
}

.foothills-chat__send {
  border: none;
  border-radius: var(--radius);
  background: var(--evergreen);
  color: var(--surface);
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
}

.foothills-chat__send:hover {
  background: var(--evergreen-deep);
}

.foothills-chat__send:disabled {
  opacity: 0.6;
  cursor: default;
}

.foothills-chat__ended {
  border-top: 1px solid var(--border);
  padding: 0.85rem 1rem;
  text-align: center;
}

.foothills-chat__ended p {
  margin: 0 0 0.6rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.foothills-chat__restart {
  border: 1px solid var(--evergreen);
  border-radius: var(--radius);
  background: transparent;
  color: var(--evergreen-deep);
  padding: 0.45rem 0.9rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
}

.foothills-chat__restart:hover {
  background: var(--evergreen);
  color: var(--surface);
}

@media (max-width: 480px) {
  .foothills-chat__panel {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
}
