/* Estilos de encabezados */
body[data-page='gestionar-rutas'] h1,
body[data-page='localidades'] h1 {
    text-align: center;
    font-weight: 300;
    font-size: 2.2rem;
    color: #333;
    margin: 30px 0;
}

.help-text {
    text-align: center;
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
}

/* Ajuste del contenedor principal */
.container {
    width: 90%;
    height: 90vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Rutas y usuarios ocupando más espacio */
.rutas-usuarios {
    display: flex;
    justify-content: space-between;
    flex-grow: 1;
    margin: 20px 0;
    gap: 20px;
}

/* Ajustar los contenedores de rutas y usuarios */
.rutas-container,
.usuarios-container {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    background-color: #f9f9f9;
    height: calc(100% - 40px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    justify-content: center;
}

/* Listas grandes para mostrar elementos más amplios */
.large-list {
    width: 100%;
    height: 100%;
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Estilo para cada elemento de la lista */
.list li {
    padding: 15px;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Hover y selección para resaltar */
.list li:hover {
    background-color: #e0f7fa;
    transform: scale(1.02);
}

/* Resaltar todo el contenedor del usuario */
.highlight {
    box-sizing: border-box;
    width: 100%;
    background-color: #ffe082; /* Fondo amarillo claro */
    border: 2px solid #ffca28; /* Borde más visible */
    font-weight: bold;
    border-radius: 5px;
    padding: 10px; /* Asegúrate de que incluye suficiente espacio */
    display: flex; /* Asegura que todos los elementos internos estén alineados */
    align-items: center; /* Centrar verticalmente el contenido */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Añadir un efecto de sombra */
    transition: background-color 0.3s ease, box-shadow 0.3s ease; /* Transiciones suaves */
}

/* Botones y campos de entrada separados debajo */
.add-actions {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    gap: 20px;
}

.add-actions div {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: flex-start;
}

/* Contenedor para registrar usuarios en una sola línea */
.user-registration {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.user-registration input {
    width: auto;
    margin-bottom: 0;
}

.add-actions input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.add-actions button {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    background-color: #d32f2f;
    color: #fff;
    border: none;
    transition: background-color 0.3s ease;
}

.add-actions button:hover {
    background-color: #c62828;
}

/* Botón de acción central */
.actions {
    text-align: center;
    margin-top: 20px;
}

.actions .btn {
    padding: 15px 30px;
    font-size: 20px;
    border-radius: 8px;
    cursor: pointer;
    background-color: #d32f2f;
    color: #fff;
    border: none;
    transition: background-color 0.3s ease;
}

.actions .btn:hover {
    background-color: #c62828;
}

.localidadesContainer {
    width: 90%;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#localidadesList {
    width: 100%;
    max-width: 600px;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

#localidadesList li {
    padding: 15px;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#localidadesList li:hover {
    background-color: #e0f7fa;
}

#logoutButton {
    margin-top: 20px;
    align-self: center;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    background-color: #d32f2f;
    color: #fff;
    border: none;
    transition: background-color 0.3s ease;
}

#logoutButton:hover {
    background-color: #c62828;
}

#backButton {
    margin-top: 20px;
    align-self: center;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    background-color: #d32f2f;
    color: #fff;
    border: none;
    transition: background-color 0.3s ease;
}

#backButton:hover {
    background-color: #c62828;
}

/* Ajuste del contenedor principal */
.loginContainer {
    width: 100%;
    height: 100vh; /* Ocupa toda la altura de la pantalla */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centra verticalmente */
    align-items: center; /* Centra horizontalmente */
    background-color: #f5f5f5; /* Fondo claro */
    text-align: center; /* Centra el texto */
}

/* Estilo de los campos de entrada */
.input-field {
    width: 100%;
    max-width: 400px; /* Ancho máximo para los campos */
    padding: 15px;
    margin-bottom: 20px;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Cambios en hover/focus */
.input-field:focus {
    border-color: #d32f2f;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Estilo del botón */
.btn {
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    background-color: #d32f2f;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Hover en botón */
.btn:hover {
    background-color: #c62828;
    transform: scale(1.05);
}

/* Estilo de los radiobuttons y checkboxes */
input[type="radio"],
input[type="checkbox"] {
    accent-color: #d32f2f;
    cursor: pointer;
}

/* Responsividad */
@media (max-width: 600px) {
    .input-field {
        font-size: 16px;
    }

    .btn {
        font-size: 16px;
    }
}

.hidden-input {
    display: none;
}

.btn {
    display: block;
    width: 100%;
    max-width: 300px; /* Ajusta según el tamaño que necesites */
    margin: 10px 0;
    padding: 10px 20px;
    text-align: center;
    background-color: #d32f2f;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background-color: #c62828;
}

.blurred {
    filter: blur(4px);
    pointer-events: none; /* Esto evita que los elementos sean clickeables mientras están desenfocados */
    opacity: 0.6; /* Reduce la opacidad para dar un efecto visual adicional */
}

/* Contenedor principal para cada ruta */
.ruta-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    gap: 10px;
}

.ruta-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.progreso-link {
    text-decoration: none;
    color: #d32f2f;
    display: flex;
    align-items: center;
}

.progreso-disabled {
    color: #999;
    pointer-events: none;
}


.progreso-link::after {
    content: "\2B07";
    font-size: 14px;
    margin-left: 4px;
}

/* Contenedor de los botones de cerrar sesión */
.logout-button-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

/* Ajustes para que los botones de navegación mantengan la altura y no
   ocupen todo el ancho */
.logout-button-container .btn {
    display: inline-block;
    width: auto;
    max-width: none;
    margin: 0;
}

.back-arrow {
    position: absolute;
    top: 20px;
    left: 20px;
    text-decoration: none;
    font-size: 24px;
    color: #d32f2f;
}

.back-arrow:hover {
    color: #c62828;
}

.delete-btn {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-size: 16px;
    margin-left: 0;
}

.delete-btn::before {
    content: "|";
    color: #999;
    margin-right: 6px;
}

.delete-btn:hover {
    color: #c62828;
}

.usuario-item {
    display: flex;
    align-items: center;
}

.usuario-item .usuario-label {
    flex: 1;
}

.usuario-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.estado-asignacion {
    cursor: pointer;
    font-weight: bold;
}

.asignada-label {
    color: #4caf50;
    font-weight: bold;
    margin-right: 10px;
}

.ruta-seleccionada {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
    border: 2px solid #4caf50;
    background-color: #e8f5e9;
}

/* Encabezado de rutas con botón a la derecha */
.rutas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.registrar-ruta-btn {
    margin-left: auto;
}

.usuarios-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.registrar-usuario-btn {
    margin-left: auto;
}


.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popup-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 500px;
}

.popup-logo {
    width: 40px;
    height: 40px;
    background-color: transparent;
}

.popup-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.popup-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.popup-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 10px;
    margin-top: 10px;
}

.popup-form .input-field {
    width: 100%;
    max-width: none;
}

.popup-titulo {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 10px;
}
.map-btn{
    background:none;
    border:none;
    color:#d32f2f;
    cursor:pointer;
    font-size:16px;
}
.map-btn svg{
    width:1em;
    height:1em;
    fill:currentColor;
    vertical-align:middle;
}
.map-btn::before{
    content:"|";
    color:#999;
    margin-right:6px;
}
.map-btn:disabled{
    color:#999;
    cursor:default;
}
#mapa{
    width:100%;
    height:100vh;
}
.mapa-popup{
    width:80vw;
    height:80vh;
    max-width:none;
    max-height:none;
}
.mapa-popup iframe{
    width:100%;
    height:100%;
    border:none;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-box {
    background: #fff;
    padding: 20px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #eee;
    border-top-color: #d32f2f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text { color: #333; font-weight: 500; }

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

/* Spinner específico para carga de rutas */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

.loading-spinner::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* Contenedor de progreso para rutas */
#rutas-progress {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
    text-align: center;
}

#rutas-progress .loading-spinner {
    padding: 20px;
    margin: 0;
}

/* Contenedor de progreso para usuarios */
#usuarios-progress {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
    text-align: center;
}

#usuarios-progress .loading-spinner {
    padding: 20px;
    margin: 0;
}

/* Contenedor de progreso para localidades */
#localidades-progress {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
    text-align: center;
}

#localidades-progress .loading-spinner {
    padding: 20px;
    margin: 0;
}

/* Spinner específico para la lista de localidades */
#localidadesList .loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 16px;
    width: 100%;
    height: 200px; /* Altura fija para centrar verticalmente */
}
