/*
  This file contains the custom styles for the Earth Foundation theme.
  It's loaded after Tailwind, so it can override Tailwind's base styles.
*/

:root {
  --ef-dark-bg: #0a192f;
  /* Darkest bg from Project Guardian */
  --ef-mid-bg: #1e293b;
  /* Panel/card bg - Changed to dark slate */
  --ef-text-light: #f8fafc;
  /* Main text */
  --ef-text-mid: #94a3b8;
  /* Sub-text */
  --ef-text-faint: #475569;
  /* Faint text */
  --ef-accent: #22c55e;
  /* Bright green accent - Changed from cyan */
  --ef-border: #334155;
  /* Border color */
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--ef-dark-bg);
  color: var(--ef-text-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Replicating the "pg-btn" styles */
.ef-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  border: 2px solid transparent;
  cursor: pointer;
}

.ef-btn-primary {
  background-color: var(--ef-accent);
  color: var(--ef-dark-bg);
  border-color: var(--ef-accent);
}

.ef-btn-primary:hover {
  background-color: transparent;
  color: var(--ef-accent);
}

.ef-btn-outline {
  background-color: transparent;
  color: var(--ef-text-light);
  border-color: var(--ef-border);
}

.ef-btn-outline:hover {
  background-color: var(--ef-text-light);
  color: var(--ef-dark-bg);
  border-color: var(--ef-text-light);
}

/* Replicating the "pg-stat-value" styles */
.ef-stat-value {
  font-size: 3.5rem;
  /* 56px */
  font-weight: 900;
  color: var(--ef-accent);
  line-height: 1.1;
}

/* Utility wrapper for max-width and padding */
.section-wrapper {
  max-width: 80rem;
  /* 1280px */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  /* 24px */
  padding-right: 1.5rem;
  /* 24px */
}

/* Header visibility enhancement */
header {
  background-color: var(--ef-dark-bg) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}

/* ================================
   BEFORE/AFTER COMPARISON SLIDER
   ================================ */

.comparison-slider {
  --slider-pos: 50%;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

/* After image (bottom layer - pristine) */
.comparison-slider__after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Before image (top layer - polluted) with clip-path masking */
.comparison-slider__before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 0 0 var(--slider-pos));
  transition: clip-path 0.05s ease-out;
}

/* Images inside the layers */
.comparison-slider__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
}

/* Slider handle (vertical line with thumb) */
.comparison-slider__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--slider-pos);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 10;
  transition: left 0.05s ease-out;
}

.comparison-slider__handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
}

.comparison-slider__handle-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 64px;
  height: 64px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: var(--ef-dark-bg);
}

.comparison-slider__handle-thumb svg {
  width: 20px;
  height: 20px;
}

/* Range input (invisible but interactive) */
.comparison-slider__input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 20;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: auto;
}

.comparison-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 100vh;
  cursor: ew-resize;
  background: transparent;
}

.comparison-slider__input::-moz-range-thumb {
  width: 40px;
  height: 100vh;
  cursor: ew-resize;
  border: none;
  background: transparent;
}

.comparison-slider__input::-moz-range-track {
  background: transparent;
  border: none;
}

/* Labels (Before/After badges) */
.comparison-slider__label {
  position: absolute;
  top: 2rem;
  padding: 0.5rem 1rem;
  background: rgba(10, 25, 47, 0.8);
  backdrop-filter: blur(10px);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0.5rem;
  z-index: 5;
  pointer-events: none;
}

.comparison-slider__label--before {
  left: 2rem;
}

.comparison-slider__label--after {
  right: 2rem;
}

/* ================================
   HERO CONTENT OVERLAY
   ================================ */

.hero-content {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  max-width: 90%;
}

.hero-content__backdrop {
  position: absolute;
  inset: -1rem;
  background: rgba(10, 25, 47, 0.85);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border-radius: 1rem;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.hero-content__text {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 48rem;
}

.hero-content__headline {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-content__subhead {
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 1rem;
  font-weight: 400;
}

.hero-content__cta {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: rgba(34, 197, 94, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.hero-content__cta:hover {
  background: rgba(34, 197, 94, 1);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.5);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .comparison-slider__label {
    top: 1rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .comparison-slider__label--before {
    left: 1rem;
  }
  
  .comparison-slider__label--after {
    right: 1rem;
  }
  
  .comparison-slider__handle-thumb {
    width: 48px;
    height: 48px;
  }
  
  .comparison-slider__handle-thumb svg {
    width: 16px;
    height: 16px;
  }
  
  .hero-content {
    padding: 0.75rem;
    bottom: 2rem;
  }
  
  .hero-content__backdrop {
    inset: -0.75rem;
  }
  
  .hero-content__text {
    max-width: 100%;
  }
}

/* ================================
   SCROLL DOWN BUTTON
   ================================ */

.scroll-down-btn {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.95);
  border: 3px solid rgba(255, 255, 255, 0.4);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: bounce 2s infinite;
}

.scroll-down-btn:hover {
  background: rgba(34, 197, 94, 1);
  transform: translateX(-50%) translateY(-4px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.scroll-down-btn:active {
  transform: translateX(-50%) translateY(-2px);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Show on mobile only */
@media (max-width: 768px) {
  .scroll-down-btn {
    display: flex !important;
    position: fixed !important;
    bottom: 1rem !important;
    left: auto !important;
    right: 1rem !important;
    transform: none !important;
    z-index: 100 !important;
  }
}