/* Verdant — Plant Assistant Chat Widget Styles */

.plant-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 48px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 100px;
  background: var(--moss, #3d5c2e);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(45, 74, 34, 0.35);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.plant-chat-launcher:hover {
  background: #2e4622;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(45, 74, 34, 0.45);
}

.plant-chat-launcher:active {
  transform: scale(0.98);
}

.plant-chat-launcher:focus-visible {
  outline: 2px solid var(--moss, #3d5c2e);
  outline-offset: 3px;
}

.plant-chat-launcher-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.plant-chat-token-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 100px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Chat Drawer / Modal Container */
.plant-chat-drawer {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 200;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 110px);
  background: var(--surface, #ffffff);
  border: 1px solid var(--pale-sage, #c2d1ba);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(26, 31, 20, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpChat 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Header */
.plant-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--mist, #eef3eb);
  border-bottom: 1px solid var(--pale-sage, #c2d1ba);
  gap: 8px;
}

.plant-chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.plant-chat-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink, #1a1f14);
  margin: 0;
  line-height: 1.2;
}

.plant-chat-status {
  font-size: 0.72rem;
  color: var(--sage, #4a6b3b);
  font-weight: 500;
}

.plant-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.plant-chat-btn--clear {
  background: transparent;
  border: 1px solid var(--pale-sage, #c2d1ba);
  color: var(--ink, #1a1f14);
  border-radius: 100px;
  padding: 4px 10px;
  font-size: 0.72rem;
  min-height: 32px;
  cursor: pointer;
  transition: background 0.15s;
}

.plant-chat-btn--clear:hover {
  background: var(--surface, #ffffff);
}

.plant-chat-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--ink, #1a1f14);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plant-chat-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Context Banner */
.plant-chat-context {
  background: #e6f0e2;
  padding: 6px 16px;
  font-size: 0.75rem;
  color: var(--moss, #3d5c2e);
  border-bottom: 1px solid #d0e2c8;
}

/* Quick Chips */
.plant-chat-chips {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  background: var(--surface, #ffffff);
  border-bottom: 1px solid var(--mist, #eef3eb);
  scrollbar-width: thin;
}

.plant-chat-chip {
  background: var(--mist, #eef3eb);
  border: 1px solid var(--pale-sage, #c2d1ba);
  color: var(--moss, #3d5c2e);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 100px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.plant-chat-chip:hover {
  background: #dfead8;
  border-color: var(--moss, #3d5c2e);
}

/* Messages Area */
.plant-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--cream, #f8faf6);
}

.plant-chat-empty {
  font-size: 0.85rem;
  color: var(--sage, #4a6b3b);
  text-align: center;
  padding: 32px 16px;
  line-height: 1.5;
  margin: auto;
}

.plant-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  word-break: break-word;
}

.plant-chat-msg--user {
  align-self: flex-end;
  background: var(--moss, #3d5c2e);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.plant-chat-msg--bot {
  align-self: flex-start;
  background: var(--surface, #ffffff);
  color: var(--ink, #1a1f14);
  border: 1px solid var(--pale-sage, #c2d1ba);
  border-bottom-left-radius: 4px;
}

.plant-chat-msg-text {
  margin: 0;
}

.plant-chat-msg-bullets {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.plant-chat-msg-bullets li {
  margin: 0;
}

.plant-chat-msg-safety {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--rust, #b85c38);
  font-weight: 500;
}

.plant-chat-loading {
  font-size: 0.75rem;
  color: var(--sage, #4a6b3b);
  font-style: italic;
  padding: 0 16px 8px;
}

.plant-chat-feedback {
  margin: 0;
  padding: 6px 14px;
  font-size: 0.75rem;
  background: #fdf2ea;
  color: var(--rust, #b85c38);
}

/* Form */
.plant-chat-form {
  display: flex;
  padding: 10px 12px;
  background: var(--surface, #ffffff);
  border-top: 1px solid var(--pale-sage, #c2d1ba);
  gap: 8px;
  align-items: center;
}

.plant-chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--pale-sage, #c2d1ba);
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--ink, #1a1f14);
  background: var(--surface, #ffffff);
  min-height: 40px;
}

.plant-chat-input:focus-visible {
  outline: 2px solid var(--moss, #3d5c2e);
  outline-offset: 1px;
}

.plant-chat-btn--send {
  background: var(--moss, #3d5c2e);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  min-height: 40px;
  cursor: pointer;
  transition: background 0.15s;
}

.plant-chat-btn--send:hover {
  background: #2e4622;
}

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

/* Mobile Responsive Drawer (Bottom Sheet) */
@media (max-width: 600px) {
  .plant-chat-drawer {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 75vh;
    max-height: 75vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .plant-chat-drawer {
    animation: none;
  }
}
