/* Pour AI widget styles */
/* Design tokens from docs/BUILD_FOUNDATION.md */

:root {
  --wine-deep:   #3D0F12;
  --wine-warm:   #7A2A30;
  --cream:       #F5EFE6;
  --cream-soft:  #FBF8F3;
  --bone:        #FAF7F1;
  --charcoal:    #1F1F1D;
  --muted:       #6B6863;
  --hint:        #A8A59E;
  --border:      #D5D1C7;
  --border-soft: #E8E3D8;
}

/* ----------------------------------------------------------------
   Wrapper
   ---------------------------------------------------------------- */

.pour-ai-widget {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--charcoal);
  background: var(--cream-soft);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ----------------------------------------------------------------
   Header
   ---------------------------------------------------------------- */

.pour-ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px 12px;
  border-bottom: 0.5px solid var(--border-soft);
}

.pour-ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wine-deep);
  flex-shrink: 0;
}

.pour-ai-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----------------------------------------------------------------
   Message list
   ---------------------------------------------------------------- */

.pour-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 420px;
  scroll-behavior: smooth;
}

/* ----------------------------------------------------------------
   Empty state (suggested prompts)
   ---------------------------------------------------------------- */

.pour-ai-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}

.pour-ai-empty-heading {
  font-size: 17px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 4px;
}

.pour-ai-empty-heading em {
  color: var(--wine-warm);
  font-style: italic;
}

.pour-ai-prompt-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: white;
  border: 0.5px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--charcoal);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.4;
}

.pour-ai-prompt-btn:hover {
  border-color: var(--wine-warm);
  background: var(--bone);
}

/* ----------------------------------------------------------------
   Chat bubbles
   ---------------------------------------------------------------- */

.pour-ai-bubble {
  max-width: 82%;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.pour-ai-bubble.user {
  align-self: flex-end;
  background: var(--wine-deep);
  color: var(--cream);
  border-radius: 14px 14px 4px 14px;
}

.pour-ai-bubble.assistant {
  align-self: flex-start;
  background: white;
  color: var(--charcoal);
  border: 0.5px solid var(--border-soft);
  border-radius: 14px 14px 14px 4px;
}

/* Streaming cursor */
.pour-ai-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: var(--charcoal);
  margin-left: 2px;
  vertical-align: middle;
  animation: pour-ai-blink 0.9s step-end infinite;
}

@keyframes pour-ai-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.pour-ai-bubble.error {
  align-self: flex-start;
  background: #fff3f3;
  border-color: #f5c6c6;
  color: #8b2020;
  border-radius: 14px 14px 14px 4px;
}

/* ----------------------------------------------------------------
   Footer bar: counter + responsible drinking line
   ---------------------------------------------------------------- */

.pour-ai-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px 4px;
  border-top: 0.5px solid var(--border-soft);
}

.pour-ai-counter {
  font-size: 11px;
  color: var(--hint);
}

.pour-ai-responsible {
  font-size: 11px;
  color: var(--wine-warm);
  font-weight: 500;
}

/* ----------------------------------------------------------------
   Composer
   ---------------------------------------------------------------- */

.pour-ai-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
  background: var(--cream-soft);
  border-top: 0.5px solid var(--border-soft);
  border-radius: 0 0 16px 16px;
}

/* The bordered "text window" the question is typed into. */
.pour-ai-input-shell {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 6px 8px 6px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pour-ai-input-shell:focus-within {
  border-color: var(--wine-warm);
  box-shadow: 0 0 0 3px rgba(122, 42, 48, 0.10);
}

/* Shared icon buttons (camera + mic) */
.pour-ai-icon-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  transition: color 0.15s, background 0.15s;
}

.pour-ai-icon-btn:hover {
  color: var(--wine-deep);
  background: var(--bone);
}

/* Mic listening state: pulse while capturing speech. */
.pour-ai-mic-btn.listening {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.10);
  animation: pour-ai-pulse 1.2s ease-in-out infinite;
}

@keyframes pour-ai-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

.pour-ai-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--charcoal);
  background: transparent;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  padding: 7px 2px;
  line-height: 1.4;
  font-family: inherit;
}

.pour-ai-input::placeholder {
  color: var(--hint);
}

.pour-ai-send-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--wine-deep);
  color: var(--cream);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.pour-ai-send-btn:hover  { background: var(--wine-warm); }
.pour-ai-send-btn:disabled { opacity: 0.45; cursor: default; }

/* Helper line under the input. */
.pour-ai-composer-hint {
  font-size: 11px;
  color: var(--hint);
  padding: 0 4px;
}

/* Hidden file input for image upload */
.pour-ai-file-input {
  display: none;
}

/* ----------------------------------------------------------------
   Soft cap state (waitlist capture)
   ---------------------------------------------------------------- */

.pour-ai-soft-cap {
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pour-ai-soft-cap-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pour-ai-soft-cap-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.25;
}

.pour-ai-soft-cap-heading em {
  color: var(--wine-warm);
  font-style: italic;
}

.pour-ai-soft-cap-sub {
  font-size: 14px;
  color: var(--muted);
}

.pour-ai-waitlist-form {
  display: flex;
  gap: 8px;
}

.pour-ai-waitlist-input {
  flex: 1;
  padding: 10px 14px;
  border: 0.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  color: var(--charcoal);
  background: white;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.pour-ai-waitlist-input:focus {
  border-color: var(--wine-warm);
}

.pour-ai-waitlist-input::placeholder {
  color: var(--hint);
}

.pour-ai-waitlist-btn {
  padding: 10px 20px;
  background: var(--wine-deep);
  color: var(--cream);
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  font-family: inherit;
}

.pour-ai-waitlist-btn:hover { background: var(--wine-warm); }

.pour-ai-waitlist-success {
  font-size: 14px;
  color: var(--wine-warm);
  font-weight: 500;
}

/* ----------------------------------------------------------------
   Age gate modal
   ---------------------------------------------------------------- */

.pour-ai-age-gate {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 29, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
}

.pour-ai-age-gate-card {
  background: var(--cream-soft);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.pour-ai-age-gate-icon {
  font-size: 36px;
  line-height: 1;
}

.pour-ai-age-gate-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--charcoal);
}

.pour-ai-age-gate-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.pour-ai-age-gate-confirm {
  background: var(--wine-deep);
  color: var(--cream);
  border: none;
  border-radius: 24px;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.pour-ai-age-gate-confirm:hover { background: var(--wine-warm); }

.pour-ai-age-gate-decline {
  font-size: 13px;
  color: var(--hint);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ----------------------------------------------------------------
   Image preview (before send)
   ---------------------------------------------------------------- */

.pour-ai-image-preview {
  position: relative;
  align-self: flex-end;
  max-width: 180px;
}

.pour-ai-image-preview img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.pour-ai-image-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--charcoal);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ----------------------------------------------------------------
   Mobile
   ---------------------------------------------------------------- */

@media (max-width: 480px) {
  .pour-ai-widget {
    border-radius: 12px;
  }

  .pour-ai-bubble {
    max-width: 90%;
  }

  .pour-ai-prompt-btn {
    font-size: 13px;
    padding: 11px 12px;
  }

  .pour-ai-waitlist-form {
    flex-direction: column;
  }

  .pour-ai-waitlist-btn {
    width: 100%;
    text-align: center;
  }

  .pour-ai-messages {
    max-height: 320px;
  }
}

/* ----------------------------------------------------------------
   State selector (shipping check)
   ---------------------------------------------------------------- */
.pour-ai-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--hint);
}

.pour-ai-state-select {
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 0.5px solid var(--border-soft);
  border-radius: 6px;
  padding: 1px 4px;
  cursor: pointer;
}

/* ----------------------------------------------------------------
   Partner buy-cards (wine.com via Rakuten) + paid-link disclosure
   ---------------------------------------------------------------- */
.pour-ai-partners {
  margin: 2px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Disclosure sits ABOVE the cards, always visible (FTC clear + conspicuous). */
.pour-ai-disclosure {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  background: var(--bone);
  border: 0.5px solid var(--border-soft);
  border-radius: 8px;
  padding: 6px 10px;
}

.pour-ai-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--charcoal);
  background: #fff;
  border: 0.5px solid var(--border-soft);
  border-radius: 10px;
  padding: 8px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pour-ai-card:hover {
  border-color: var(--wine-warm);
  box-shadow: 0 1px 6px rgba(61, 15, 18, 0.08);
}

.pour-ai-card-img {
  width: 34px;
  height: 46px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.pour-ai-card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bone);
}

.pour-ai-card-body {
  flex: 1;
  min-width: 0;
}

.pour-ai-card-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.pour-ai-card-facts {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pour-ai-card-meta {
  font-size: 12px;
  margin-top: 3px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.pour-ai-card-price { font-weight: 600; color: var(--wine-deep); }
.pour-ai-card-price s { color: var(--hint); font-weight: 400; }
.pour-ai-card-rating { color: var(--muted); font-size: 11px; }

.pour-ai-card-cta {
  flex-shrink: 0;
  background: var(--wine-deep);
  color: var(--cream);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 16px;
}

.pour-ai-card:hover .pour-ai-card-cta { background: var(--wine-warm); }

.pour-ai-ship-note {
  font-size: 11px;
  line-height: 1.4;
  color: var(--wine-warm);
  padding: 2px 2px;
}
