/* ==========================================================================
   PERTH LANDSCAPING - INTERACTIVE CONVERSION COMPONENTS
   Before/After Sliders, 3-Step Estimator, Live Lead Chat & Alerts
   ========================================================================== */

/* ==========================================================================
   1. BEFORE & AFTER INTERACTIVE SLIDER
   ========================================================================== */
.before-after-container {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.ba-showcase-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
}

.ba-slider-wrap {
  position: relative;
  width: 100%;
  min-height: 380px;
  max-height: 480px;
  overflow: hidden;
  user-select: none;
  background: #111;
}

.ba-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-after-img {
  z-index: 1;
}

.ba-before-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%; /* controlled by JS */
  height: 100%;
  overflow: hidden;
  z-index: 2;
  border-right: 3px solid #ffffff;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.ba-before-wrap .ba-image {
  width: 100%;
  min-width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 3px solid var(--accent);
  border-radius: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  cursor: ew-resize;
  pointer-events: auto;
}

.ba-label {
  position: absolute;
  top: 16px;
  z-index: 5;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: #fff;
}

.ba-label-before {
  left: 16px;
  background: rgba(180, 83, 9, 0.85);
}

.ba-label-after {
  right: 16px;
  background: rgba(22, 163, 74, 0.85);
}

.ba-drag-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  z-index: 8;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ba-info-panel {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fafaf8;
  border-left: 1px solid var(--gray-200);
}

.ba-project-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.ba-project-title {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.ba-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  background: #ffffff;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.ba-metric-item {
  display: flex;
  flex-direction: column;
}

.ba-metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--gray-600);
  font-weight: 600;
}

.ba-metric-val {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.ba-scope-desc {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 20px;
  line-height: 1.55;
}

.ba-quote-box {
  background: #ffffff;
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--dark-light);
  margin-bottom: 24px;
}

/* ==========================================================================
   2. 3-STEP INSTANT LANDSCAPE ESTIMATOR
   ========================================================================== */
.estimator-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  padding: 40px;
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

/* Step Progress Indicator */
.estimator-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 40px;
}

.stepper-line {
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 4px;
  background: var(--gray-200);
  z-index: 1;
}

.stepper-line-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.step-indicator {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-bubble {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--gray-200);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  transition: var(--transition);
}

.step-indicator.active .step-bubble {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 15px rgba(217, 119, 6, 0.4);
}

.step-indicator.completed .step-bubble {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.step-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step-indicator.active .step-label {
  color: var(--primary-dark);
}

/* Estimator Step Content Containers */
.estimator-step {
  display: none;
  animation: fadeIn 0.35s ease;
}

.estimator-step.active {
  display: block;
}

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

.step-heading {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.step-subheading {
  font-size: 0.95rem;
  color: var(--gray-600);
  margin-bottom: 28px;
}

/* Option Cards Selection Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.option-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #ffffff;
}

.option-card:hover {
  border-color: #8bbfa3;
  transform: translateY(-2px);
}

.option-card.selected {
  border-color: var(--accent);
  background: #fffdf9;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.15);
}

.option-icon {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.option-card.selected .option-icon {
  color: var(--accent);
}

.option-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.option-desc {
  font-size: 0.775rem;
  color: var(--gray-600);
}

/* Area Slider Component */
.range-slider-wrap {
  background: #fafaf8;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
}

.range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.range-value-display {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
}

/* Live Estimate Live Ticker */
.live-estimate-preview {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.estimate-label {
  font-size: 0.85rem;
  opacity: 0.85;
}

.estimate-price-range {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #fde68a;
}

.estimator-nav-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Step 3 Lead Confirmation Card */
.lead-ready-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #166534;
  font-size: 0.9rem;
}

/* ==========================================================================
   3. 24/7 AI LEAD CAPTURE CHAT ASSISTANT (LUXURY REDESIGN & SCROLL FIX)
   ========================================================================== */
.chat-widget-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: linear-gradient(135deg, #123724 0%, #1e5237 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(9, 31, 20, 0.4);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-widget-toggle:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 35px rgba(9, 31, 20, 0.5);
  background: linear-gradient(135deg, #18422c 0%, #123724 100%);
}

.chat-badge-pulse {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

/* Chat Modal Window */
.chat-modal-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(226, 232, 240, 0.9);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.chat-modal-window.open {
  display: flex;
  animation: chatSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Chat Header */
.chat-modal-header {
  background: linear-gradient(135deg, #091f14 0%, #123724 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent) 0%, #b45309 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-header-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.chat-header-status {
  font-size: 0.725rem;
  color: #86efac;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

/* Chat Messages Body - Scrollable */
.chat-messages-body {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding: 18px;
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
  box-sizing: border-box;
}

/* Scrollbar Styling */
.chat-messages-body::-webkit-scrollbar {
  width: 6px;
}

.chat-messages-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.chat-messages-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.chat-messages-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Chat Messages */
.chat-msg {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.bot {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-msg.user {
  background: linear-gradient(135deg, #123724 0%, #1e5237 100%);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(18, 55, 36, 0.2);
}

.chat-provider-tag {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 6px;
  text-align: right;
}

/* Interactive Chips */
.chat-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chat-chip-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #123724;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-chip-btn:hover {
  background: var(--primary-subtle);
  border-color: #123724;
  color: #123724;
  transform: translateY(-1px);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  width: fit-content;
  align-self: flex-start;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBlink 1.4s infinite both;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* In-Chat Instant Action Card */
.chat-action-card {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 8px;
  font-size: 0.85rem;
}

.chat-action-card h5 {
  color: #166534;
  font-size: 0.92rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Chat Input Footer */
.chat-input-footer {
  padding: 14px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chat-input-field {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
  background: #f8fafc;
}

.chat-input-field:focus {
  border-color: #123724;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 55, 36, 0.1);
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent) 0%, #b45309 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.3);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45);
}

/* ==========================================================================
   4. TOAST NOTIFICATIONS & FEEDBACK
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #ffffff;
  border-left: 4px solid var(--success);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  animation: slideInToast 0.3s ease;
}

.toast.toast-error {
  border-left-color: #ef4444;
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .ba-showcase-card {
    grid-template-columns: 1fr;
  }
  .options-grid {
    grid-template-columns: 1fr 1fr;
  }
  .estimator-card {
    padding: 24px 16px;
  }
  .chat-modal-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
  }
}
