/* ==========================================================================
   EcoSmartHomes Homeowner Help Menu & Explainer Guide ("What Am I Looking At?")
   Styles for Floating Trigger, Backdrop, Slide-Over Drawer, Tabs & Badges
   ========================================================================== */

:root {
  --esh-guide-bg: #00241b;
  --esh-guide-surface: #003326;
  --esh-guide-surface-card: #004231;
  --esh-guide-mint: #34f5c5;
  --esh-guide-emerald: #10b981;
  --esh-guide-amber: #f59e0b;
  --esh-guide-red: #ef4444;
  --esh-guide-text: #f8fafc;
  --esh-guide-muted: #94a3b8;
  --esh-guide-border: rgba(52, 245, 197, 0.2);
}

/* 1. Floating Help Trigger Pill (Merged into Guide & Tools drawer to prevent overlapping) */
#esh-help-floating-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#esh-help-floating-btn:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: #34f5c5;
  background: linear-gradient(135deg, #004d38 0%, #002e22 100%);
  box-shadow: 0 14px 35px rgba(0, 36, 27, 0.8), 0 0 26px rgba(52, 245, 197, 0.45);
}

.esh-guide-pulse-dot {
  width: 9px;
  height: 9px;
  background: #34f5c5;
  border-radius: 50%;
  box-shadow: 0 0 10px #34f5c5;
  animation: eshGuidePulse 2s infinite ease-in-out;
}

@keyframes eshGuidePulse {
  0% { transform: scale(0.85); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.8; }
}

/* 2. Contextual Explainer Badge (Placeable beside headers & cards) */
.esh-context-help-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(52, 245, 197, 0.12);
  border: 1px solid rgba(52, 245, 197, 0.35);
  color: #34f5c5;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
  margin-left: 8px;
  text-decoration: none;
  line-height: 1.2;
}

.esh-context-help-trigger:hover {
  background: rgba(52, 245, 197, 0.22);
  border-color: #34f5c5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 245, 197, 0.2);
}

/* 3. Backdrop Overlay */
#esh-help-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 15, 11, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000001 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#esh-help-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* 4. Slide-Over Drawer Container (Right-Hand Side) */
#esh-help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 100vw;
  background: #001f17;
  border-left: 1.5px solid rgba(52, 245, 197, 0.25);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.75);
  z-index: 10000002 !important;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--esh-guide-text);
  overflow: hidden;
}

#esh-help-drawer.open {
  transform: translateX(0);
}

/* Drawer Header */
.esh-help-header {
  padding: 20px 24px;
  background: #00281e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.esh-help-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.esh-help-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(52, 245, 197, 0.15);
  border: 1px solid rgba(52, 245, 197, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #34f5c5;
  flex-shrink: 0;
}

.esh-help-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.esh-help-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: 'IBM Plex Mono', monospace;
}

.esh-help-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.esh-help-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
  transform: rotate(90deg);
}

/* Quick Search Bar */
.esh-help-search-wrap {
  padding: 14px 20px 8px 20px;
  background: #001c15;
  flex-shrink: 0;
}

.esh-help-search-box {
  display: flex;
  align-items: center;
  background: #002a20;
  border: 1px solid rgba(52, 245, 197, 0.25);
  border-radius: 10px;
  padding: 9px 14px;
  gap: 10px;
  transition: border-color 0.2s;
}

.esh-help-search-box:focus-within {
  border-color: #34f5c5;
  box-shadow: 0 0 12px rgba(52, 245, 197, 0.2);
}

.esh-help-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.82rem;
  width: 100%;
  font-family: inherit;
}

.esh-help-search-box input::placeholder {
  color: #64748b;
}

/* Nav Pills / Tabs */
.esh-help-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 14px 20px;
  background: #001c15;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
  scrollbar-width: none;
}

.esh-help-tabs::-webkit-scrollbar {
  display: none;
}

.esh-help-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.esh-help-tab-btn:hover {
  background: rgba(52, 245, 197, 0.1);
  color: #34f5c5;
}

.esh-help-tab-btn.active {
  background: #34f5c5;
  color: #00241b;
  border-color: #34f5c5;
  box-shadow: 0 4px 12px rgba(52, 245, 197, 0.35);
}

/* Drawer Scrollable Body */
.esh-help-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
}

.esh-help-body::-webkit-scrollbar {
  width: 6px;
}
.esh-help-body::-webkit-scrollbar-thumb {
  background: rgba(52, 245, 197, 0.25);
  border-radius: 4px;
}

/* Tab Panels */
.esh-tab-panel {
  display: none;
}
.esh-tab-panel.active {
  display: block;
  animation: eshFadeIn 0.25s ease-out;
}

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

/* Card Styling in Body */
.esh-guide-card {
  background: #00291f;
  border: 1px solid rgba(52, 245, 197, 0.18);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.esh-guide-card:hover {
  border-color: rgba(52, 245, 197, 0.4);
}

.esh-guide-card.highlight {
  border-color: #34f5c5;
  background: #003628;
  box-shadow: 0 0 16px rgba(52, 245, 197, 0.15);
}

.esh-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.esh-card-badge {
  font-size: 0.68rem;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(52, 245, 197, 0.15);
  color: #34f5c5;
  border: 1px solid rgba(52, 245, 197, 0.3);
}

.esh-card-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.esh-card-p {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0 0 12px 0;
}

/* Metric Explainer Pill Grid */
.esh-metrics-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.esh-metric-item {
  background: rgba(0, 20, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.esh-metric-name {
  font-weight: 700;
  color: #34f5c5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.esh-metric-plain {
  color: #94a3b8;
  font-size: 0.77rem;
  line-height: 1.45;
}

.esh-homeowner-takeaway {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.78rem;
  color: #fbbf24;
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.esh-jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  background: rgba(52, 245, 197, 0.12);
  border: 1px solid #34f5c5;
  color: #34f5c5;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.esh-jump-btn:hover {
  background: #34f5c5;
  color: #00241b;
}

/* Jargon Buster List */
.esh-jargon-entry {
  background: #00271d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.esh-jargon-entry:hover {
  border-color: rgba(52, 245, 197, 0.35);
  background: #002e23;
}

.esh-jargon-term {
  font-weight: 800;
  color: #ffffff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.esh-jargon-analogy {
  font-size: 0.77rem;
  color: #34f5c5;
  background: rgba(52, 245, 197, 0.08);
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 6px;
  font-style: italic;
}

/* Interactive Triage Stepper */
.esh-triage-step-box {
  background: #00291f;
  border: 1px solid rgba(52, 245, 197, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.esh-triage-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.esh-triage-opt-btn {
  background: #001f17;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.esh-triage-opt-btn:hover {
  border-color: #34f5c5;
  color: #34f5c5;
}

.esh-triage-opt-btn.selected {
  background: rgba(52, 245, 197, 0.18);
  border-color: #34f5c5;
  color: #34f5c5;
  box-shadow: 0 0 10px rgba(52, 245, 197, 0.2);
}

.esh-triage-result {
  background: #003628;
  border: 1.5px solid #10b981;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  display: none;
}

.esh-triage-result.active {
  display: block;
  animation: eshFadeIn 0.3s ease;
}

/* Traps List */
.esh-trap-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.esh-trap-card h4 {
  color: #f87171;
  font-size: 0.88rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.esh-trap-card p {
  font-size: 0.78rem;
  color: #e2e8f0;
  line-height: 1.45;
  margin: 0;
}

/* Voice Quick Actions */
.esh-aoife-prompt-chip {
  background: rgba(52, 245, 197, 0.1);
  border: 1px solid rgba(52, 245, 197, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
}

.esh-aoife-prompt-chip:hover {
  background: rgba(52, 245, 197, 0.2);
  border-color: #34f5c5;
  transform: translateX(4px);
}

/* ==========================================================================
   💼 ESTATE AGENT THEME & COMPONENT EXTENSIONS
   ========================================================================== */

/* Role Switcher in Drawer Header */
.esh-guide-role-switch {
  display: inline-flex;
  background: rgba(0, 15, 11, 0.65);
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 6px;
  gap: 4px;
}

.esh-role-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.esh-role-btn:hover {
  color: #ffffff;
}

.esh-role-btn.active {
  background: #34f5c5;
  color: #00241b;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(52, 245, 197, 0.35);
}

/* Agent Theme Overrides */
#esh-help-drawer.esh-theme-agent {
  border-left: 1.5px solid rgba(245, 158, 11, 0.35);
}

.esh-theme-agent .esh-help-icon-box {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.esh-theme-agent .esh-role-btn.active {
  background: #f59e0b;
  color: #001711;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.esh-theme-agent .esh-help-search-box:focus-within {
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.esh-theme-agent .esh-help-tab-btn:hover {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.esh-theme-agent .esh-help-tab-btn.active {
  background: #f59e0b;
  color: #001711;
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.esh-theme-agent .esh-card-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.esh-theme-agent .esh-guide-card.highlight {
  border-color: #f59e0b;
  background: #002d20;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.18);
}

.esh-theme-agent .esh-metric-name {
  color: #fbbf24;
}

.esh-theme-agent .esh-jump-btn {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
  color: #fbbf24;
}

.esh-theme-agent .esh-jump-btn:hover {
  background: #f59e0b;
  color: #001711;
}

.esh-theme-agent .esh-jargon-analogy {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
}

/* Agent Rebuttal Cards & WhatsApp Scripts */
.esh-rebuttal-card {
  background: #00271d;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.esh-rebuttal-target {
  font-size: 0.78rem;
  font-weight: 800;
  color: #f87171;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.esh-rebuttal-script {
  background: rgba(0, 15, 11, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.55;
  margin-bottom: 10px;
  white-space: pre-line;
}

.esh-rebuttal-copy-btn {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.esh-rebuttal-copy-btn:hover {
  background: #f59e0b;
  color: #001711;
  transform: translateY(-1px);
}

/* Kitchen Table Pitch Card */
.esh-pitch-step {
  background: rgba(0, 20, 15, 0.6);
  border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.esh-pitch-step-title {
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.esh-pitch-step-body {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Mobile Responsive Adaptation */
@media (max-width: 768px) {
  #esh-help-floating-btn {
    bottom: 20px;
    right: 16px;
    padding: 9px 15px;
    font-size: 0.8rem;
  }
  
  #esh-help-drawer {
    width: 100vw;
    height: 85vh;
    top: auto;
    bottom: 0;
    border-left: none;
    border-top: 2.5px solid #34f5c5;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  #esh-help-drawer.esh-theme-agent {
    border-top-color: #f59e0b;
  }

  #esh-help-drawer.open {
    transform: translateY(0);
  }

  .esh-help-header {
    padding: 14px 16px;
    gap: 10px;
  }

  .esh-help-icon-box {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    border-radius: 10px;
  }

  .esh-help-title {
    font-size: 0.98rem;
  }

  .esh-help-subtitle {
    font-size: 0.68rem;
  }

  .esh-guide-role-switch {
    margin-top: 6px;
  }

  .esh-role-btn {
    padding: 4px 10px;
    font-size: 0.68rem;
  }

  .esh-help-search-wrap {
    padding: 10px 16px 6px 16px;
  }

  .esh-help-tabs {
    padding: 8px 16px 12px 16px;
  }

  .esh-help-body {
    padding: 16px;
  }

  .esh-triage-options {
    grid-template-columns: 1fr;
  }
}
