/* Estilos para el frontend de Capturar GEO GF */

/* Mensajes de geolocalización */
.geo-gf-message {
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 4px solid;
    animation: geo-gf-slide-down 0.3s ease-out;
}

.geo-gf-message.geo-gf-info {
    background-color: #e7f3ff;
    border-left-color: #2271b1;
    color: #1d2327;
}

.geo-gf-message.geo-gf-error {
    background-color: #ffeaea;
    border-left-color: #d63638;
    color: #1d2327;
}

.geo-gf-message.geo-gf-success {
    background-color: #e8f5e8;
    border-left-color: #00a32a;
    color: #1d2327;
}

.geo-gf-message.geo-gf-warning {
    background-color: #fff8e1;
    border-left-color: #f56e28;
    color: #1d2327;
}

/* Animación de entrada */
@keyframes geo-gf-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de carga para formularios */
.geo-gf-loading-form {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.geo-gf-loading-form::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: geo-gf-spin 1s linear infinite;
    z-index: 1000;
}

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

/* Estilos para botones deshabilitados */
.geo-gf-disabled-button {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Overlay para bloquear interacción */
.geo-gf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 999;
    display: none;
}

.geo-gf-overlay.active {
    display: block;
}

/* Mensaje de ubicación con icono */
.geo-gf-message::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.geo-gf-message.geo-gf-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232271b1' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}

.geo-gf-message.geo-gf-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23d63638' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

.geo-gf-message.geo-gf-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2300a32a' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.geo-gf-message.geo-gf-warning::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23f56e28' viewBox='0 0 24 24'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
}

/* Responsive */
@media (max-width: 768px) {
    .geo-gf-message {
        padding: 10px 12px;
        font-size: 13px;
        margin: 10px 0;
        color: #fff !important; /* Forzar color blanco en móvil */
    }
    
    .geo-gf-message::before {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
    
    /* Forzar colores específicos para cada tipo de mensaje en móvil */
    .geo-gf-message.geo-gf-info {
        background-color: #2271b1 !important; /* Fondo azul sólido */
        border-left-color: #fff !important; /* Borde blanco */
        color: #fff !important; /* Texto blanco */
    }
    
    .geo-gf-message.geo-gf-error {
        background-color: #d63638 !important; /* Fondo rojo sólido */
        border-left-color: #fff !important; /* Borde blanco */
        color: #fff !important; /* Texto blanco */
    }
    
    .geo-gf-message.geo-gf-success {
        background-color: #00a32a !important; /* Fondo verde sólido */
        border-left-color: #fff !important; /* Borde blanco */
        color: #fff !important; /* Texto blanco */
    }
    
    .geo-gf-message.geo-gf-warning {
        background-color: #f56e28 !important; /* Fondo naranja sólido */
        border-left-color: #fff !important; /* Borde blanco */
        color: #fff !important; /* Texto blanco */
    }
    
    /* Iconos blancos para móvil */
    .geo-gf-message.geo-gf-info::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
    }
    
    .geo-gf-message.geo-gf-error::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
    }
    
    .geo-gf-message.geo-gf-success::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    }
    
    .geo-gf-message.geo-gf-warning::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
    }
    
    /* Asegurar que todos los elementos hijos también sean blancos */
    .geo-gf-message * {
        color: #fff !important;
    }
}

/* Estilos para formularios específicos de Gravity Forms */
.gform_wrapper .geo-gf-message {
    margin: 0 0 15px 0;
}

/* Compatibilidad con temas oscuros */
@media (prefers-color-scheme: dark) {
    .geo-gf-message {
        color: #f0f0f1;
    }
    
    .geo-gf-message.geo-gf-info {
        background-color: #1e3a5f;
        border-left-color: #4f94d4;
    }
    
    .geo-gf-message.geo-gf-error {
        background-color: #5c1e1e;
        border-left-color: #e65054;
    }
    
    .geo-gf-message.geo-gf-success {
        background-color: #1e3a1e;
        border-left-color: #4ab866;
    }
    
    .geo-gf-message.geo-gf-warning {
        background-color: #5c4a1e;
        border-left-color: #f78b3d;
    }
}

/* Accesibilidad */
.geo-gf-message {
    role: alert;
    aria-live: polite;
}

.geo-gf-message.geo-gf-error {
    aria-live: assertive;
}

/* Estilos para pantallas de alta resolución */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .geo-gf-message::before {
        background-size: 16px 16px;
    }
}

/* Animación de salida */
.geo-gf-message.geo-gf-fade-out {
    animation: geo-gf-fade-out 0.3s ease-out forwards;
}

@keyframes geo-gf-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Estilos para indicador de progreso */
.geo-gf-progress {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: geo-gf-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Estilos para el estado de "obteniendo ubicación" */
.geo-gf-getting-location {
    background-color: #e7f3ff;
    border-left-color: #2271b1;
    color: #1d2327;
    display: flex;
    align-items: center;
}

.geo-gf-getting-location .geo-gf-progress {
    margin-right: 10px;
}

/* Botón de reintentar */
.geo-gf-retry-button {
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    text-decoration: none;
    display: inline-block;
}

.geo-gf-retry-button:hover {
    background: #135e96;
    color: white;
}

.geo-gf-retry-button:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Botón de recargar página */
.geo-gf-reload-button {
    background: #d63638;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: center;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.geo-gf-reload-button:hover {
    background: #b32d2e;
    color: white;
}

.geo-gf-reload-button:focus {
    outline: 2px solid #d63638;
    outline-offset: 2px;
    background: #b32d2e;
}

.geo-gf-reload-button:active {
    background: #8a2424;
}

/* Mensaje con botón de recarga */
.geo-gf-message:has(.geo-gf-reload-button) {
    padding-bottom: 20px;
}

/* Responsive para botón de recarga */
@media (max-width: 768px) {
    .geo-gf-reload-button {
        padding: 12px 16px;
        font-size: 16px;
        margin-top: 12px;
    }
}

/* Mensaje global de ubicación */
.geo-gf-global-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    margin: 0;
    border-radius: 0;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: geo-gf-slide-down-global 0.5s ease-out;
}

@keyframes geo-gf-slide-down-global {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Ajustar el cuerpo cuando hay mensaje global */
body:has(.geo-gf-global-message) {
    padding-top: 60px;
}

/* Responsive para mensaje global */
@media (max-width: 768px) {
    .geo-gf-global-message {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    body:has(.geo-gf-global-message) {
        padding-top: 50px;
    }
}

/* Mensaje persistente de permisos denegados */
.geo-gf-persistent-message {
    border: 2px solid #d63638;
    background-color: #ffeaea;
    border-left-color: #d63638;
    font-weight: 600;
    position: relative;
    z-index: 100;
}

.geo-gf-persistent-message::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23d63638' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

/* Animación más llamativa para mensaje persistente */
.geo-gf-persistent-message {
    animation: geo-gf-attention 2s ease-in-out infinite;
}

@keyframes geo-gf-attention {
    0%, 100% { 
        border-color: #d63638;
        box-shadow: 0 0 0 0 rgba(214, 54, 56, 0.4);
    }
    50% { 
        border-color: #b32d2e;
        box-shadow: 0 0 0 4px rgba(214, 54, 56, 0.2);
    }
}

/* Hacer que el mensaje persistente sea más prominente */
.geo-gf-persistent-message {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
}

/* Mensaje que reemplaza completamente el formulario */
.geo-gf-form-replacement {
    background: #ffeaea;
    border: 3px solid #d63638;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #721c24;
    box-shadow: 0 4px 20px rgba(214, 54, 56, 0.2);
    animation: geo-gf-pulse 2s ease-in-out infinite;
}

.geo-gf-form-replacement .geo-gf-reload-button {
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 700;
    background: #d63638;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.geo-gf-form-replacement .geo-gf-reload-button:hover {
    background: #b32d2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 54, 56, 0.3);
}

@keyframes geo-gf-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(214, 54, 56, 0.2);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 6px 25px rgba(214, 54, 56, 0.3);
    }
}

@media (max-width: 768px) {
    .geo-gf-persistent-message {
        margin: 15px 0;
        padding: 15px;
        font-size: 14px;
    }
    
    .geo-gf-form-replacement {
        padding: 20px;
        font-size: 16px;
        margin: 15px 0;
    }
    
    .geo-gf-form-replacement .geo-gf-reload-button {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Instrucciones manuales para habilitar permisos */
.geo-gf-manual-instructions {
    margin-top: 20px;
    padding: 20px;
    background: #f0f8ff;
    border: 2px solid #4a90e2;
    border-radius: 8px;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
}

.geo-gf-manual-instructions h3 {
    margin-top: 0;
    color: #2c5282;
    font-size: 16px;
}

.geo-gf-manual-instructions ol,
.geo-gf-manual-instructions ul {
    margin: 10px 0;
    padding-left: 20px;
}

.geo-gf-manual-instructions li {
    margin: 5px 0;
}

.geo-gf-manual-instructions p {
    margin: 15px 0 10px 0;
    font-weight: 600;
}

@media (max-width: 768px) {
    .geo-gf-manual-instructions {
        margin-top: 15px;
        padding: 15px;
        font-size: 13px;
    }
    
    .geo-gf-manual-instructions h3 {
        font-size: 15px;
    }
} 
}

@media (max-width: 768px) {
    .geo-gf-manual-instructions {
        margin-top: 15px;
        padding: 15px;
        font-size: 13px;
        background: rgba(214, 54, 56, 0.95); /* Fondo rojo semi-transparente */
        border: 2px solid #fff; /* Borde blanco */
        color: #fff !important; /* Texto blanco */
    }
    
    .geo-gf-manual-instructions h3 {
        font-size: 15px;
        color: #fff !important; /* Título en blanco */
    }
    
    .geo-gf-manual-instructions ol,
    .geo-gf-manual-instructions ul {
        color: #fff !important; /* Listas en blanco */
    }
    
    .geo-gf-manual-instructions li {
        color: #fff !important; /* Items en blanco */
    }
    
    .geo-gf-manual-instructions p {
        color: #fff !important; /* Párrafos en blanco */
    }
    
    /* Asegurar que todos los elementos de texto sean blancos */
    .geo-gf-manual-instructions * {
        color: #fff !important;
    }
} 