/* Variables de color consistentes con el diseño base */
:root {
    --color-primary: #166534; /* Verde oscuro para activo */
    --color-primary-light: #22c55e; /* Verde más claro para hover/acento */
    --color-bg: #0f172a; /* Fondo principal de barras (casi negro) */
    --color-bg-light: #1e293b; /* Fondo para hover/componentes oscuros */
    --color-text: #ffffff; /* Texto blanco */
    --color-text-muted: #cbd5e1; /* Gris claro para texto inactivo */
    --color-border: #334155; /* Borde sutil */
    --transition: all 0.3s ease;
}

/* ---------------------------------------------------- */
/* CORRECCIÓN GLOBAL PARA EVITAR SCROLL HORIZONTAL CON MODAL ABIERTO */
/* ---------------------------------------------------- */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important; /* Evitar el "salto" de contenido si el scrollbar desaparece */
}

/* ---------------------------------------------------- */
/* ESTILOS DEL MODAL (Fondo Oscuro/Acento Verde) */
/* ---------------------------------------------------- */

.wcprg-modal {
    /* CORRECCIÓN PRINCIPAL: Asegura que el modal ocupe toda la ventana del navegador (Viewport) */
    position: fixed;
    z-index: 10000; 
    left: 0;
    top: 0;
    width: 100% !important; 
    height: 100vh !important; 
    
    /* ¡CAMBIO CLAVE! Quitamos el overflow del modal para que el centrado funcione siempre */
    overflow-y: hidden; 
    
    background-color: rgba(0, 0, 0, 0.85); 
    
    /* CENTRADO CRÍTICO */
    display: flex;
    align-items: center; /* Centrado vertical */
    justify-content: center; /* Centrado horizontal */
    
    overscroll-behavior-y: contain; 
}

.wcprg-modal-content {
    background-color: var(--color-bg-light); /* Fondo del modal */
    padding: 25px;
    border: 1px solid var(--color-border);
    width: 90%; 
    max-width: 500px; /* Tamaño controlado */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7); /* Sombra más pronunciada */
    color: var(--color-text);
    animation: wcprg-fadeInUp 0.3s ease-out;
    position: relative;
    box-sizing: border-box; 
    
    /* NUEVO AJUSTE: Si el contenido del formulario es demasiado grande, 
       solo el contenido interno tendrá scroll, no el modal completo. */
    max-height: 90vh; /* Máximo 90% del alto del viewport */
    overflow-y: auto; /* Permite scroll si el contenido excede el max-height */
    
    margin: 20px; 
}

.wcprg-modal-title {
    color: var(--color-primary-light);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
    font-weight: 700;
}

/* Animación de entrada */
@keyframes wcprg-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-20px); 
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botón de cerrar (la 'X') */
.wcprg-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--color-text-muted);
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.wcprg-close-button:hover,
.wcprg-close-button:focus {
    color: var(--color-primary-light);
    text-decoration: none;
    cursor: pointer;
}

/* ---------------------------------------------------- */
/* ESTILOS DE FORMULARIO E INPUTS */
/* (El resto del CSS se mantiene igual) */
/* ---------------------------------------------------- */
/* ... [Resto del código CSS sin cambios] ... */
.wcprg-form-actions {
    display: flex;
    justify-content: flex-end; /* Botones a la derecha */
    gap: 15px;
    margin-top: 25px;
}

.wcprg-input-group {
    margin-bottom: 20px;
}

.wcprg-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.wcprg-input-group input[type="text"],
.wcprg-input-group input[type="number"],
.wcprg-input-group textarea,
.wcprg-input-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg); /* Fondo de input oscuro */
    color: var(--color-text);
    border-radius: 4px;
    box-sizing: border-box;
    transition: var(--transition);
}

.wcprg-input-group input:focus,
.wcprg-input-group textarea:focus {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5);
    outline: none;
}

.wcprg-input-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.8em;
    color: var(--color-text-muted);
}

/* ---------------------------------------------------- */
/* BOTONES */
/* ---------------------------------------------------- */
.wcprg-button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wcprg-button-primary {
    background-color: var(--color-primary);
    color: var(--color-text);
}

.wcprg-button-primary:hover {
    background-color: var(--color-primary-light);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3); /* Sombra más atractiva */
}

.wcprg-button-secondary {
    background-color: var(--color-bg);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.wcprg-button-secondary:hover {
    background-color: var(--color-bg-light);
    color: var(--color-text);
    border-color: var(--color-primary);
}

/* ---------------------------------------------------- */
/* RADIO BUTTONS (Montos) */
/* ---------------------------------------------------- */
.wcprg-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid var(--color-border);
    padding: 10px;
    border-radius: 4px;
    background-color: var(--color-bg);
}

.wcprg-radio-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-bg-light);
    transition: var(--transition);
    font-size: 0.9em;
    color: var(--color-text-muted);
    user-select: none; /* Prevenir selección de texto al hacer clic */
}

.wcprg-radio-label:hover {
    background-color: var(--color-bg);
    border-color: var(--color-primary);
    color: var(--color-text);
}

.wcprg-radio-label input[type="radio"] {
    display: none; /* Ocultar el radio nativo */
}

.wcprg-radio-label input[type="radio"]:checked + span {
    background-color: var(--color-primary); /* Fondo verde si está activo */
    color: var(--color-text);
    padding: 6px 10px;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.7);
}

/* ---------------------------------------------------- */
/* BOOKMAKERS (IMAGENES) - CORRECCIÓN DE MARCADO */
/* ---------------------------------------------------- */
.wcprg-bookmakers {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.wcprg-bookmaker-label {
    /* Asegura que el label envuelva la imagen y el input correctamente */
    display: inline-block;
    cursor: pointer;
    position: relative;
    line-height: 0; /* Elimina espacio extra debajo de la imagen */
    border: 2px solid transparent; /* Base transparente */
    border-radius: 4px;
    padding: 2px;
    transition: var(--transition);
}

.wcprg-bookmaker-label img {
    max-height: 40px; /* Aumentado ligeramente para mayor visibilidad */
    width: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: var(--transition);
    display: block; /* Importante para el centrado y evitar espacios */
}

/* El input nativo sigue oculto */
.wcprg-bookmaker-label input[type="radio"] {
    display: none; 
}

/* Usa el selector de hermano adyacente (+) */
.wcprg-bookmaker-label input[type="radio"]:checked + img {
    filter: none; /* Color si está activo */
    opacity: 1;
    transform: scale(1.05); /* Escala sutil para el efecto de selección */
    border: 2px solid var(--color-primary-light); /* Borde claro y visible para el marcado */
    box-shadow: 0 0 5px var(--color-primary);
}


/* ---------------------------------------------------- */
/* PAGINACION Y MENSAJES */
/* ---------------------------------------------------- */
.wcprg-pagination-dots {
    text-align: center;
    margin-top: 20px;
}

.wcprg-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    background: var(--color-text-muted);
    border-radius: 50%;
    opacity: 0.4;
    transition: var(--transition);
}

.wcprg-dot.active {
    opacity: 1;
    background: var(--color-primary-light);
    transform: scale(1.2);
}

.wcprg-message {
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
}

.wcprg-message.success {
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary-light);
}

.wcprg-message.error {
    background-color: #dc2626; /* Rojo de Tailwind */
    border: 1px solid #ef4444; 
}

/* ---------------------------------------------------- */
/* ESTILOS ADICIONALES PARA LA IMAGEN DE SUBIDA */
/* ---------------------------------------------------- */

#wcprg-image-preview {
    margin-top: 10px;
    border: 1px dashed var(--color-border);
    padding: 10px;
    border-radius: 4px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wcprg-image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

#wcprg-image-preview p {
    color: var(--color-text-muted);
    margin: 0;
}


/* AGREGAR ESTO AL FINAL DEL ARCHIVO */
#wcprg-confirmation-modal {
    z-index: 1000000 !important; /* Mayor que el formulario */
    position: fixed;
}

/* O mejor aún, más específico */
#wcpsp-global-form-container #wcprg-confirmation-modal {
    z-index: 1000000 !important;
}