/* map.css - KOMPLETNY CSS */
/* --- karta ze szczegółami punktu --- */
#map {
    height: 600px;
    width: 100%;
    position: relative;
}

#punkt-details {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-top: 20px;
}

#punkt-details h3 {
  font-size: 1.4rem;
  color: #1a4b7a;
  margin-bottom: 8px;
}

/* --- Sekcje informacyjne --- */
.chgl-info-section {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  border-left: none;
  padding: 16px;
  margin-bottom: 0;
}


.chgl-info-row {
  margin-bottom: 8px;
  line-height: 1.5;
}

.chgl-info-row:last-child {
  margin-bottom: 0;
}

.chgl-info-row strong {
  color: #1a4b7a;
  min-width: 200px;
  display: inline-block;
}

/* Sekcja uwag */
#punkt-uwagi {
  background: #f9fafd;
  padding: 12px;
  border-left: 4px solid #1a4b7a;
}

#punkt-uwagi .chgl-info-section {
  background: #fff7e6;
  border-left: 4px solid #ffc107;
  margin-bottom: 0;
}

/* --- tabela danych --- */
.chgl-section {
  margin-bottom: 30px;
  background: #fff;
  border: 1px solid #e2e7eb;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  padding: 15px;
}

.chgl-section h4 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #1a4b7a;
  border-bottom: 2px solid #d3e0ef;
  padding-bottom: 4px;
}

.chgl-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.chgl-table th, .chgl-table td {
  border: 1px solid #d0d7de;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.9rem;
}

.chgl-table th {
  background: #e9f1fa;
  color: #003366;
  font-weight: 600;
}

.chgl-uwagi {
  background: #fff7e6;
  border-left: 4px solid #ffc107;
  padding: 10px;
  margin-bottom: 20px;
}

.no-data {
  color: #999;
  font-style: italic;
}

/* --- PROFESJONALNE PUNKTY NA MAPIE --- */
.chgl-professional-point {
  filter: drop-shadow(0 4px 8px rgba(26, 75, 122, 0.3));
}

.leaflet-interactive {
  cursor: pointer;
  transition: all 0.2s ease;
  shape-rendering: geometricPrecision;
  vector-effect: non-scaling-stroke;
}

.leaflet-interactive:hover {
  filter: drop-shadow(0 6px 12px rgba(26, 75, 122, 0.4));
  z-index: 1000 !important;
}

/* Gradient overlay dla punktów */
.leaflet-interactive:after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8) 0%, transparent 50%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.6;
}

/* Podświetlone punkty */
.chgl-highlighted-point {
    filter: drop-shadow(0 0 15px rgba(231, 76, 60, 0.8));

}


/* --- PROFESJONALNE TOOLTIPY --- */
.chgl-tooltip-container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: none !important;
}

.chgl-tooltip {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.05);
  font-family: inherit;
  min-width: 240px;
  backdrop-filter: blur(10px);
  pointer-events: none;
  animation: tooltipFadeIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chgl-tooltip-header {
  background: linear-gradient(135deg, #1a4b7a 0%, #2c5e8f 100%);
  color: white;
  padding: 12px 16px;
  border-radius: 11px 11px 0 0;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chgl-tooltip-header i {
  font-size: 0.9rem;
  opacity: 0.9;
}

.chgl-tooltip-content {
  padding: 16px;
}

.chgl-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}

.chgl-tooltip-row:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.chgl-tooltip-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chgl-tooltip-value {
  font-size: 0.85rem;
  color: #1e293b;
  font-weight: 600;
  text-align: right;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chgl-tooltip-footer {
  background: #f1f5f9;
  padding: 8px 16px;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 11px 11px;
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
  font-style: italic;
  font-weight: 500;
}

/* Strzałka tooltipa */
.chgl-tooltip-container.leaflet-tooltip-top::before {
  border-top-color: #1a4b7a !important;
}

/* --- PANEL WOJEWÓDZTW I PUNKTÓW --- */
.chgl-container {
  display: flex;
  height: 600px;
  gap: 20px;
  margin-bottom: 20px;
}

.chgl-sidebar {
  width: 300px;
  background: #fff;
  border: 1px solid #e2e7eb;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chgl-sidebar-header {
  background: linear-gradient(135deg, #c7e4ff 0%, #1d71c3 100%);
  color: black;
  padding: 16px;
  border-radius: 7px 7px 0 0;
  flex-shrink: 0;
}

.chgl-sidebar-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.chgl-wojewodztwa-list, .chgl-punkty-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.chgl-woj-item {
  padding: 12px 16px;
  margin: 4px 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #1a4b7a;
}

.chgl-woj-item:hover {
  background: #e9f1fa;
  border-color: #1a4b7a;
  transform: translateX(2px);
}

.chgl-woj-item.active {
  background: #1a4b7a;
  color: white;
  border-color: #1a4b7a;
}

.chgl-punkty-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chgl-list-header {
  background: #f1f5f9;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chgl-list-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chgl-back-btn {
  background: #64748b;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s ease;
}

.chgl-back-btn:hover {
  background: #475569;
}

.chgl-list-header h4 {
  margin: 0;
  color: #1a4b7a;
  font-size: 1rem;
}

.chgl-punkt-item {
  padding: 10px 14px;
  margin: 4px 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.chgl-punkt-item:hover {
  background: #f1f5f9;
  border-color: #1a4b7a;
}

.chgl-punkt-item.active {
  background: #e9f1fa;
  border-color: #1a4b7a;
  border-left: 4px solid #1a4b7a;
}

.chgl-punkt-nr {
  font-weight: 600;
  color: #1a4b7a;
}

.chgl-punkt-miejscowosc {
  color: #64748b;
  font-size: 0.85rem;
}

.chgl-map-container {
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* --- Z-INDEX MANAGEMENT --- */
.leaflet-tooltip {
  z-index: 2000 !important;
}

.leaflet-marker-icon {
  z-index: 1000;
}

.leaflet-marker-icon:hover {
  z-index: 3000 !important;
}

.leaflet-layer {
  shape-rendering: geometricPrecision;
}

/* --- RESPONSYWNOŚĆ --- */
@media (max-width: 768px) {
  .chgl-container {
    flex-direction: column;
    height: auto;
  }
  
  .chgl-sidebar {
    width: 100%;
    height: 300px;
  }
  
  .chgl-map-container {
    height: 400px;
  }
  
  .chgl-tooltip {
    min-width: 200px;
  }
  
  .chgl-tooltip-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  
  .chgl-tooltip-value {
    text-align: left;
    max-width: 100%;
  }
  
  .chgl-info-row strong {
    min-width: 140px;
    display: inline-block;
  }
  
  /* Responsywność tabel */
  .chgl-table, .chgl-table thead, .chgl-table tbody, .chgl-table th, .chgl-table td, .chgl-table tr {
    display: block;
  }
  
  .chgl-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .chgl-table tr {
    margin-bottom: 15px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 10px;
  }
  
  .chgl-table td {
    text-align: right;
    padding-left: 50%;
    position: relative;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    display: block;
  }
  
  .chgl-table td:last-child {
    border-bottom: none;
  }
  
  .chgl-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: 45%;
    white-space: nowrap;
    font-weight: bold;
    color: #1a4b7a;
    text-align: left;
  }
  
  /* Ustaw etykiety dla kolumn tabeli */
  .chgl-table td:nth-of-type(1):before { content: "Parametr"; }
  .chgl-table td:nth-of-type(2):before { content: "Jednostka"; }
  .chgl-table td:nth-of-type(3):before { content: "1995"; }
  .chgl-table td:nth-of-type(4):before { content: "2000"; }
  .chgl-table td:nth-of-type(5):before { content: "2005"; }
  .chgl-table td:nth-of-type(6):before { content: "2010"; }
  .chgl-table td:nth-of-type(7):before { content: "2015"; }
  .chgl-table td:nth-of-type(8):before { content: "2020"; }
  .chgl-table td:nth-of-type(9):before { content: "2025"; }
}

/* Poprawki dla małych ekranów - dodatkowe */
@media (max-width: 480px) {
  #punkt-details {
    padding: 15px;
    margin-top: 15px;
  }
  
  .chgl-section {
    padding: 10px;
    margin-bottom: 20px;
  }
  
  .chgl-info-section {
    padding: 12px;
  }
  
  .chgl-sidebar-header {
    padding: 12px;
  }
  
  .chgl-woj-item, .chgl-punkt-item {
    padding: 10px 12px;
  }
}


