* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  height: 100vh;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
}

header.maps-header {
  flex-shrink: 0;
  z-index: 1050;
}

.container-main {
  display: flex;
  flex: 1;
  flex-direction: row;
  position: relative;
  height: calc(100vh - 76px);

  /* Approximate navbar height */
}

/* MAP CONTAINER */
#map {
  flex: 1;
  z-index: 1;
  position: relative;
  width: 100%;
}

/* SIDEBAR - Flutuante e Retrátil */
.sidebar {
  position: fixed;
  right: 0;
  top: 76px;

  /* Below navbar */
  width: 380px;
  height: calc(100vh - 76px);
  background: white;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow-y: auto;
}

.sidebar.active {
  transform: translateX(0);
}

/* SIDEBAR LOGO HEADER */
.sidebar-logo-header {
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 130px;
  width: 100%;
}

.sidebar-logo-header a {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 360px;
  height: 120px;
  transition: all 0.3s ease;
}

.sidebar-logo-header a:hover {
  filter: brightness(1.1);
}

.sidebar-logo-header img {
  width: 98%;
  height: 98%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 2px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  color: #333;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: #667eea;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.sidebar-close-btn:hover {
  background: #f0f0f0;
  color: #764ba2;
}

.sidebar-overlay {
  display: none;
}

/* FLOATING CLOSE BUTTON (Botão flutuante no canto) */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.info-section {
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
}

.info-section-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-section-title i {
  color: #667eea;
  font-size: 1.1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.95rem;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-label {
  font-weight: 500;
  color: #555;
}

.info-value {
  font-weight: 600;
  color: #667eea;
  font-family: "Courier New", monospace;
}

.info-unit {
  font-size: 0.85rem;
  color: #888;
  margin-left: 4px;
}

/* VARIABLE SPECIFIC INFO */
.variable-specific {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.variable-specific .info-section-title {
  color: #667eea;
}

.stat-card {
  background: white;
  border-left: 4px solid #667eea;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.stat-card-label {
  color: #666;
  font-size: 0.85rem;
}

.stat-card-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #667eea;
  margin: 5px 0;
}

.stat-card-unit {
  font-size: 0.8rem;
  color: #888;
}

/* CONTROLS */
.controls-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 80px;
  background: white;
  border-top: 2px solid #e9ecef;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  z-index: 800;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.slider-wrapper {
  flex: 1;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-wrapper label {
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  color: #555;
}

#layerSlider {
  flex: 1;
  min-width: 150px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #667eea, #764ba2);
  outline: none;
  appearance: none;
}

#layerSlider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid #667eea;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#layerSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid #667eea;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-time {
  font-weight: 600;
  color: #667eea;
  min-width: 200px;
  font-size: 0.95rem;
}

.buttons-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.control-btn {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  color: #555;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.control-btn:hover {
  background: #f8f9fa;
  border-color: #667eea;
  color: #667eea;
}

.control-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* TOGGLE SWITCH */
.variable-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.variable-selector-wrapper label {
  font-weight: 500;
  color: #555;
  font-size: 0.9rem;
  margin: 0;
}

.variable-select {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
  padding-right: 32px;
}

.variable-select:hover {
  border-color: #667eea;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.2);
}

.variable-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* HEIGHT SELECTOR (Eólico) */
.height-selector-wrapper {
  display: none;
  position: absolute;
  bottom: 100px; /* Ao lado do botão de vetores */
  left: 80px;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 799;
  white-space: nowrap;
}

.height-selector-wrapper.active {
  display: flex;
}

.height-selector-wrapper label {
  font-weight: 600;
  color: #555;
  font-size: 0.9rem;
  margin: 0;
}

.height-button-group {
  display: flex;
  gap: 6px;
}

.height-btn {
  padding: 6px 12px;
  border: 2px solid #ddd;
  border-radius: 4px;
  background: white;
  color: #555;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 50px;
}

.height-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.height-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* WIND VECTOR LAYER TOGGLE */
.wind-layer-toggle {
  display: none;
  position: absolute;
  bottom: 100px;
  left: 20px;
  z-index: 799;
}

.wind-layer-toggle.active {
  display: block;
}

.wind-layer-toggle label {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  color: #333;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  margin: 0;
}

.wind-layer-toggle label:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.wind-layer-toggle label:active {
  transform: scale(0.95);
}

.wind-layer-toggle:has(input[type="checkbox"]:checked) label {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.4);
}

.wind-layer-toggle:has(input[type="checkbox"]:checked) label:hover {
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6);
}

.wind-layer-toggle .wind-toggle-text {
  display: none;
}

/* WIND VECTORS CANVAS */
#windVectorCanvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 400;
  pointer-events: none;
}

/* COLORBAR */
.colorbar-container {
  position: absolute;
  top: 80px;
  left: 12px;
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 799;
  min-width: 100px;
}

.colorbar-content {
  display: flex;
  gap: 12px;
  align-items: center;
}

.colorbar-gradient {
  width: 24px;
  height: 200px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: linear-gradient(to top, #440154, #3b528b, #21918c, #5ec962, #fde725);
}

.colorbar-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 200px;
  font-size: 0.8rem;
  color: #666;
  text-align: left;
  min-width: 45px;
}

.colorbar-label {
  font-weight: 500;
}

.colorbar-unit {
  text-align: center;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #888;
  font-weight: 500;
  border-top: 1px solid #e9ecef;
  padding-top: 8px;
}

/* DOMAIN INDICATOR */

/* DOMAIN INDICATORS CONTAINER */
.domain-indicators-container {
  position: absolute;
  top: 360px;
  left: 12px;
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 799;
}

.domain-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  text-align: center;
  margin-bottom: 8px;
  display: block;
}

.domain-buttons-group {
  display: flex;
  gap: 6px;
  flex-direction: column;
}

.domain-btn {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Courier New", monospace;
  text-align: center;
  min-width: 70px;
}

.domain-btn:hover {
  border-color: #667eea;
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.domain-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* RESPONSIVE - TABLET E MOBILE */
@media (width <= 1024px) {
  /* Ajustes gerais para telas < 1024px */
  .sidebar {
    max-width: 95vw;
  }

  .control-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .slider-wrapper {
    min-width: 250px;
  }

  .slider-time {
    min-width: 150px;
    font-size: 0.85rem;
  }
}

@media (width <= 768px) {
  /* MOBILE: Até 768px */

  /* Layout Base */
  .container-main {
    flex-direction: column;
  }

  #map {
    height: calc(100vh - 200px);
    width: 100%;
  }

  /* Sidebar em Mobile - Slide-up do fundo */
  .sidebar {
    position: fixed;
    inset: auto auto 200px 2.5vw;
    width: 95vw;
    max-width: 95vw;
    height: auto;
    max-height: 45vh;
    transform: translateY(100%);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    visibility: hidden;
    pointer-events: none;
  }

  .sidebar.active {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  /* Ocultar logo da sidebar em mobile */
  .sidebar-logo-header {
    display: none;
    height: 0;
    padding: 0;
  }

  .sidebar-header {
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .sidebar-content {
    max-height: calc(45vh - 50px);
    overflow-y: auto;
    padding: 0;
  }

  /* Controls Container - Mais compacto */
  .controls-container {
    height: auto;
    min-height: 0;
    padding: 8px;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    flex-flow: row wrap;
    pointer-events: none;
  }

  /* Slider - Ocupa linha cheia */
  .slider-wrapper {
    width: 100%;
    min-width: unset;
    flex-basis: 100%;
    gap: 8px;
    margin: 2px 0;
    pointer-events: auto;
  }

  .slider-wrapper label {
    font-size: 0.7rem;
    flex-shrink: 0;
  }

  #layerSlider {
    flex: 1;
    min-width: 80px;
    height: 4px;
    pointer-events: auto;
  }

  .slider-time {
    font-size: 0.7rem;
    min-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
  }

  /* Botões - Layout horizontal compacto */
  .buttons-group {
    width: 100%;
    flex-basis: 100%;
    gap: 4px;
    justify-content: space-around;
    margin: 2px 0;
    pointer-events: auto;
  }

  .control-btn {
    padding: 5px 8px;
    font-size: 0.65rem;
    flex: 1;
    min-width: 40px;
    height: 28px;
    border-radius: 4px;
    gap: 3px;
    pointer-events: auto;
  }

  .control-btn i {
    display: none;
  }

  /* Seletor de Variáveis */
  .variable-selector-wrapper {
    width: 100%;
    flex-basis: 100%;
    padding: 6px 8px;
    gap: 6px;
    flex-wrap: wrap;
    margin: 2px 0;
    pointer-events: auto;
  }

  .variable-selector-wrapper label {
    font-size: 0.7rem;
  }

  .variable-select {
    flex: 1;
    min-width: 140px;
    font-size: 0.7rem;
    padding: 6px 8px;
    border: 1px solid #d0d0d0;
    background-size: 14px;
    padding-right: 26px;
    pointer-events: auto;
  }

  /* Colorbar - Repositionado */
  .colorbar-container {
    position: absolute;
    inset: 12px auto auto 8px;
    font-size: 0.65rem;
    padding: 8px;
    min-width: auto;
    pointer-events: none;
  }

  .colorbar-gradient {
    width: 18px;
    height: 140px;
  }

  .colorbar-labels {
    height: 140px;
    font-size: 0.65rem;
    min-width: 35px;
  }

  .colorbar-unit {
    font-size: 0.65rem;
    margin-top: 4px;
    padding-top: 4px;
  }

  /* Domain Indicators - Mais alto em mobile, mas sem sobrepor colorbar */
  .domain-indicators-container {
    top: 165px;
    left: 8px;
    padding: 8px;
    z-index: 799;
    pointer-events: none;
  }

  .domain-label {
    font-size: 0.65rem;
    margin-bottom: 6px;
    pointer-events: none;
  }

  .domain-buttons-group {
    max-height: 140px;
    overflow-y: auto;
  }

  .domain-btn {
    padding: 6px 8px;
    font-size: 0.65rem;
    min-width: 50px;
    border-radius: 4px;
    pointer-events: auto;
  }

  /* Documentation Button - Canto inferior direito em mobile */
  .documentation-btn-container {
    position: fixed !important;
    inset: auto 8px 115px auto !important;
    z-index: 799 !important;
    pointer-events: none !important;
  }

  .documentation-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 1rem !important;
    pointer-events: auto !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4) !important;
  }

  /* Lab Button - Mostrado em mobile no topo-direito */
  .lab-btn-container {
    display: flex !important;
    position: fixed !important;
    top: 8px !important;
    right: 50px !important;
    left: auto !important;
    z-index: 800 !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
  }

  .lab-btn {
    width: 56px !important;
    height: 56px !important;
    border-radius: 0 !important;
    background: none !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    text-decoration: none !important;
  }

  .lab-logo-img {
    width: 90% !important;
    height: 90% !important;
    object-fit: contain !important;
    transform: scale(3) !important;
    padding: 0 !important;
  }

  /* Height Selector - Reposicionado em mobile e compacto */
  .height-selector-wrapper {
    position: fixed !important;
    inset: auto auto 115px 56px !important; /* Ao lado do botão de vento */
    padding: 6px 8px !important;
    gap: 6px !important;
    z-index: 799 !important;
  }
  .height-selector-wrapper label {
    font-size: 0.75rem !important;
  }
  .height-btn {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    min-width: 40px !important;
  }

  /* Wind Layer Toggle - Móvel: botão flutuante inferior esquerdo */
  .wind-layer-toggle {
    position: fixed !important;
    inset: auto auto 115px 8px !important;
    z-index: 799 !important;
    pointer-events: none !important;
  }

  .wind-layer-toggle label {
    pointer-events: auto !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 1rem !important;
  }

  /* Info Sections */
  .info-section {
    padding: 12px;
    margin-bottom: 8px;
  }

  .info-section-title {
    font-size: 0.75rem;
    margin-bottom: 10px;
  }

  .info-item {
    font-size: 0.7rem;
    padding: 6px;
    margin-bottom: 6px;
  }

  .info-label {
    font-size: 0.7rem;
  }

  .info-value {
    font-size: 0.8rem;
  }

  .stat-card {
    padding: 8px;
    font-size: 0.65rem;
    margin-bottom: 8px;
    border-left-width: 3px;
  }

  .stat-card-value {
    font-size: 1rem;
    margin: 4px 0;
  }

  /* Chart - Menor em mobile */
  .chart-container {
    padding: 8px;
    margin: 8px 0;
  }

  .chart-header {
    padding-bottom: 8px;
    margin-bottom: 8px;
  }

  .chart-canvas-wrapper {
    height: 200px;
  }

  .chart-title {
    font-size: 0.75rem;
  }

  .chart-expand-btn,
  .chart-export-btn {
    font-size: 0.65rem;
    padding: 4px 8px;
  }
}

/* RESPONSIVE - ULTRA-MOBILE (< 480px) */
@media (width <= 480px) {
  #map {
    height: calc(100vh - 200px);
    width: 100%;
    pointer-events: auto;
  }

  .sidebar {
    width: 98vw;
    max-width: 98vw;
    left: 1vw;
    max-height: 50vh;
  }

  .sidebar-header h3 {
    font-size: 0.9rem;
  }

  /* Logo e Documentação no topo/canto */
  .lab-btn-container {
    top: 8px !important;
    right: 50px !important;
    left: auto !important;
    z-index: 1001 !important;
    pointer-events: none !important;
    position: fixed !important;
  }

  .lab-btn {
    width: 56px !important;
    height: 56px !important;
    border-radius: 0 !important;
    background: none !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    text-decoration: none !important;
  }

  .lab-logo-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    transform: scale(3) !important;
    padding: 0 !important;
  }

  .documentation-btn-container {
    position: fixed !important;
    inset: auto 8px 115px auto !important;
    z-index: 1001 !important;
    pointer-events: none !important;
  }

  .documentation-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.9rem !important;
    pointer-events: auto !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4) !important;
  }

  /* Domain indicators mais alto */
  .domain-indicators-container {
    top: 180px;
    left: 4px;
    padding: 4px;
    max-width: 60px;
    pointer-events: none;
  }

  .domain-label {
    font-size: 0.6rem;
    margin-bottom: 4px;
    pointer-events: none;
  }

  .domain-btn {
    padding: 4px 6px;
    font-size: 0.6rem;
    min-width: 40px;
    pointer-events: auto;
  }

  /* Colorbar - Pequeno no ultra-mobile */
  .colorbar-container {
    top: 8px;
    left: 4px;
    font-size: 0.6rem;
    padding: 4px;
    max-width: 70px;
    pointer-events: none;
  }

  .colorbar-gradient {
    width: 16px;
    height: 120px;
  }

  .colorbar-labels {
    height: 120px;
    font-size: 0.6rem;
    min-width: 28px;
  }

  /* Controles ainda mais compactos */
  .controls-container {
    height: auto;
    min-height: 0;
    padding: 6px;
    gap: 4px;
    max-height: none;
    overflow: hidden auto;
    width: 100%;
    flex-flow: row wrap;
    pointer-events: none;
  }

  .slider-wrapper {
    width: 100%;
    min-width: unset;
    flex-basis: 100%;
    gap: 6px;
    margin: 2px 0;
    pointer-events: auto;
  }

  .slider-wrapper label {
    display: none;
  }

  .slider-time {
    min-width: 80px;
    font-size: 0.65rem;
    white-space: nowrap;
    pointer-events: auto;
  }

  #layerSlider {
    flex: 1;
    min-width: 60px;
    height: 4px;
    pointer-events: auto;
  }

  .buttons-group {
    width: 100%;
    flex-basis: 100%;
    gap: 3px;
    justify-content: space-around;
    margin: 2px 0;
    pointer-events: auto;
  }

  .control-btn {
    padding: 4px 6px;
    font-size: 0.6rem;
    flex: 1;
    min-width: 35px;
    height: 24px;
    border-radius: 3px;
    pointer-events: auto;
  }

  .control-btn i {
    display: none;
  }

  .variable-selector-wrapper {
    width: 100%;
    flex-basis: 100%;
    padding: 4px 6px;
    gap: 4px;
    flex-wrap: wrap;
    margin: 2px 0;
    pointer-events: auto;
  }

  .variable-selector-wrapper label {
    display: none;
  }

  .variable-select {
    flex: 1;
    min-width: 110px;
    font-size: 0.65rem;
    padding: 5px 6px;
    border: 1px solid #d0d0d0;
    pointer-events: auto;
  }

  /* Info Sections */
  .info-section {
    padding: 8px;
    margin-bottom: 6px;
  }

  .info-item {
    font-size: 0.65rem;
    padding: 4px;
    margin-bottom: 4px;
  }

  .stat-card {
    padding: 6px;
    font-size: 0.6rem;
    margin-bottom: 6px;
  }

  .stat-card-value {
    font-size: 0.9rem;
  }

  .chart-canvas-wrapper {
    height: 180px;
  }

  /* Height Selector - Ajuste ultra-mobile */
  .height-selector-wrapper {
    position: fixed !important;
    inset: auto auto 115px 50px !important; /* Ao lado do botão de vento */
    padding: 4px 6px !important;
    gap: 4px !important;
    z-index: 1001 !important;
  }
  .height-selector-wrapper label {
    font-size: 0.65rem !important;
  }
  .height-btn {
    padding: 2px 6px !important;
    font-size: 0.65rem !important;
    min-width: 32px !important;
  }

  /* Wind Layer Toggle - Ultra-mobile: botão flutuante inferior esquerdo */
  .wind-layer-toggle {
    position: fixed !important;
    inset: auto auto 115px 8px !important;
    z-index: 1001 !important;
    pointer-events: none !important;
  }

  .wind-layer-toggle label {
    pointer-events: auto !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 0.9rem !important;
  }
}

/* ANIMATIONS */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

@keyframes ping {
  0% {
    transform: scale(0.8);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(255, 0, 110, 0.7);
  }

  50% {
    transform: scale(1);
    opacity: 0.8;
    box-shadow: 0 0 0 10px rgba(255, 0, 110, 0);
  }

  100% {
    transform: scale(1.2);
    opacity: 0;
    box-shadow: 0 0 0 20px rgba(255, 0, 110, 0);
  }
}

@keyframes glow {
  0%,
  100% {
    filter: drop-shadow(0 0 2px rgba(255, 0, 110, 0.8));
  }

  50% {
    filter: drop-shadow(0 0 8px rgba(255, 0, 110, 1));
  }
}

.ping-pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ping-pin svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  animation: glow 2s ease-in-out infinite;
}

.ping-pulse {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: transparent;
  border: 2px solid rgba(255, 0, 110, 0.4);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.map-alert {
  position: fixed;
  right: 20px;
  bottom: 100px;
  z-index: 2000;
  max-width: 300px;
  padding: 16px 24px;
  border-radius: 8px;
  background: #ff6b6b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: white;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
}

.map-alert.is-exiting {
  animation: slideOutRight 0.3s ease;
}

.info-section {
  animation: slideIn 0.3s ease;
}

/* SPINNER LOADING */
.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* PARAMETERS EDITOR */
.parameters-editor {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8f0ff 100%);
  border: 1px solid #d0dce6;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

.parameters-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
  margin-bottom: 8px;
}

.parameters-toggle:hover {
  background: rgba(102, 126, 234, 0.1);
}

.parameters-toggle-label {
  font-weight: 600;
  color: #667eea;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.parameters-toggle-icon {
  transition: transform 0.3s;
  display: inline-block;
}

.parameters-toggle-icon.active {
  transform: rotate(180deg);
}

.parameters-list {
  display: none;
  gap: 10px;
  flex-direction: column;
}

.parameters-list.active {
  display: flex;
}

.parameter-item {
  background: white;
  padding: 10px;
  border-radius: 6px;
  border-left: 3px solid #667eea;
}

.parameter-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}

.parameter-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: "Courier New", monospace;
  transition: all 0.2s;
  box-sizing: border-box;
}

.parameter-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.parameter-input::placeholder {
  color: #ccc;
}

.parameter-unit {
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
  display: block;
}

.parameter-hint {
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 2px;
  display: block;
  font-style: italic;
}

.reset-parameters-btn {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  color: #667eea;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.reset-parameters-btn:hover {
  background: #f8f9fa;
  border-color: #667eea;
}

/* LAB BUTTON */
.lab-btn-container {
  position: fixed;
  top: 40px;
  right: 130px;
  z-index: 799;
}

.lab-btn {
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: none;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: all 0.3s ease;
  text-decoration: none;
}

.lab-btn:hover {
  transform: scale(1.05);
  box-shadow: none;
  text-decoration: none;
}

.lab-btn:active {
  transform: scale(0.95);
}

.lab-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0;
  transform: scale(5);
}

/* DOCUMENTATION BUTTON */
.documentation-btn-container {
  position: absolute;
  top: 12px;
  left: 60px;
  z-index: 799;
}

.documentation-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.documentation-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6);
}

.documentation-btn:active {
  transform: scale(0.95);
}

/* DOCUMENTATION MODAL */
.documentation-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
}

.documentation-modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.documentation-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.documentation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 2px solid #e9ecef;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.documentation-header h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.documentation-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.documentation-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* DOCUMENTATION TABS */
.documentation-tabs {
  display: flex;
  gap: 0;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 0;
  overflow-x: auto;
  flex-shrink: 0;
}

.doc-tab {
  flex: 1;
  padding: 16px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.doc-tab:hover {
  background: #ebebf5;
  color: #667eea;
}

.doc-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: white;
}

.doc-tab i {
  font-size: 1.1rem;
}

/* DOCUMENTATION BODY */
.documentation-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-height: 0;
}

.doc-tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

.doc-tab-content.active {
  display: block;
}

.doc-tab-content h3 {
  color: #667eea;
  font-size: 1.4rem;
  margin-bottom: 16px;
  margin-top: 0;
  font-weight: 600;
}

.doc-tab-content h4 {
  color: #333;
  font-size: 1.1rem;
  margin-top: 20px;
  margin-bottom: 10px;
  font-weight: 600;
}

.doc-tab-content p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.doc-list li {
  color: #555;
  margin-bottom: 10px;
  padding-left: 24px;
  position: relative;
  line-height: 1.5;
  font-size: 0.95rem;
}

.doc-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: bold;
  font-size: 1.2rem;
}

.doc-list ul {
  list-style: none;
  padding: 8px 0 8px 24px;
  margin: 8px 0;
}

.doc-list ul li::before {
  content: "◦";
  color: #764ba2;
}

.doc-tab-content a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.doc-tab-content a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* DOCUMENTATION CUSTOM CARDS */
.doc-var-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.doc-var-card h4 {
  margin-top: 0 !important;
  color: #667eea !important;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-var-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.doc-var-badge {
  background: white;
  border: 1px solid #ced4da;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #495057;
}

.dark-theme .doc-var-card {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-theme .doc-var-card h4 {
  color: #a3bffa !important;
  border-color: var(--border-color);
}

.dark-theme .doc-var-badge {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* RESPONSIVE */
@media (width <= 768px) {
  .documentation-content {
    max-width: 95%;
    max-height: 80vh;
  }

  .documentation-header h2 {
    font-size: 1.2rem;
  }

  .doc-tab {
    padding: 12px 16px;
    font-size: 0.85rem;
  }

  .documentation-body {
    padding: 16px;
  }

  .doc-tab-content h3 {
    font-size: 1.2rem;
  }

  .doc-tab-content h4 {
    font-size: 1rem;
  }

  .documentation-modal.active {
    padding: 20px 10px;
  }
}

/* GRÁFICOS TEMPORAIS */
.chart-container {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  border: 1px solid #e9ecef;
  animation: slideIn 0.3s ease;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.chart-title {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-title i {
  color: #667eea;
  font-size: 1.1rem;
}

.chart-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chart-expand-btn,
.chart-export-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  color: #667eea;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chart-expand-btn:hover,
.chart-export-btn:hover {
  background: #f8f9fa;
  border-color: #667eea;
  color: #764ba2;
}

.chart-canvas-wrapper {
  position: relative;
  height: 280px;
  margin: 12px 0;
}

.chart-canvas-wrapper canvas {
  max-height: 280px;
}

/* MODAL DE GRÁFICO EXPANDIDO */
.chart-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.chart-modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.chart-modal-header {
  padding: 20px;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: #333;
}

.chart-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.chart-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.chart-modal-body {
  flex: 1;
  padding: 20px;
  position: relative;
  min-height: 400px;
}

.chart-modal-body canvas {
  max-height: 100%;
}

.dark-theme .sidebar-header {
  background: var(--bg-secondary) !important;
  border-bottom-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.dark-theme .sidebar-header h3,
.dark-theme .doc-tab-content h3,
.dark-theme .chart-modal-header h2 {
  color: var(--text-primary) !important;
}

.dark-theme .sidebar-close-btn {
  color: #a3bffa !important;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.chart-no-data {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 0.9rem;
}

.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #667eea;
  font-size: 0.9rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

@media (width <= 768px) {
  .chart-container {
    padding: 12px;
    margin: 10px 0;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .chart-export-btn {
    width: 100%;
    justify-content: center;
  }

  .chart-canvas-wrapper {
    height: 250px;
  }
}

@media (width <= 768px) {
  .colorbar-container {
    top: 8px;
    left: 8px;
    max-width: min(96px, 28vw);
    max-height: calc(100vh - 230px);
    overflow: hidden;
  }

  .colorbar-content {
    gap: 8px;
  }

  .colorbar-gradient {
    height: clamp(110px, 26vh, 150px);
  }

  .colorbar-labels {
    height: clamp(110px, 26vh, 150px);
    min-width: 32px;
    overflow: hidden;
  }

  .domain-indicators-container {
    top: 8px;
    right: 8px;
    left: auto;
    width: min(240px, calc(100vw - 120px));
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 230px);
    overflow-y: auto;
    pointer-events: auto;
  }

  .domain-buttons-group {
    display: flex;
    flex-flow: row wrap;
    gap: 6px;
    max-height: none;
    overflow: visible;
  }

  .domain-btn {
    flex: 1 1 48px;
    min-width: 48px;
  }
}

@media (width <= 480px) {
  .colorbar-container {
    top: 6px;
    left: 6px;
    max-width: 82px;
    padding: 5px;
  }

  .colorbar-content {
    gap: 6px;
  }

  .domain-indicators-container {
    top: 6px;
    right: 6px;
    left: auto;
    width: min(220px, calc(100vw - 100px));
    max-width: calc(100vw - 100px);
    padding: 6px;
  }

  .domain-label {
    text-align: left;
  }

  .domain-btn {
    flex-basis: calc(50% - 3px);
    min-width: 44px;
  }
}
