/* Resets bàsics */
#sidebar { /* o el selector que utilitzes per al sidebar */
    height: 100vh; /* altura del viewport */
    overflow-y: auto; /* activa el desplaçament vertical */
}

.icona-capa {
  width: 12px;
  height: 12px;
  margin-left: 6px;
  vertical-align: middle;
}

.leaflet-tooltip.tooltip-personalitzat {
  background-color: #EDE8F5;  /* Fons fosc */
  color: #3D52A0;             /* Text blanc */
  border: 1px solid #888;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}




/* Perquè el sidebar estigui ocult al principi */
.leaflet-sidebar {
    display: none; /* Estarà ocult per defecte */
    position: absolute;
    top: 10px;
    left: 70px;
    width: 450px;
    height: calc(100% - 20px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

#tooltip-capes {
 display:none;
 position:absolute;
 top:80px; 
 left:50px;
 background:#EDE8F5;
 color:#8697C4;  
 border:1px solid #cc0;
 padding:10px;
 border-radius:5px;
 z-index:10000;
} 

/* Quan estigui actiu, que es mostri */
.leaflet-sidebar.active {
    display: block; /* Mostrar el sidebar */
}

/* Botó de plegar/desplegar */
.sidebar-toggle-btn {
    position: absolute;
    width: 35px;
    height: 35px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    padding: 0;
    cursor: pointer;
    z-index: 1001;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
    top: 10px;
    left: 10px;
}

.sidebar-toggle-btn:focus {
    outline: none;
}

  

.sublevel-content {
    padding-left: 15px;
    display: none; /* Plegat per defecte */
    transition: all 0.3s ease;
}

.expanded {
    display: block !important; /* Expandit quan s'obri */
}

#sidebar-content {
    display: flex;
    flex-direction: column;
    margin: 10px;
}

#sidebar.closed {
  transform: translateX(-100%);
  pointer-events: none; /* Evita que rebi clics */
  transition: transform 0.3s ease;
}




/* Contenidor del mapa */
#map {
    margin-top: 30px; /* Ajusta aquest valor a l'altura de la teva navbar */
    height: calc(100vh - 30px); /* El mapa ocupa tota la finestra menys l'alçada de la navbar */
    position: relative;
}




html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    padding-top: 0px;  
}


/* Taula dins del sidebar */
#table-body {
    flex-grow: 1;
    overflow-y: auto;
}


th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 12px;
}

tbody tr:hover {
    background-color: #f1f1f1;
}


#layerwatch {
    font-size: 12px;
}

/* Estils generals */
.marker-desc {
    width: 250px;
    min-height: 80px;
    text-align: justify;
    color: #333;
    font-size: 14px;
    padding: 10px;
}

.button-map {
    background: #333;
    color: #fff;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 10px 30px;
    margin-bottom: 20px;
}

.button-map:hover {
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.5s;
}

/* Botó de tancament */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#map-list-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    padding: 10px;
    font-size: 14px;
}

/* Ajustos de mida i padding */
.small-label {
    font-size: 0.8rem;
}

.small-range {
    height: 8px;
}

.small-padding {
    padding: 2px;
}

.form-check-label {
    font-size: 0.8rem;
}

h44 {
    font-size: 14px;
    margin: 0;
    font-style: italic;
    color: #006400;
}

.radio-group {
    display: flex;
    align-items: center;
}

.radio-group label {
    margin-right: 25px;
}

.icona-seleccionada {
    background-color: grey;
    border-radius: 8px;
    padding: 4px;
}



.sidebar-header {
    padding: 10px;
    font-size:14px;
    background: #3D52A0;
    color: #EDE8F5;
    font-weight: bold;
}

.control-section {
    padding: 10px;
}

.back01 {

    background: #ADBBDA;

}

.layer-group-title {
    cursor: pointer;
    font-weight: bold;
    margin: 10px 0 5px;
    color: #007bff;
    display: flex;
    align-items: center;
}

.toggle-icon {
    cursor: pointer;
    margin-right: 5px;
    user-select: none;
    transition: transform 0.2s ease;
}

.expanded + .toggle-icon {
    transform: rotate(90deg);
}


/* Indentació visual per nivells */
.checkbox-indent-1 {
    padding-left: 15px;
}
.checkbox-indent-2 {
    padding-left: 30px;
}
.checkbox-indent-3 {
    padding-left: 45px;
}


/* Posicionament individual */
#sidebar-toggle {
    top: 80px;
    left: 10px;
}

#sidebar-toggle2 {
    top: 130px; /* apareix sota el primer */
    left: 10px;
}


.icon-with-r {
    position: relative;
    font-size:12px;
}

.overlay-r {
    position: absolute;
    top: 4px;
    left: 12px;
    font-size: 12px; /* 🔽 Aquesta línia fa la R més petita */
    font-weight: bold;
    color: #3D52A0;
    pointer-events: none;
}

.ModalLabell {
    background: #3D52A0 !important;
}

.btn-dangerM {
    color:white;
    background: #964734;
  } 

.btn-primaryM {
color: #3D52A0;
background: #EDE8F5;
}

.btn-secondaryM {
color: #3D52A0;
background: #EDE8F5;
}

.Pugi {
    color: #3D52A0;
   
    }

#tableContainer {
    position: relative;
    border: 1px solid #ccc;
  }

#tableContainer thead th {
    position: sticky;
    top: 0;
    background-color: #7091E6;
    color: white;
    z-index: 2;
    cursor: pointer;
    border-bottom: 1px solid #ccc;
}

.mapestructura-text {
    color: #3D52A0;
    font-size: 12px;
    text-align: right;
    margin-right: 10px;
    margin-top: 4px; /* o el marge que prefereixis */
  }

.close-btn {
    color: white; /* Color del text */
    background: #3D52A0;
    border: none;
  
    font-size: 12px;
    cursor: pointer;
    position: absolute;
   
    right: 10px; /* Distància des de la dreta */
}

 .leaflet-sidebar.closed {
    display: none; /* Mostrar el sidebar */
  }

.modal-content-B {
  position: relative;
  background-image: url('../imatges/gra.jpg');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.modal-content-B .overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.6); /* blanc amb opacitat */
  z-index: 1;
}

.modal-content-B > *:not(.overlay) {
  position: relative;
  z-index: 2; /* assegura que el contingut està per sobre */
}

 


  