/* ==============================================================================
   Aarlika AI Brewing Copilot & Omnibar Styles
   Theme: Warm Cream (#FFFDF9), Forest Green (#2D6A4F), Mango Orange (#D9770B)
   ============================================================================== */

/* Embedded Omnibar Command Deck */
.ai-omnibar-deck {
  margin: 0 0 28px 0;
  text-align: left;
}

.ai-omnibar-box {
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  padding: 6px 8px 6px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-omnibar-box:focus-within {
  border-color: #D9770B;
  box-shadow: 0 0 0 3px rgba(217, 119, 11, 0.15);
}

.ai-omnibar-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 4px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #1F2937;
  background: transparent;
}

.ai-omnibar-box input::placeholder {
  color: #9CA3AF;
}

.ai-omnibar-box button {
  background: #D9770B;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-omnibar-box button:hover {
  background: #B45309;
}

.ai-omnibar-box button:active {
  transform: scale(0.98);
}

/* Prompt Chips */
.omnibar-chips-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.omnibar-chip {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  color: #374151;
  transition: all 0.15s;
  background-color: #FFFDF9;
}

.omnibar-chip:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
  transform: translateY(-1px);
}

/* Floating Brewmaster Copilot Trigger */
#ai-copilot-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  background: #1F2937;
  color: #FFFDF9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 20px 10px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.28), 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

#ai-copilot-trigger .ai-trigger-pulse {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #F59E0B;
  border: 2px solid #FFFDF9;
}

#ai-copilot-trigger .ai-trigger-pulse::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: #F59E0B;
  animation: aiTriggerPulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes aiTriggerPulse {
  0% { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #ai-copilot-trigger .ai-trigger-pulse::after { animation: none; }
}

#ai-copilot-trigger:hover {
  background: #111827;
  border-color: rgba(217, 119, 11, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.38), 0 4px 10px rgba(0, 0, 0, 0.1);
}

@keyframes floatBadgeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-trigger-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.copilot-header-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hero-ai-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/* Slide-Out Chat Drawer */
/* Prevent background scrolling when chat drawer is open */
body.drawer-open {
  overflow: hidden;
  touch-action: none;
}

#ai-copilot-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 95vw;
  height: 100vh;
  background: #FFFDF9;
  border-left: 1px solid #E5E7EB;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  overscroll-behavior: contain;
}

#ai-copilot-drawer.open {
  transform: translateX(0);
}

/* Dark backdrop behind the drawer; the page keeps its scroll position underneath */
#ai-copilot-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9995;
  background: rgba(17, 24, 39, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

body.drawer-open #ai-copilot-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Phones: icon-only trigger so it covers less content (label stays for screen readers) */
@media (max-width: 640px) {
  #ai-copilot-trigger {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    font-size: 1.35rem;
  }
  #ai-copilot-trigger .ai-trigger-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

body.drawer-open #ai-copilot-trigger {
  opacity: 0;
  pointer-events: none;
}

/* Section-aware quick prompts at the top of the drawer */
.copilot-context-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #FFF7EB;
  border-bottom: 1px solid #F3E8D2;
}

.copilot-context-chips:empty {
  display: none;
}

.copilot-context-chips .omnibar-chip {
  font-size: 0.78rem;
  padding: 5px 10px;
}

@media (prefers-reduced-motion: reduce) {
  #ai-copilot-drawer,
  #ai-copilot-backdrop {
    transition: none;
  }
}

.copilot-drawer-header {
  padding: 16px 18px;
  background: #1F2937;
  color: #FFFDF9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.copilot-drawer-header h3 {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  color: #FFFDF9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copilot-header-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFDF9;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.copilot-header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.copilot-drawer-close {
  background: transparent;
  border: none;
  color: #9CA3AF;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s ease;
}

.copilot-drawer-close:hover {
  color: #FFFDF9;
}

/* Chat Messages Stream Area */
.copilot-messages-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.copilot-message {
  max-width: 88%;
  font-size: 0.88rem;
  line-height: 1.55;
  border-radius: 12px;
  padding: 12px 16px;
  word-break: break-word;
}

.copilot-message.user {
  align-self: flex-end;
  background: #1F2937;
  color: #FFFDF9;
  border-bottom-right-radius: 2px;
}

.copilot-message.assistant {
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  color: #1F2937;
  border-bottom-left-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.copilot-message.assistant strong {
  color: #111827;
}

.copilot-message.assistant p {
  margin: 0 0 8px 0;
}

.copilot-message.assistant p:last-child {
  margin-bottom: 0;
}

.copilot-message.assistant .copilot-bullet {
  margin: 6px 0;
  line-height: 1.55;
}

.copilot-message.assistant h4.copilot-message-heading {
  margin: 10px 0 6px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.copilot-message.assistant h4.copilot-message-heading:first-child {
  margin-top: 0;
}

/* Taproom Profit Card */
.profit-roi-card {
  background: #FFFDF9;
  border: 1.5px solid #D9770B;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 0.82rem;
}

.profit-roi-card h4 {
  margin: 0 0 6px 0;
  color: #B45309;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Drawer Input Area */
.copilot-drawer-input-area {
  padding: 14px 18px;
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
  position: relative;
}

.copilot-disclaimer {
  margin: 8px 0 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: #6B7280;
}

.copilot-disclaimer-inline {
  margin-top: 6px;
  font-size: 0.72rem;
}

#copilot-turnstile-widget {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.copilot-input-form {
  display: flex;
  gap: 8px;
}

.copilot-input-form input {
  flex: 1;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
}

.copilot-input-form input:focus {
  border-color: #1F2937;
}

.copilot-input-form button {
  background: #1F2937;
  color: #FFFDF9;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.copilot-input-form button:hover {
  background: #111827;
}

/* Typing Indicator Animation */
.typing-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #9CA3AF;
  margin: 0 1px;
  animation: typingBounce 1s infinite alternate;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

@media (max-width: 480px) {
  #ai-copilot-drawer {
    width: 100vw;
  }
}

/* ==============================================================================
   Brewmaster AI — Hero Assistant & 5 Brewery Tools
   ============================================================================== */
.hero-ai-search-box {
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 16px;
  padding: 20px 22px;
  margin-top: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  text-align: left;
}

.hero-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.hero-ai-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1F2937;
}

.hero-ai-live-badge {
  background: #FEF3C7;
  color: #92400E;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-ai-sub {
  font-size: 0.88rem;
  color: #6B7280;
  line-height: 1.45;
  margin: 0 0 14px 0;
}

/* 5 Prioritized Brewery Tools Nav */
.hero-ai-tools-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hero-ai-tool-pill {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.hero-ai-tool-pill:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
  transform: translateY(-1px);
}

.hero-ai-tool-pill.core-tool {
  border-color: #FDE68A;
  background: #FFFDF9;
}

.hero-ai-tool-pill .tool-core-tag {
  background: #FEF3C7;
  color: #92400E;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Free-form Input Form */
.hero-ai-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F9FAFB;
  border: 1.5px solid #D1D5DB;
  border-radius: 12px;
  padding: 6px 8px 6px 14px;
  transition: all 0.2s ease;
}

.hero-ai-form:focus-within {
  background: #FFFFFF;
  border-color: #1F2937;
  box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.12);
}

.hero-ai-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  color: #1F2937;
  outline: none;
  padding: 4px 0;
  min-width: 140px;
}

.hero-ai-input::placeholder {
  color: #9CA3AF;
}

.hero-ai-btn {
  background: #1F2937 !important;
  color: #FFFDF9 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.hero-ai-btn:hover {
  background: #111827 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.28);
}

/* Brewer Prompt Example Chips */
.hero-ai-chips-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
  margin-top: 10px;
  margin-bottom: 6px;
}

/* Epistemic Trust Legend */
.hero-ai-trust-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #F3F4F6;
  font-size: 0.74rem;
  color: #6B7280;
}

.hero-ai-trust-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Epistemic Badges & Callouts in Chat */
.copilot-message-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1F2937;
  margin: 4px 0 10px 0;
}

.epistemic-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  margin: 10px 0 6px 0;
  font-size: 0.75rem;
}

.epistemic-callout.epistemic-calculated {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.epistemic-callout.epistemic-evidence {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.epistemic-callout.epistemic-advisory {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #0369A1;
}

.epistemic-badge {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.epistemic-badge-sub {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Assistant Message Next-Step Footer Strip */
.copilot-assistant-footer-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #F3F4F6;
}

.copilot-nextstep-btn {
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.copilot-nextstep-btn:hover {
  background: #F3F4F6;
  border-color: #9CA3AF;
  color: #111827;
  transform: translateY(-1px);
}

.copilot-nextstep-btn.btn-sample {
  border-color: #10B981;
  color: #065F46;
  background: #ECFDF5;
}

.copilot-nextstep-btn.btn-sample:hover {
  background: #D1FAE5;
}

.copilot-nextstep-btn.btn-bulk {
  border-color: #F59E0B;
  color: #92400E;
  background: #FFFDF9;
}

.copilot-nextstep-btn.btn-bulk:hover {
  background: #FEF3C7;
}

.copilot-nextstep-btn.btn-calc {
  border-color: #E5E7EB;
  color: #4B5563;
}

/* Interactive Quick Response Chips in Chat Flow */
.copilot-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  padding-top: 8px;
}

.copilot-chip-btn {
  background: #FFFFFF;
  border: 1.5px solid #D1D5DB;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1F2937;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.copilot-chip-btn:hover {
  background: #FEF3C7;
  border-color: #D9770B;
  color: #92400E;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(217, 119, 11, 0.15);
}

.copilot-chip-btn:active {
  transform: translateY(0);
}

/* Mobile Responsive Optimization (<= 640px) */
@media (max-width: 640px) {
  .hero-ai-form {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .hero-ai-input {
    min-width: 0;
    width: 100%;
    padding: 6px 2px;
  }

  .hero-ai-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  #ai-copilot-trigger {
    bottom: 16px;
    right: 16px;
    padding: 8px 14px 8px 10px;
    font-size: 0.82rem;
  }

  #ai-copilot-drawer {
    width: 100vw;
    max-width: 100vw;
    border-left: none;
  }

  .copilot-drawer-header {
    padding: 12px 14px;
  }

  .copilot-drawer-header h3 {
    font-size: 1rem;
  }

  .copilot-bulk-header-banner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }

  .copilot-message {
    max-width: 92%;
  }
}


