/* rifa/css/style.css */

/* =========================================
   1. NAVBAR & HEADER
   ========================================= */
.navbar.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 30px rgba(0,0,0,0.05);
    padding: 1rem 0; /* Más aire */
}

/* LOGO: Ajuste responsivo */
.navbar-brand img {
    height: 50px; /* Móvil */
    transition: all 0.3s ease;
}

@media (min-width: 992px) { /* PC */
    .navbar-brand img {
        height: 90px; /* Mucho más grande en PC */
        width: auto;
    }
}

/* Widget PEGA 4 (Estilo Tarjeta Flotante como la imagen) */
.pega4-card-result {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.05);
    min-width: 220px;
}

.pega4-logo-img {
    height: 35px; /* Ajusta según tu imagen pega4.png */
    margin-bottom: 5px;
    object-fit: contain;
}

.pega4-balls-container {
    display: flex;
    gap: 8px;
    margin: 5px 0;
}

.ball-result {
    width: 35px;
    height: 35px;
    background: radial-gradient(circle at 35% 35%, #fff200, #ffd700); /* Amarillo brillante */
    color: #000;
    font-weight: 900;
    font-size: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3), inset -2px -2px 5px rgba(0,0,0,0.1);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    font-family: 'Arial Black', sans-serif;
}

.pega4-date {
    background: #1d4ed8; /* Azul oscuro */
    color: white;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 5px;
}

/* =========================================
   2. VIDEOS MODERNOS (Uniformidad)
   ========================================= */
.video-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    background: #000;
    /* Forzamos relación de aspecto 16:9 para que sean IDÉNTICOS */
    aspect-ratio: 16/9; 
    group: video-hover;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta para llenar el espacio sin deformar */
}

/* Botón de Audio Moderno */
.btn-audio-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-audio-toggle:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    transform: scale(1.1);
}

/* =========================================
   3. NUEVAS SECCIONES (Robustez)
   ========================================= */
.info-card {
    background: #fff;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    height: 100%;
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: var(--bg-body);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary);
}

/* Comentarios / Testimonios */
.testimonial-card {
    background: #fff;
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

/* =========================================
   MODAL VIP & LOTTERY BALLS (CSS3 PRO)
   ========================================= */

/* 1. Modal Container Moderno */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0043a8 100%);
    color: white;
    padding: 1.5rem;
    border-bottom: none;
}

.modal-title {
    font-weight: 800;
    letter-spacing: 0.5px;
    font-size: 1.5rem;
}

/* 2. Wizard Steps (Control de flujo) */
.wizard-step {
    display: none; /* Ocultos por defecto */
    animation: slideUpFade 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.wizard-step.active {
    display: block; /* Solo visible el activo */
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 3. DISPLAY DE NÚMEROS SELECCIONADOS (Bolas Grandes en el Medio) */
.lotto-display-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: center; /* CENTRADO HORIZONTAL */
    align-items: center;
    gap: 15px;
    min-height: 90px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.lotto-ball-selected {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /* EFECTO 3D REALISTA (Amarillo Oro) */
    background: radial-gradient(circle at 35% 35%, #fff 5%, #ffd700 30%, #ffc107 100%);
    box-shadow: 
        0 4px 10px rgba(0,0,0,0.3), /* Sombra suelo */
        inset -5px -5px 10px rgba(0,0,0,0.1); /* Sombra interna */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: #212529;
    font-family: 'Arial Black', sans-serif;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.placeholder-dash {
    width: 50px;
    height: 50px;
    border: 2px dashed #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 20px;
}

/* 4. TECLADO NUMÉRICO (Botones Bola) */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 350px;
    margin: 0 auto; /* Centrar el teclado */
}

.key-ball-btn {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border-radius: 50%;
    border: none;
    /* EFECTO 3D SUAVE (Blanco/Gris) */
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #e9ecef 60%, #dee2e6 100%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    font-size: 22px;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-ball-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background: radial-gradient(circle at 30% 30%, #fff 0%, #ffd700 60%); /* Se pone dorada al hover */
    color: #000;
}

.key-ball-btn:active {
    transform: scale(0.95);
}

/* Botones de Acción Especiales */
.key-action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    margin: 0 auto;
}

.btn-delete {
    background: radial-gradient(circle at 30% 30%, #ff6b6b 0%, #dc3545 100%);
}

.btn-confirm {
    background: radial-gradient(circle at 30% 30%, #51cf66 0%, #198754 100%);
}

/* 5. LISTA DE TICKETS (Estilo Ticket Físico) */
.ticket-row {
    background: #fff;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}

.ticket-row:hover {
    background: #f1f8ff;
    border-color: #0d6efd;
}

/* Barra de Progreso */
.wizard-progress-bar {
    height: 6px;
    background: linear-gradient(90deg, #ffd700, #ffc107);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* =========================================
   PAGOS Y COMPROBANTES (NUEVO)
   ========================================= */

/* Tarjeta de Datos Bancarios */
.bank-info-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.bank-info-card:hover {
    background: #fff;
    border-color: #0d6efd;
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.1);
}

.bank-logo {
    font-size: 24px;
    color: #0d6efd;
    margin-bottom: 10px;
}

/* Zona de Subida de Archivo (Upload) */
.upload-zone {
    border: 2px dashed #ced4da;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: all 0.3s;
    position: relative;
}

.upload-zone:hover {
    border-color: #0d6efd;
    background: #f1f8ff;
}

.upload-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 30px;
    color: #6c757d;
    margin-bottom: 10px;
}

/* Paso de Éxito */
.success-message-container {
    text-align: center;
    padding: 20px;
    animation: zoomIn 0.5s ease;
}

.success-icon-large {
    font-size: 80px;
    color: #198754;
    margin-bottom: 20px;
}

/* =========================================
   IOS / IPHONE X COMPATIBILITY PATCH
   ========================================= */

/* 1. Ajuste para el "Notch" y la Barra Inferior (Home Indicator) */
.modal-dialog {
    /* Asegura que el modal no toque los bordes peligrosos */
    margin-bottom: env(safe-area-inset-bottom); 
}

.modal-content {
    /* Evita que el teclado virtual rompa el layout */
    max-height: 90vh; 
    display: flex;
    flex-direction: column;
}

.modal-body {
    /* Scroll suave nativo de iOS */
    -webkit-overflow-scrolling: touch; 
    overflow-y: auto;
    /* Evita que se corte el contenido al final */
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* 2. Evitar Zoom Automático en Inputs (Regla de Oro en iOS) */
@media screen and (max-width: 768px) {
    input, select, textarea, .form-control {
        font-size: 16px !important; /* Mínimo para que no haga zoom */
    }
}

/* 3. Ajuste de la Lista de Tickets para Scroll */
#ticket-list-wrapper {
    /* Importante para que el dedo pueda deslizar la lista dentro del modal */
    max-height: 150px; 
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    /* Sombra interna para indicar que hay scroll */
    background: 
        linear-gradient(#fff 30%, rgba(255,255,255,0)),
        linear-gradient(rgba(255,255,255,0), #fff 70%) 0 100%,
        radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.1), rgba(0,0,0,0)),
        radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.1), rgba(0,0,0,0)) 0 100%;
    background-repeat: no-repeat;
    background-color: #fff;
    background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
    background-attachment: local, local, scroll, scroll;
}

/* 4. Botones de Acción (Pagar) flotantes seguros */
#step2 .d-grid {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 10px;
    z-index: 10;
    /* Separación extra para la barra de home del iPhone */
    padding-bottom: 5px; 
}

/* 5. Corrección Visual de las Bolas en Pantallas Estrechas */
@media (max-width: 380px) {
    .key-ball-btn {
        width: 60px;
        height: 60px;
        font-size: 18px;
    }
    .keypad-grid {
        gap: 10px;
    }
}

/* =========================================
   MOBILE APP VIEW (FULLSCREEN MODE)
   ========================================= */

@media (max-width: 768px) {
    /* 1. Forzar Modal a Pantalla Completa */
    .modal-dialog {
        max-width: 100%;
        width: 100%;
        margin: 0;
        height: 100%; /* Ocupa todo el alto */
    }

    .modal-content {
        height: 100%;
        border-radius: 0 !important; /* Sin bordes redondos */
        border: none;
        display: flex;
        flex-direction: column;
        background: #f8f9fa; /* Fondo gris claro suave */
    }

    .modal-header {
        flex-shrink: 0; /* El header no se encoge */
        background: #fff;
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
    }

    /* 2. Cuerpo del Modal Flexible */
    .modal-body {
        flex-grow: 1;
        overflow-y: auto; /* Scroll interno si hace falta */
        padding: 0 !important;
        display: flex;
        flex-direction: column;
        /* Scroll suave en iPhone */
        -webkit-overflow-scrolling: touch; 
        padding-bottom: 100px !important; /* Espacio para el botón flotante */
    }

    /* 3. ZONA SUPERIOR FIJA (STICKY HEADER) */
    /* Donde salen las bolas seleccionadas */
    .sticky-selection-area {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 100;
        padding: 15px 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        margin-bottom: 20px;
    }

    /* 4. Teclado Numérico Ajustado */
    .keypad-grid {
        padding: 0 20px;
        margin-bottom: 20px;
    }
    
    /* Reducimos un poco el tamaño de bolas en pantallas muy chicas */
    .key-ball-btn {
        width: 65px; 
        height: 65px;
        font-size: 20px;
    }

    /* 5. BOTÓN FLOTANTE INFERIOR (Action Bar) */
    .mobile-floating-action {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 15px 20px;
        /* Respetar el área del botón home del iPhone X */
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
        box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
        z-index: 1050;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
    }

    /* Ocultar elementos de escritorio que estorben */
    .desktop-only {
        display: none !important;
    }
    
    /* Título del paso más pequeño */
    .step-title {
        font-size: 1rem;
        text-align: center;
        margin-bottom: 0;
    }
}

/* =========================================
   MEJORAS VISUALES HOME (NUEVO)
   ========================================= */

/* 1. Corrección del Título Oculto (Spacing) */
header.hero-section {
    /* Esto empuja el contenido hacia abajo para que el Navbar fijo no lo tape */
    padding-top: 140px; 
    padding-bottom: 60px;
}

/* 2. Menú de Navegación Moderno */
.navbar-nav .nav-link {
    font-weight: 600;
    color: #495057 !important;
    padding: 8px 20px !important;
    margin: 0 5px;
    border-radius: 50px; /* Forma de píldora */
    transition: all 0.3s ease;
    position: relative;
}

/* Efecto Hover en el Menú */
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: rgba(13, 110, 253, 0.1); /* Fondo azul muy suave */
    color: var(--primary, #0d6efd) !important;
    transform: translateY(-2px); /* Se eleva un poquito */
}

/* 3. Animación de la Mano Señalando */
@keyframes pointingFinger {
    0% { transform: translateX(0); }
    50% { transform: translateX(10px); } /* Se mueve a la derecha */
    100% { transform: translateX(0); }
}

.hand-icon {
    display: inline-block;
    font-size: 1.4rem;
    margin-right: 10px;
    animation: pointingFinger 1.2s infinite ease-in-out;
}

/* Botón Principal (CTA) Mejorado */
.btn-cta-main {
    background: linear-gradient(45deg, #0d6efd, #0043a8);
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.4);
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s;
}

.btn-cta-main:hover {
    transform: scale(1.05); /* Crece un poco al pasar el mouse */
    box-shadow: 0 15px 35px rgba(13, 110, 253, 0.6);
}

/* =========================================
   CORRECCIÓN DE ESPACIADO (PC VS MÓVIL)
   ========================================= */

/* 1. Versión MÓVIL (Por defecto) */
header.hero-section {
    padding-top: 140px; /* Espacio para el menú en celular */
    padding-bottom: 50px;
    position: relative;
    z-index: 1;
}

/* 2. Versión PC / ESCRITORIO (Aquí está el arreglo) */
@media (min-width: 992px) {
    header.hero-section {
        /* Aumentamos drásticamente el espacio superior en PC 
           porque el logo es grande y el widget Pega 4 ocupa espacio */
        padding-top: 240px !important; 
    }

    /* Ajuste fino para que el menú no se vea apretado */
    .navbar-nav {
        margin-top: 0;
        align-items: center; /* Centrado vertical perfecto */
    }
    
    /* Separación extra para el Widget Pega 4 en PC */
    #pega4-results {
        margin-left: 20px;
    }
}

/* =========================================
   PARCHE FINAL: CORRECCIÓN ESPACIO PC
   ========================================= */

/* Solo aplica en Pantallas Grandes (PC/Laptop) */
@media (min-width: 992px) {
    header.hero-section {
        /* Aumentamos el espacio drásticamente para librar el Logo y el Pega 4 */
        padding-top: 280px !important; 
        padding-bottom: 60px;
    }

    /* Aseguramos que el fondo se mantenga correcto */
    body {
        background-color: var(--bg-body);
    }
}