/* =========================================================
   styles.css - EcoBali Refreshed Blue-Green Theme (Enhanced)
   ========================================================= */

:root {
  --green-1: #16a34a; /* vivid green */
  --green-2: #059669; /* accent green */
  --green-3: #34d399; /* light green */
  --muted: #35635a;
  --card: #ffffff;
  --glass: rgba(255, 255, 255, 0.7);
  --max-width: 1200px;
  --gap: 1rem;
  --bg: linear-gradient(135deg, #eefaf0 0%, #f4fbf6 45%, #f8fff9 100%);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* =========================================================
   HEADER AREA
   ========================================================= */

.site-header {
  margin-left: -8px;
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.55));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(3, 14, 15, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
}

/* Logo area */
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
  transform: translateX(-10px); /* 👈 geser lebih ke kiri */
}

.logo-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  box-shadow: none;
  border: 0;
  background: transparent;
  padding: 0;
}

.site-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
}

.logo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
  pointer-events: none;
  font-size: 0.85rem;
}

.logo-input {
  display: none;
}

.logo-upload-btn {
  position: absolute;
  right: -4px;
  top: -8px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(3, 17, 18, 0.06);
  font-size: 0.8rem;
  color: var(--green-1);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(3, 17, 18, 0.06);
}
.logo-upload-btn:hover {
  transform: translateY(-2px);
}

.title-wrap {
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 1.15rem;
  margin: 0;
}
.logo .accent {
  color: var(--green-1);
}
.tagline {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Navigation */
.main-nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.main-nav a {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  transition: all 180ms ease;
}
.main-nav a:hover {
  background: rgba(5, 150, 105, 0.08);
  color: var(--green-2);
}
#mobile-toggle {
  display: none;
  background: transparent;
  border: 0;
  font-size: 1.2rem;
  padding: 0.45rem;
  border-radius: 8px;
}

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero {
  padding: 2.25rem 0;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr min(480px, 40%);
  gap: 2rem;
  align-items: center;
}
.hero-text h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  color: var(--green-2);
}
.hero-text p {
  color: var(--muted);
  margin: 0;
}
.hero-cta {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
}
.btn {
  display: inline-block;
  background: var(--green-2);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 8px 30px rgba(5, 150, 105, 0.12);
}
.btn.ghost {
  background: transparent;
  color: var(--green-2);
  border: 2px solid rgba(3, 17, 18, 0.06);
}

/* =========================================================
   MAP + FULLSCREEN FIX
   ========================================================= */

.map-wrap {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
}

:fullscreen .map-wrap,
.map-wrap:fullscreen,
.map-wrap:-webkit-full-screen,
.map-wrap:-moz-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  margin: 0;
  padding: 0;
  border-radius: 0;
  z-index: 9999;
  background: #fff;
}

.map-wrap:fullscreen #mapid,
:fullscreen #mapid {
  width: 100%;
  height: 100%;
}

/* Map Panel & Controls */
#map-stats {
  position: relative;
  margin-top: 10px;
  margin-bottom: 0.8rem;
  z-index: 500;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#toggle-fullscreen {
  display: inline-block;
  margin-bottom: 0.6rem;
  z-index: 1200;
  position: relative;
}

.map-toolbar {
  position: relative;
  z-index: 400;
  margin-top: 0.8rem;
}

.map-legend {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 8px 10px;
  display: inline-block;
}

#mapid {
  width: 100%;
  height: 500px;
  border-radius: 10px;
}

:fullscreen .map-wrap,
.map-wrap:fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
:fullscreen #mapid {
  flex: 1;
  height: auto !important;
}
:fullscreen #map-stats {
  margin: 10px auto;
  width: 90%;
  max-width: 420px;
  z-index: 9999;
}
:fullscreen .map-legend {
  margin-bottom: 10px;
}

/* =========================================================
   GENERAL LAYOUT
   ========================================================= */

* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
body {
  margin: 0;
  color: #03323a;
  line-height: 1.5;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem;
}

.card {
  background: var(--card);
  padding: 1rem;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(3, 17, 18, 0.04);
}

/* =========================================================
   INPUT BOX / FORM ELEMENTS
   ========================================================= */

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(3, 17, 18, 0.1);
  border-radius: 8px;
  font-size: 0.95rem;
  color: #03323a;
  background: rgba(255, 255, 255, 0.95);
  transition: all 0.2s ease;
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

label {
  display: block;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.calculator input,
.calculator select {
  margin-bottom: 0.75rem;
}

/* =========================================================
   PRODUK RAMAH LINGKUNGAN SECTION
   ========================================================= */

.eco-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.eco-product-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(3, 17, 18, 0.06);
  padding: 0.8rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eco-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(3, 17, 18, 0.08);
}

.eco-product-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.eco-product-card img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.2);
}

.eco-product-card h4 {
  margin: 0.3rem 0;
  font-size: 1rem;
  color: var(--green-1);
}

.eco-product-card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* =========================================================
   CALCULATOR / RISK BADGE
   ========================================================= */

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.risk-badge {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
}
.risk-low { background: var(--green-1); }
.risk-medium { background: #f59e0b; }
.risk-high { background: #dc2626; }

/* =========================================================
   SCROLL REVEAL ANIMATION
   ========================================================= */

.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.9s ease-out;
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 1s ease-out;
}
.scroll-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.scroll-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 1s ease-out;
}
.scroll-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.scroll-zoom {
  opacity: 0;
  transform: scale(0.95);
  transition: all 1s ease;
}
.scroll-zoom.visible {
  opacity: 1;
  transform: scale(1);
}
[data-delay="1"] { transition-delay: 0.1s; }
[data-delay="2"] { transition-delay: 0.2s; }
[data-delay="3"] { transition-delay: 0.3s; }
[data-delay="4"] { transition-delay: 0.4s; }
[data-delay="5"] { transition-delay: 0.5s; }

/* =========================================================
   RESPONSIVE FIXES
   ========================================================= */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  #mobile-toggle { display: block; }
  .main-nav { display: none; }
  .calculator { grid-template-columns: 1fr; }
  .map { height: 360px; }
}

@media (max-width: 720px) {
  .header-inner { flex-direction: column; align-items: stretch; }
  .logo-wrap { justify-content: space-between; width: 100%; transform: translateX(-6px); }
  .main-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 0.5rem;
  }
  .logo-upload-btn { position: static; margin-left: auto; transform: none; }
}

@media (max-width: 520px) {
  .logo { font-size: 1rem; }
  .mini-map { height: 160px; }
  .map { height: 300px; }
  .hero-text h2 { font-size: 1.25rem; }
  .map-toolbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .eco-product-card img { height: 130px; }
}

@media (max-width: 480px) {
  .controls label, .calculator label { font-size: 0.9rem; }
  select, input[type="number"] { font-size: 0.9rem; }
  .map { height: 280px !important; }
  #toggle-fullscreen { font-size: 0.9rem; padding: 0.4rem 0.6rem; }
}
