/* RESET & BASE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background: #f9fcfa;
  color: #1a1a1a;
}
a {
  color: #2c8b58;
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover, a:focus {
  color: #f9fcfa;
  outline: none;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* NAVIGATION */
nav {
  background-color: #2c8b58;
  position: sticky;
  top: 0;
  z-index: 10001; /* Highest z-index for nav bar */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
nav .nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
}
nav .logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  letter-spacing: 1.2px;
  user-select: none;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
}
nav ul li a {
  color: white;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-block;
}
nav ul li a:hover, nav ul li a:focus {
  background-color: #1e6339;
  outline: none;
}

/* HERO SECTION */
.hero {
  position: relative;
  height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  padding: 0 20px;
  overflow: hidden;
}
.hero .slider img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.hero .slider img.active {
  opacity: 1;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 139, 88, 0.6);
  z-index: 1;
}
.hero h1, .hero p, .hero .btn-group {
  position: relative;
  z-index: 2;
}
.hero h1 {
  font-size: 3rem;
  max-width: 700px;
  margin-bottom: 20px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}
.hero p {
  font-size: 1.4rem;
  max-width: 600px;
  margin-bottom: 30px;
  font-weight: 400;
  text-shadow: 1px 1px 6px rgba(0,0,0,0.6);
}
.hero .btn-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  background-color: #38a169;
  color: white;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  box-shadow: 0 5px 10px rgba(56, 161, 105, 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  display: inline-block;
  user-select: none;
}
.btn:hover, .btn:focus {
  background-color: #276e3e;
  box-shadow: 0 8px 15px rgba(39, 110, 62, 0.6);
  outline: none;
}

/* EV TILES SECTION */
section.ev-tiles {
  padding: 60px 20px;
  background-color: white;
  width: 100%; /* Ensure full width */
  max-width: 100%; /* Redundant, but ensures no external constraint */
  box-sizing: border-box; /* Include padding in the width calculation */
  margin: 0 auto; /* Center the section if it were ever smaller than 100% (good practice) */
}
section.ev-tiles h2 {
  text-align: center;
  font-size: 2.8rem;
  color: #2c8b58;
  margin-bottom: 40px;
  font-weight: 700;
}
.tiles-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 auto;
}
.tile-row {
  display: flex;
  justify-content: center;
}
.tile-card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: row;
}
.tile-card:hover,
.tile-card:focus-within {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.2);
  outline: none;
}
.tile-image {
  background-size: cover;
  background-position: center;
  height: 100%;
  min-height: 220px;
  width: 20%;
  padding: 20px;
  flex-shrink: 0;
  flex-direction: column;
  justify-content: flex-start;
}
.tile-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #1a1a1a;
}
.tile-content h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #2c8b58;
}
.tile-content p {
  font-size: 1rem;
  color: #555;
  flex-grow: 1;
}

/* FEATURES SECTION */
section.features {
  padding: 50px 20px;
  background: #e9f6f1;
  text-align: center;
}
section.features h2 {
  font-size: 2.5rem;
  color: #2c8b58;
  margin-bottom: 40px;
  font-weight: 700;
}
.features-list {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}
.feature-item {
  background: white;
  padding: 25px 20px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(44,139,88,0.15);
  max-width: 280px;
  flex-grow: 1;
  transition: box-shadow 0.3s ease;
}
.feature-item:hover {
  box-shadow: 0 8px 25px rgba(44,139,88,0.3);
}
.feature-item h3 {
  color: #2c8b58;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.feature-item p {
  color: #444;
  font-size: 1rem;
  line-height: 1.4;
}

/* MAP & CARD SECTION */
.card {
  padding: 40px 20px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  margin-top: 40px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.map-header {
  text-align: center;
  margin-bottom: 20px;
}
.map-header h2 {
  font-size: 2.2rem;
  color: #2c8b58;
  font-weight: 700;
  margin-bottom: 10px;
}
.map-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.map-controls button,
.map-controls select {
  padding: 12px 20px;
  background-color: #38a169;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
}
.map-controls button:hover,
.map-controls button:focus,
.map-controls select:hover {
  background-color: #276e3e;
}
.map-controls select {
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 6px;
}
.map-container {
  position: relative;
  width: 100%;
  height: 500px;
  background-color: #f4f7f6;
  border-radius: 8px;
  overflow: hidden;
}
.map-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  background-color: #e9f6f1;
  border-radius: 8px;
}
.map-loading {
  color: #38a169;
  font-size: 1.5rem;
}

/* DISCLAIMER SECTION */
section.disclaimer {
  padding: 40px 20px;
  background: #f9fcfa;
  color: #1a1a1a;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
section.disclaimer .disclaimer-content {
  font-size: 1.1rem;
  text-align: center;
  line-height: 1.6;
}
section.disclaimer a {
  color: #2c8b58;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}
section.disclaimer a:hover, section.disclaimer a:focus {
  color: #1e6339;
  outline: none;
}
section.disclaimer p {
  margin: 0;
  font-weight: 400;
  color: #555;
}

/* FOOTER */
footer {
  background-color: #2c8b58;
  color: white;
  padding: 30px 20px;
  text-align: center;
  font-size: 0.9rem;
  user-select: none;
  margin-top: 60px;
}
footer a {
  color: #a5d6a7;
  margin: 0 10px;
  font-weight: 600;
}
footer a:hover,
footer a:focus {
  color: #c8e6c9;
  outline: none;
}

/* USER LOCATION MARKER */
.user-location-marker {
  background-color: #2196F3;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: none;
}
.user-location-marker div {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #2196F3;
}

/* LOGIN PANEL & OVERLAY */
.login-panel {
  position: fixed;
  top: 70px; /* match nav bar height on desktop */
  right: -400px;
  width: 350px;
  max-height: calc(100vh - 70px);
  background: #f9fcfa;
  border-left: 4px solid #2c8b58;
  box-shadow: -4px 0 12px rgba(0,0,0,0.2);
  padding: 24px 24px 18px 24px;
  transition: right 0.3s ease-in-out;
  z-index: 9999;
  overflow-y: auto;
  border-radius: 0 8px 8px 0;
}
.login-panel.active {
  right: 0;
}
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 9999;
}
.login-overlay.active {
  display: block;
}
.login-panel .close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #2c8b58;
  font-weight: bold;
}

/* MODAL: Feedback, Privacy, Terms, etc. */
.modal {
  display: none;
  position: fixed;
  z-index: 10000; /* Below nav */
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  padding-top: 30px;
  overflow-y: auto;
  box-sizing: border-box;
}
.modal-content {
  background: #fff;
  margin: 70px auto 0 auto;  /* nav bar height for desktop */
  padding: 20px 20px 14px 20px;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
  position: relative;
  box-shadow: 0 8px 30px rgba(0,0,0,0.23);
  font-size: 1.08rem;
}
.close-btn {
  color: #aaa;
  font-size: 2rem;
  font-weight: bold;
  float: right;
  border: none;
  background: transparent;
  cursor: pointer;
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10;
}
.close-btn:hover, .close-btn:focus {
  color: #222;
}
.modal-content h3,
.modal-content h4,
.modal-content h5 {
  margin-top: 10px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c8b58;
  font-size: 1.12rem;
}
.modal-content p,
.modal-content li,
.modal-content ul,
.modal-content form {
  font-size: 1rem;
  line-height: 1.6;
}

/* MOBILE ADJUSTMENTS */

@media (max-width: 768px) {
  /* Center login panel like a modal, below nav bar */
  body.freeze-scroll {
    overflow: hidden !important;
    position: fixed;
    width: 100vw;
    height: 100vh;
    touch-action: none;
  }
}

@media (max-width: 380px) {
  .login-panel {
    min-width: 120px;
    padding: 8px 2px 8px 2px;
    font-size: 0.97rem;
  }
}

/* Make sure .login-overlay covers background, but not nav */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 9998;
  display: none;
}
.login-overlay.active {
  display: block;
}

/* FORM STYLES */
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
form label {
  font-weight: bold;
  margin-bottom: 6px;
  color: #333;
}
form input,
form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}
form textarea {
  min-height: 100px;
  resize: vertical;
}
form button {
  background-color: #28a745;
  color: white;
  padding: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}
form button:hover {
  background-color: #218838;
}

/* RESPONSIVE FOR MAIN LAYOUT */
@media (max-width: 1024px) {
  .card,
  section.disclaimer {
    padding: 30px 15px;
  }
  .map-container {
    height: 300px;
  }
  .map-controls {
    flex-direction: column;
    gap: 10px;
  }
  .map-controls button,
  .map-controls select {
    width: 100%;
  }
}

@media (max-width: 768px) {
  section.ev-tiles { padding: 40px 15px; }
  section.ev-tiles h2 { font-size: 2.2rem; margin-bottom: 30px; }
  .tiles-grid { gap: 20px; }
  .tile-row { flex-direction: column; }
  .tile-card { flex-direction: column; max-width: 100%; }
  .tile-image { width: 100%; min-height: 180px; padding: 15px; }
  .tile-content { padding: 15px; }
  .tile-content h3 { font-size: 1.4rem; }
  .tile-content p { font-size: 0.95rem; }

  section.features { padding: 30px 15px; }
  section.features h2 { font-size: 2rem; margin-bottom: 30px; }
  .features-list { gap: 20px; }
  .feature-item { max-width: 100%; padding: 20px 15px; }
  .feature-item h3 { font-size: 1.3rem; }
  .feature-item p { font-size: 0.95rem; }

  .card { padding: 30px 15px; }
  .map-header h2 { font-size: 1.8rem; }
  .map-container { height: 250px; }
  .map-controls { flex-direction: column; gap: 10px; }
  .map-controls button,
  .map-controls select { width: 100%; padding: 10px 18px; }

  section.disclaimer { padding: 25px 10px; }
}

@media (max-width: 480px) {
  section.ev-tiles { padding: 30px 10px; }
  section.ev-tiles h2 { font-size: 1.8rem; margin-bottom: 25px; }
  .tiles-grid { gap: 15px; }
  .tile-card { padding: 15px; margin: 0 auto; }
  .tile-image { min-height: 160px; padding: 10px; }
  .tile-content { padding: 10px; }
  .tile-content h3 { font-size: 1.2rem; }
  .tile-content p { font-size: 0.9rem; }

  section.features { padding: 25px 10px; }
  section.features h2 { font-size: 1.8rem; margin-bottom: 25px; }
  .features-list { gap: 15px; flex-direction: column; }
  .feature-item { padding: 18px 12px; }
  .feature-item h3 { font-size: 1.2rem; }
  .feature-item p { font-size: 0.9rem; }

  .card { padding: 20px 10px; }
  .map-header h2 { font-size: 1.6rem; }
  .map-container { height: 300px; }
  .map-controls { gap: 8px; }
  .map-controls button,
  .map-controls select { width: 100%; padding: 8px 15px; }

  section.disclaimer { padding: 20px 6px; }
}

body.freeze-scroll {
  overflow: hidden !important;
  height: 100%;
  touch-action: none;
}
