/* Evita el scroll global pero permite refrescar */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: auto; /* Permite el scroll para refrescar en móviles */
    -webkit-overflow-scrolling: touch; /* Desplazamiento más fluido en iOS */
}

/* BODY */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    background-color: #333;
    width: 100%;
    height: 100%;
    position: relative;
}

/* HEADER CON SCROLL Y REFRESCO */
header {
    position: relative;
    z-index: 1500;
    touch-action: auto;
    pointer-events: auto;
    overflow: auto;
    max-height: 120px;
}

/* Contenedor del mapa */
#map-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    pointer-events: none;
}

/* Mapa */
#map {
    height: 100%;
    background-color: #33333300;
    pointer-events: auto; /* Permite interacción */
    touch-action: none; /* Bloquea el zoom y el desplazamiento dentro del mapa */
}

/* Estilos para móviles */
@media (max-width: 768px) {
    body {
        overflow: auto; /* Permite el gesto de refrescar */
    }

    #map-container {
        height: 100%;
    }

    #map {
        height: 100%;
    }
}

/* Estilos para el título */
#title {
    width: 100%;
    text-align: center;
    background-color: #333;
    color: white;
    padding: 0;
    font-size: 0.5rem;
    box-sizing: border-box;
    z-index: 1200;
    display: inline-block;
    margin-top: -3px;
    margin-bottom: 2px;
}


.content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#header {
    background-color: #333;
    color: white;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Divide el espacio entre los elementos */
    position: relative;
    z-index: 9998;
}

#header-content {
    flex-grow: 1;                 /* Permite que el contenedor ocupe el espacio restante */
    display: flex;
    justify-content: center;      /* Centra el título dentro del contenedor */
    align-items: center;          /* Alinea el título verticalmente */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);  /* Centra el contenedor horizontalmente */
}

#header img.logo {
    cursor: pointer;
    width: 30px;
    height: 30px;
}

/* Contenedor del logo con menú desplegable */
    #logo-menu {
        position: relative;
        display: inline-block;
    }

    .logo {
        width: 50px;
        height: 50px;
        cursor: pointer;
    }

    /* Estilos del menú desplegable del logo */
    #dropdown-logo {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #444;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        min-width: 180px;
        z-index: 1000;
        overflow: hidden;
    }

    #dropdown-logo a {
        color: white;
        padding: 12px 20px;
        text-decoration: none;
        display: block;
        font-size: 16px;
        transition: background-color 0.3s;
    }

    #dropdown-logo a:hover {
        background-color: #555;
    }

    #logo-menu:hover #dropdown-logo {
        display: block;
    }

#header h1 {
    margin: 0;
    font-size: 18px;
    text-align: center;
}

#user-language-container {
    display: flex;
    align-items: center;
}

#user-language-container #language-menu {
    margin-right: 1px;           /* Ajusta el espaciado entre el menú de idioma y el menú de usuario */
}

#user-language-container #user-menu img {
    width: 30px;
    height: 30px;
    cursor: pointer;
}


#user-language-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

#language-menu {
    position: relative;
}

#selected-language-flag {
    cursor: pointer;
    width: 30px;
    height: auto;
}

#dropdown-language {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #444;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    z-index: 1000;
    overflow: hidden;
}

#dropdown-language a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: white;
    font-size: 14px;
    transition: background-color 0.3s;
}

#dropdown-language a img {
    width: 20px;
    height: auto;
    margin-right: 8px;
}

#dropdown-language a:hover {
    background-color: #f1f1f1;
}

#language-menu:hover #dropdown-language {
    display: block;
}


#user-menu {
    position: relative;
}

#user-icon {
    width: 30px;
    height: 30px;
    cursor: pointer;
}

#dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #444;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

#dropdown-menu a {
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 16px;
    transition: background-color 0.3s;
}

#dropdown-menu a:hover {
    background-color: #555;
}

#user-menu:hover #dropdown-menu {
    display: block;
}

.menu-wrapper {
    display: flex;
    justify-content: center;
    padding: 0;
    overflow: visible;
    box-sizing: border-box;
    background-color: #494949;
}

.menu {
    display: flex;
    gap: 5px; /* Reducimos el espacio entre elementos */
    padding: 5px; /* Reducimos el padding general */
    position: relative;
    align-items: center;
}

.menu-item {
    cursor: pointer;
    background-color: #494949;
    padding: 6px 12px; /* Reducimos el padding para hacerlo menos alto */
    border-radius: 4px;
    color: #fff;
    font-size: 16px; /* Reducimos ligeramente el tamaño del texto */
    transition: background-color 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item:hover, .menu-item.active {
    background-color: #666;
}

.menu-item a {
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
}

.submenu {
    display: none;
    position: absolute;
    top: calc(100% + 3px); /* Reducimos el espacio debajo del menú */
    left: 0;
    background-color: #444;
    border-radius: 6px;
    min-width: 110px;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.submenu a {
    display: block;
    color: white;
    padding: 8px 15px; /* Reducimos el padding dentro del submenu */
    text-decoration: none;
    font-size: 14px; /* Reducimos el tamaño del texto del submenu */
    transition: background-color 0.3s;
}

.submenu a:hover {
    background-color: #555;
}

.menu-item:hover .submenu,
.menu-item.active .submenu {
    display: block;
}

.menucountry-wrapper {
    display: flex;
    justify-content: center;
    overflow: visible; /* Permitir visibilidad del menú */
    padding: 0;
    box-sizing: border-box;
    background-color: #494949;
}

.menucountry {
    display: flex;
    gap: 5px; /* Reducimos el espacio entre elementos */
    padding: 5px; /* Reducimos el padding general */
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #aaa #f4f4f4;
    box-sizing: border-box;
}

.menucountry::-webkit-scrollbar {
    height: 6px; /* Reducimos la altura de la barra de scroll */
}

.menucountry::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
}

.menucountry a {
    text-decoration: none;
    padding: 6px 12px; /* Reducimos el padding para disminuir la altura */
    color: #fff;
    background-color: #494949;
    border-radius: 4px;
    transition: background-color 0.3s;
    flex-shrink: 0;
    font-size: 14px; /* Reducimos el tamaño del texto */
    display: flex;
    align-items: center; /* Asegurar que el texto está alineado verticalmente */
}

.menucountry a:hover {
    background-color: #444;
}


.login-container, .signup-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 360px;
    box-sizing: border-box;
}

.login-container h2, .signup-container h2 {
    margin: 0 0 20px;
    font-size: 28px;
    text-align: center;
    color: #333;
}

.login-container input, .login-container button,
.signup-container input, .signup-container button {
    width: calc(100% - 20px);
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-container input, .signup-container input {
    border-color: #ccc;
}

.login-container button, .signup-container button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-container button:hover, .signup-container button:hover {
    background-color: #0056b3;
}

.login-container .links, .signup-container .links {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-top: 15px;
}

.login-container .links a, .signup-container .links a {
    color: #007bff;
    text-decoration: none;
    transition: text-decoration 0.3s;
}

.login-container .links a:hover, .signup-container .links a:hover {
    text-decoration: underline;
}

#footer {
    background-color: #333;
    color: white;
    padding: 20px 10px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 14px;
    box-sizing: border-box;
}

#footer .links, #footer .social, #footer .contact {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    text-align: left;
    align-items: center;
}

#footer .links a, #footer .social a, #footer .contact a {
    color: white;
    text-decoration: none;
}

#footer .links a:hover, #footer .social a:hover, #footer .contact a:hover {
    text-decoration: underline;
}

#footer .social img, #footer .contact img {
    width: 24px;
    height: 24px;
}

#footer .copyright {
    margin-top: 10px;
}

/* Reset de márgenes y estilos básicos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}



/* MENÚ LATERAL (INICIALMENTE OCULTO) */
#ZoneMenu {
    position: fixed;
    top: 50%; /* Empieza desde la mitad de la pantalla */
    right: -300px; /* Menú oculto al principio */
    width: 300px;
    height: 50vh; /* La mitad de la altura de la pantalla */
    background-color: rgba(51, 51, 51, 0.5);
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-top-left-radius: 20px; /* Esquinas redondeadas */
    border-top-right-radius: 20px; /* Esquinas redondeadas */
    transition: right 0.3s ease-in-out; /* Animación para mover el menú */
    z-index: 1300;
}

/* Cuando se active la clase "active", el menú aparecerá */
#ZoneMenu.active {
    right: 0; /* El menú se desliza a la vista */
}

/* Botón para abrir/cerrar el menú */
#menu-toggle {
    position: fixed;
    top: 50%; /* Alinea el botón a la misma altura que el centro del menú */
    right: 0; /* Lo coloca justo al lado derecho del menú */
    background-color: #8c19f1;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 1100;
    transform: translateY(-50%); /* Ajuste para que esté perfectamente centrado verticalmente */
    transition: background 0.3s;
}

/* Cambia de color al pasar el ratón sobre el botón */
#menu-toggle:hover {
    background-color: #560f94;
}

/* MENÚ LATERAL (INICIALMENTE OCULTO) */
#ZoneMenu {
    position: fixed;
    top: 50%;
    right: -300px; /* Menú oculto */
    width: 300px;
    height: 50vh;
    background-color: rgba(51, 51, 51, 0.5);
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    
    /* Desactiva eventos cuando está oculto */
    pointer-events: none; 
}

/* Cuando el menú está activo (visible) */
#ZoneMenu.active {
    right: 0;
    pointer-events: auto; /* Permite interacción solo cuando está abierto */
}

/* Botón de apertura/cierre del menú */
#menu-toggle {
    position: fixed;
    top: 50%;
    right: 0;
    background-color: #8c19f1;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 1100;
    transform: translateY(-50%);
    transition: background 0.3s;
}

#menu-toggle:hover {
    background-color: #560f94;
}

/* Estilos para el cuadro de diálogo de confirmación */
.confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.confirmation-dialog-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.confirmation-dialog.hidden {
    display: none;
}

.confirmation-dialog-button {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #4CAF50;
}

.confirmation-dialog #confirm-delete {
    background-color: #f44336;
    color: white;
}

.confirmation-dialog #cancel {
    background-color: #4CAF50;
    color: white;
}

/* Estilos para el formulario de "Forgot Password" */
.forgot-password-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 360px;
    box-sizing: border-box;
    margin: auto; /* Asegura que el contenedor esté centrado */
}

.forgot-password-container h2 {
    margin: 0 0 20px;
    font-size: 28px;
    text-align: center;
    color: #333;
}

.forgot-password-container input,
.forgot-password-container button {
    width: calc(100% - 20px);
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

.forgot-password-container input {
    border-color: #ccc;
}

.forgot-password-container button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.forgot-password-container button:hover {
    background-color: #0056b3;
}

.forgot-password-container .links {
    display: flex;
    justify-content: center;
    font-size: 14px;
    margin-top: 15px;
}

.forgot-password-container .links a {
    color: #007bff;
    text-decoration: none;
    transition: text-decoration 0.3s;
}

.forgot-password-container .links a:hover {
    text-decoration: underline;
}

.privacy-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

.privacy-container h2 {
    margin: 0 0 20px;
    font-size: 28px;
    text-align: center;
    color: #333;
}

.privacy-container p, .privacy-container ul {
    line-height: 1.6;
    margin: 15px 0;
}

.privacy-container ul {
    margin-left: 20px;
}

.privacy-container ul li {
    margin-bottom: 10px;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.contact-container h2 {
    margin: 0 0 20px;
    font-size: 28px;
    text-align: center;
    color: #333;
}

.contact-container input, 
.contact-container textarea, 
.contact-container button {
    width: calc(100% - 20px);
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

.contact-container input,
.contact-container textarea {
    border-color: #ccc;
}

.contact-container textarea {
    resize: vertical; /* Permite cambiar el tamaño verticalmente */
}

.contact-container button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.contact-container button:hover {
    background-color: #0056b3;
}

.contact-container .links {
    display: flex;
    justify-content: center;
    font-size: 14px;
    margin-top: 15px;
}

.contact-container .links a {
    color: #007bff;
    text-decoration: none;
    margin: 0 10px;
    transition: text-decoration 0.3s;
}

.contact-container .links a:hover {
    text-decoration: underline;
}

.confirmation-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    text-align: center;
}

.confirmation-container h2 {
    margin: 0 0 20px;
    font-size: 28px;
    color: #333;
}

.confirmation-container p {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
}

.confirmation-container a {
    color: #007bff;
    text-decoration: none;
    font-size: 16px;
    transition: text-decoration 0.3s;
}

.confirmation-container a:hover {
    text-decoration: underline;
}

/* Estilos para el menú interactivo */
.interactive-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: rgba(0, 0, 0, 0.5); /* Fondo semitransparente */
    padding: 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

/* Estilos para dispositivos móviles */
.interactive-menu.mobile {
    display: flex;
    justify-content: space-around;
}


.interactive-menu.mobile .menu-icon {
    width: 48px;
    height: 48px;
    background-color: #333; /* Gris oscuro para botones no seleccionados */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.interactive-menu.mobile .menu-icon:hover {
    background-color: #555; /* Gris medio al pasar el ratón */
}

.interactive-menu.mobile .menu-icon.selected {
    background-color: #b4b4b4; /* Negro para los íconos seleccionados */
}

.interactive-menu.mobile .menu-icon img {
    width: 24px;
    height: 24px;
}

/* Estilos para pantallas grandes */
.interactive-menu.desktop {
    display: flex;
    justify-content: space-between; /* Espaciado en los extremos */
}

.interactive-menu.desktop .menu-icon {
    width: 48px;
    height: 48px;
    background-color: #333; /* Gris oscuro para botones no seleccionados */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    margin: 0 20px; /* Separación entre íconos */
}

.interactive-menu.desktop .menu-icon:hover {
    background-color: #555; /* Gris medio al pasar el ratón */
}

.interactive-menu.desktop .menu-icon.selected {
    background-color: #000; /* Negro para los íconos seleccionados */
}

.interactive-menu.desktop .menu-icon img {
    width: 24px;
    height: 24px;
}

/* Estilos para el iframe del overlay */

/* Contenedor general del overlay */
#route-creator-iframe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 999;
    pointer-events: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;  /* Incluye padding y border en las dimensiones del elemento */
}

#route-creator-iframe {
    width: 100%;
    height: calc(100% - 60px); /* Ajustado para dejar espacio para el botón */
    border: none;
    pointer-events: auto;
}

/* Estilos para el overlay de import-route (si es necesario) */
#import-route-iframe-container {
    position: fixed;
    bottom: 0; /* Desde la parte inferior */
    left: 0; /* Alineado a la izquierda */
    width: 100%; /* Ocupa el 100% del ancho */
    height: auto; /* Altura ajustable */
    max-height: 300px; /* Altura máxima para el overlay de importación */
    background-color: rgba(255, 255, 255, 0.95); /* Fondo blanco con más opacidad */
    z-index: 999; /* Un nivel por debajo del overlay principal */
    pointer-events: auto; /* Permitir interacción con el overlay */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5); /* Sombra hacia arriba */
    display: flex; /* Usar flexbox para centrar contenido */
    flex-direction: column; /* Apilar verticalmente */
    margin-bottom: 70px;
}

/* Iframe del overlay de importación */
#import-route-iframe {
    width: 100%; /* Ocupa todo el ancho del contenedor */
    height: calc(100% - 10px); /* Ajusta según necesites */
    border: none;
    pointer-events: auto; /* Habilitar interacción dentro del iframe */
}

/* Mensaje flotante centrado */
#login-message-overlay {
    position: absolute;
    top: 20px; /* Espacio desde la parte superior */
    left: 50%;
    transform: translateX(-50%); /* Centrar horizontalmente */
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 999; /* Alto para superponerlo sobre el mapa */
    text-align: center;
}

#login-message-overlay a {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

#login-message-overlay a:hover {
    background: #0056b3;
}

#trace-route-iframe-container {
    position: fixed;
    bottom: 0; /* Desde la parte inferior */
    left: 0; /* Alineado a la izquierda */
    width: 100%; /* Ocupa el 100% del ancho */
    height: auto; /* Altura ajustable */
    max-height: 300px; /* Altura máxima para el overlay de importación */
    z-index: 999; /* Un nivel por debajo del overlay principal */
    pointer-events: auto; /* Permitir interacción con el overlay */
    display: flex; /* Usar flexbox para centrar contenido */
    flex-direction: column; /* Apilar verticalmente */
    margin-bottom: 60px;
}

/* Iframe del overlay de trazado */
#trace-route-iframe {
    width: 100%; /* Ocupa todo el ancho del contenedor */
    height: calc(100% - 60px); /* Ajusta según necesites */
    border: none;
    pointer-events: auto; /* Habilitar interacción dentro del iframe */
    padding: 10px;
}

.route-close-button {
    position: absolute;
    top: 10px;            /* Mantiene la distancia desde la parte superior */
    right: 20px;          /* Aumenta la distancia desde el borde derecho para moverlo hacia la izquierda */
    background: #ff0000;
    color: white;
    border: none;
    font-size: 14px;      /* Mantiene la X del tamaño adecuado */
    width: 20px;          /* Tamaño pequeño del círculo */
    height: 20px;         /* Tamaño pequeño del círculo */
    cursor: pointer;
    border-radius: 50%;   /* Redondea el botón */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); /* Sombra sutil */
}





