/*html {
  scroll-behavior: smooth;
}*/


body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

/* Improved contrast for hero badge text */
.hero-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

/* Changed to pure white for maximum contrast */
.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Increased brightness and contrast for subtitle */
.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  opacity: 1;
  font-weight: 400;
  line-height: 1.7;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  color: #f1f5f9;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2.5rem 0;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
  text-align: center;
}

/* Brighter color for stat numbers */
.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #93c5fd;
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 12px rgba(147, 197, 253, 0.4);
}

/* Increased brightness for stat labels */
.stat-label {
  font-size: 0.9rem;
  color: #cbd5e1;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 1rem 2.5rem;
  margin-top: 1rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .hero {
    padding: 3rem 1.5rem 4rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }
}

.hero {
  background-image: url("assets/images/fondoInicio.jpg"); /* o .png si corresponde */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  padding: 5rem 2rem 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}


.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 0;
  opacity: 0.95;
  font-weight: 400;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  background-color: white;
  color: #1e88e5;
  padding: 1rem 2.5rem;
  margin-top: 2rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn:hover {
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
}

.btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.1rem;
  }
}

/* Redesigned map section with better header and spacing */
.map-section {
  padding: 4rem 2rem;
  text-align: center;
  background: #fafafa;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #64748b;
  font-weight: 400;
}

#heatmapContainer {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  height: 600px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Completely redesigned controls container with modern card-style design */
.controls-wrapper {
  max-width: 1000px;
  margin: 0 auto 2.5rem;
}

.controls {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  display: flex;
  gap: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  align-items: flex-end;
}

.control-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.control-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  display: block;
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

#cityInput {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  color: #1a1a1a;
  outline: none;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

#cityInput::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

#cityInput:hover {
  border-color: #d1d5db;
}

#cityInput:focus {
  background: white;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#cityGoBtn {
  padding: 0.875rem 1.75rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

#cityGoBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

#cityGoBtn:active {
  transform: translateY(0);
}

#cityGoBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#datasetSelect {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  padding: 0.875rem 2.75rem 0.875rem 1.25rem;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.95rem;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath fill='%23374151' d='M8 10L0 0h16z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 10px;
  transition: all 0.2s ease;
}

#datasetSelect:hover {
  border-color: #d1d5db;
}

#datasetSelect:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#datasetSelect:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .control-group {
    width: 100%;
  }

  .input-with-button {
    flex-direction: column;
  }

  #cityGoBtn {
    width: 100%;
  }

  #heatmapContainer {
    height: 400px;
  }
}

.map-section {
  padding: 2rem;
  text-align: center;
}

#heatmapContainer {
  width: 100%;
  height: 500px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Completely redesigned controls container with modern card-style design */
.controls {
  background: white;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.controls:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* City search input with refined styling */
#cityInput {
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  border: 2px solid #e8e8e8;
  background: #fafafa;
  color: #1a1a1a;
  min-width: 280px;
  outline: none;
  transition: all 0.25s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

#cityInput::placeholder {
  color: #999;
  font-weight: 400;
}

#cityInput:hover {
  border-color: #d0d0d0;
  background: #f5f5f5;
}

#cityInput:focus {
  background: white;
  border-color: #1e88e5;
  box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.1);
}

/* City search button with gradient and better hover states */
#cityGoBtn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #2d5f3f 0%, #1e88e5 100%);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.25);
  transition: all 0.25s ease;
  white-space: nowrap;
}

#cityGoBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 136, 229, 0.35);
}

#cityGoBtn:active {
  transform: translateY(0);
}

#cityGoBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Enhanced dataset selector with modern styling */
#datasetSelect {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 0.75rem 2.5rem 0.75rem 1.1rem;
  border-radius: 12px;
  border: 2px solid #e8e8e8;
  background: #fafafa;
  box-shadow: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  min-width: 240px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='%231a1a1a' d='M7 9L0 0h14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 9px;
  transition: all 0.25s ease;
}

#datasetSelect:hover {
  border-color: #d0d0d0;
  background-color: #f5f5f5;
}

#datasetSelect:focus {
  outline: none;
  border-color: #1e88e5;
  background-color: white;
  box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.1);
}

#datasetSelect:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    width: 90%;
    max-width: 400px;
  }

  #cityInput,
  #datasetSelect {
    min-width: 100%;
    width: 100%;
  }

  #cityGoBtn {
    width: 100%;
  }
}

footer {
  text-align: center;
  padding: 1rem;
  background: #222;
  color: #ccc;
  font-size: 0.9rem;
}

#earth-section {
  position: relative;
  width: 100%;
  height: 100vh;
  background-image: url("assets/images/fondo3d.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}

#earthCanvas {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  z-index: 1;
}

.faq-section {
  background-color: #f5f5f5;
  padding: 4rem 2rem;
  text-align: center;
}

.faq-section h2 {
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: #333;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

.faq-item {
  border-bottom: 1px solid #ccc;
  margin-bottom: 1rem;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  padding: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.3s ease;
}

.faq-question:hover {
  color: #2196f3;
}

.faq-icon {
  font-size: 1.5rem;
  color: #2196f3;
  transition: transform 0.3s ease;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
  background: #fff;
  border-radius: 8px;
  padding: 0 1rem;
}

.faq-answer p {
  padding: 1rem 0;
  margin: 0;
  color: #555;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  opacity: 1;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.video-section {
  position: relative;
  width: 100%;
  height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.video-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#cityVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-overlay-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  color: white;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem 2rem;
  border-radius: 10px;
}

.video-overlay-text h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.video-overlay-text p {
  font-size: 1.2rem;
}

.report-section {
  position: relative;
  background-image: url("assets/images/fondo3d.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 5rem 2rem;
  text-align: center;
  color: white;
  overflow: hidden;
}

.report-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.report-section h2 {
  font-size: 2.2rem;
  margin-bottom: 2.5rem;
  color: #fff;
  position: relative;
  z-index: 2;
}

.report-form {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.form-group.full-width {
  flex: 1 1 100%;
}

.report-form label {
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.report-form input,
.report-form select,
.report-form textarea {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  outline: none;
  transition: background 0.3s ease, border 0.3s ease;
  box-sizing: border-box;
}

.report-form input::placeholder,
.report-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.report-form select option {
  background: #222;
  color: #fff;
}

.report-form input:focus,
.report-form select:focus,
.report-form textarea:focus {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid #4caf50;
}

.report-form button {
  background-color: #000;
  color: white;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  align-self: center;
  width: 50%;
  max-width: 250px;
}

.report-form button:hover {
  background-color: #4caf50;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }

  .report-form {
    padding: 1.5rem;
  }

  .report-form button {
    width: 100%;
  }
}

/* Enhanced legend with improved readability and modern styling */
.legend {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.75));
  color: #fff;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  line-height: 1.5;
  min-width: 180px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.legend .legend-header {
  font-weight: 700;
  margin-bottom: 6px;
}

.legend .legend-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend .legend-title {
  font-weight: 600;
}

.legend .legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legend .legend-minmax {
  gap: 8px;
  margin-top: 4px;
}

.legend .legend-min,
.legend .legend-max {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #e6eef8;
}

.legend .legend-gradient {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f921 0%, #fde725 25%, #35b779 50%, #31688e 75%, #440154 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.legend .legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #d1d5db;
}

.legend .legend-stats {
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.legend .legend-note {
  font-size: 11px;
  color: #9ca3af;
}

.legend .legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.06);
}

.legend .legend-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e6eef8;
}

.legend .legend-cap {
  color: #cbd5e1;
}

.legend b {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #ffffff;
}

.legend span {
  display: inline-block;
  width: 18px;
  height: 12px;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.legend>div:not(.legend-stats) {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.95);
}

.legend>div:last-of-type:not(.legend-stats) {
  margin-bottom: 0;
}

.legend-stats {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  font-family: "Courier New", monospace;
}

/* Improved loader with modern design */
.loader {
  position: fixed;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.95), rgba(45, 95, 63, 0.95));
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(30, 136, 229, 0.3);
  z-index: 9999;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: reduce) {

  #cityGoBtn,
  .btn-primary {
    transition: none;
  }
}