#map {
    width: 100%;
    height: 100vh;
}

#html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    height: 100vh;
    width: 100%;
}

/* Estilo personalizado para el tooltip */
.camera-tooltip {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 5px;
    border-radius: 3px;
}

#filter-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
}

#jurisdictions {
    width: 200px;
    padding: 5px;
}


/* Estilo para el popup fijo en la esquina derecha */
.camera-info-popup {
    position: fixed;
    top: 1%;
    right: 1%;
    width: fit-content;
    height: 200px;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.75);
    color: rgb(0, 0, 0);
    padding: 10px;
    border-radius: 5%;
    display: none;
    /* Iniciar oculto */
    z-index: 9999;
    /* Asegurarse de que esté sobre otros elementos */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);

}

.camera-info-popup h3 {
    font-size: 18px;
    padding: 0px;
    margin: 0;
    margin-bottom: 10px;
    text-align: center;
}

.camera-info-popup p {
    margin: 0px 0;
}

.camera-info-popup span {
    font-weight: bold;
}

/* Estilo general para el contenedor de la búsqueda de cámaras */
#cameraSearch {
    z-index: 1000;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    width: 100%;
    box-sizing: border-box;
}

#cameraSearch .title {
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.switch-container {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch-label {
    font-size: 14px;
    color: #333;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Estilos cuando el switch está deshabilitado */
.switch input:disabled+.slider {
    background-color: #e0e0e0;
    cursor: not-allowed;
}

.switch input:disabled+.slider:before {
    background-color: #bdbdbd;
}

/* Estilo para el texto de label cuando está deshabilitado */
.switch-container.disabled .switch-label {
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Cursor no permitido para el slider también */
.switch-container.disabled .slider {
    cursor: not-allowed;
}


.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #4CAF50;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.btn {
    display: block;
    width: 100%;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

/* Widget Jurisdicciones (versión compacta) */
#jurisdictionWidget {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    width: 190px;
    box-sizing: border-box;
    font-size: 12px;
    color: #333;
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 34px;
    z-index: 1000;
}

#jurisdictionWidget.open {
    max-height: 220px;
}

#jurisdictionToggle {
    width: 100%;
    background-color: #ffffff;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 8px;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    font-weight: bold;
}

#jurisdictionList {
    padding: 8px;
    overflow-y: auto;
    max-height: 160px;
}

#jurisdictionList ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#jurisdictionList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding: 5px 6px;
    border-radius: 5px;
    transition: background-color 0.2s;
    cursor: pointer;
    font-size: 11px;
}

#jurisdictionList li:hover {
    background-color: #f5f5f5;
}

#jurisdictionCountList li.total-item {
    pointer-events: none;
    /* Para asegurarte de que no se pueda clicar */
    background-color: #f0f0f0;
    /* Color más claro opcional */
    font-weight: bold;
}

#jurisdictionCountList li.total-item em {
    font-weight: normal;
    font-style: italic;
    color: #666;
    font-size: 10px;
}

#jurisdictionCountList li.active {
    background-color: #007BFF;
    color: white;
    border-radius: 4px;
}

#jurisdictionCountList li.active .badge {
    background-color: #ffffff;
    color: #007BFF;
    border-radius: 4px;
}

#jurisdictionCountList li .badge {
    background-color: #007BFF;
    color: white;
    padding: 1px 6px;
    border-radius: 12px;
    font-size: 10px;
}



@media (max-width: 500px) {
    #cameraSearch {
        max-width: 90%;
        left: 50%;
        transform: translateX(-50%);
    }

}

.custom-icon svg {
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.2));
    z-index: 1500;
}


/* Estilos del popup */
.custom-popup {
    position: fixed;
    bottom: 50%;
    right: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

/* Enlace del popup */
.custom-popup a {
    color: #1e90ff;
    text-decoration: none;
    font-weight: bold;
}

.custom-popup a:hover {
    text-decoration: underline;
}

/* Animación de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}




#loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    /* Fondo más claro */
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 5px solid #b6b6b6;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.pulsing-icon {
    width: 20px;
    height: 20px;
    background: #4285F4;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(66, 133, 244, 0.6);
    position: relative;
}

.pulsing-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(66, 133, 244, 0.4);
    transform: translate(-50%, -50%);
    animation: pulse 1.5s infinite ease-out;
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.4);
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }

    100% {
        transform: translate(-50%, -50%) scale(8);
        opacity: 0;
    }
}





.minimal-polygon {
    filter: none;
}


.jurisdiction-label .label-content:hover {
    opacity: 1;
}



@keyframes shrinkVision {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.5);
        opacity: 0;
    }
}

@keyframes expandVision {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.vision-gradient {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 204, 113, .5) 50%, rgba(46, 204, 113, 0) 100%);
    position: absolute;
    pointer-events: none;
    animation: expandVision 1s ease-out;
}

.vision-gradient.exit {
    animation: shrinkVision 0.5s ease-in forwards;
}

.vision-gradient-180 {
    width: 150px;
    height: 75px;
    background: radial-gradient(
        ellipse at center bottom,
        rgba(46, 204, 113, .7) 30%,
        rgba(46, 204, 113, 0) 100%
    );
    border-top-left-radius: 150px;
    border-top-right-radius: 150px;
    position: absolute;
    bottom: 0;
    left: 0;
    pointer-events: none;
    animation: expandVision 1s ease-out;
    transform-origin: center bottom;
}

.vision-gradient-180.exit {
    animation: shrinkVision 0.5s ease-in forwards;
}

.rotated-container {
    position: absolute;
    width: 150px;
    height: 75px;
    left: 0;
    top: 0;
    transform-origin: center bottom;
    pointer-events: none;
}

/* Estilos para radio buttons de tipo de cámaras */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    gap: 6px;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #007BFF;
}

.radio-label span {
    user-select: none;
}

.radio-label:hover span {
    color: #007BFF;
}
