/* Estilos base */
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

.container {
    background-color: rgba(255, 255, 255, 0.8); /* Fondo blanco con 80% de opacidad */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 300px;
}

.input-group {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 16px;
}

#country-selector {
    width: 30%;
    margin-right: 10px;
}

input[type="tel"] {
    flex: 1;
    padding: 10px;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    max-width: 200px;
}

button:hover {
    background-color: #45a049;
}

#result {
    margin-top: 20px;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    display: none;
}

#map {
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1; /* Asegura que el mapa esté detrás del contenido principal */
}

/* Estilos para el popup */
.popup {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fondo oscuro semi-transparente */
    z-index: 9999;
}

.popup-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 90%;
    max-width: 600px;
    height: 90%;
    max-height: 600px;
}

.map-container {
    position: relative;
    height: 70%;
    width: 100%;
}

.map-popup {
    height: 100%;
    width: 100%;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

.blur-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(128, 128, 128, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    z-index: 3;
}

.blur-message {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    text-align: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    z-index: 4;
}

.access-code-message {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    text-align: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    z-index: 4;
    width: 90%;
    max-width: 400px;
}

.input-group-code {
    position: relative;
    width: 100%;
}

.input-group-code input {
    padding: 10px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.access-code-message button {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    width: 100%;
}

.request-code-button {
    padding: 10px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    max-width: 200px;
    animation: heartbeat 1.5s infinite;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.request-code-button:hover {
    background-color: #0056b3;
}

.gps-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    background: url('http://maps.google.com/mapfiles/ms/icons/blue-dot.png') no-repeat center center;
    background-size: cover;
    display: none;
    z-index: 2;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #ddd;
    border-radius: 10px;
    margin-top: 10px;
    overflow: hidden;
    z-index: 2;
}

.progress {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    border-radius: 10px;
    transition: width 1s ease-in-out; /* Transición suave */
}

.error {
    color: red;
}

/* Estilos para el error popup */
.error-popup {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fondo oscuro semi-transparente */
    z-index: 10000;
}

.error-popup-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.error-popup-content p {
    color: #333;
    font-size: 16px;
    margin-bottom: 20px;
}

.error-popup-content button {
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.error-popup-content button:hover {
    background-color: #45a049;
}

/* Estilos para el loading popup */
.loading-popup {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fondo oscuro semi-transparente */
    z-index: 10000;
}

.loading-popup-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.loading-circle {
    border: 16px solid #f3f3f3;
    border-top: 16px solid #3498db;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
}

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

.loading-popup-content p {
    color: #333;
    font-size: 16px;
    margin-top: 20px;
}

#secondaryAppButton {
    padding: 10px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#secondaryAppButton:hover {
    background-color: #0056b3;
}

/* Animación de los puntos suspensivos */
@keyframes dot-blink {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

#popupMessage::after {
    content: '';
    animation: dot-blink 1.5s infinite linear;
}

/* Estilos responsivos */
@media screen and (max-width: 768px) {
    .popup-content {
        width: 95%;
        height: 95%;
    }
    .access-code-message {
        top: 50%;
        width: 95%;
    }
    .blur-message {
        top: 5%;
    }
    .access-code-message p,
    .access-code-message button,
    .input-group-code input {
        width: 100%;
        margin-bottom: 10px;
    }
    .input-group-code {
        flex-direction: column;
    }
}
