/* --- ESTILOS CONSOLIDADOS --- */

/* Estilos para el BODY o contenedor principal (reinicio de espacio) */
body,
.imagen-contenedor {
    margin: 0;
    padding: 0;
    /* Fondo para mejor visualización del botón */
    background-color: #f4f4f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 1. Estilos para el contenedor de la tarjeta (Generador) */
.generator-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 350px;
    margin: 40px auto;
    /* Centrar la tarjeta */
    text-align: center;
    /* AÑADE ESTO para el borde azul */
    border: 1px solid #1E90FF;
    /* Borde sólido de 4px de grosor y color 'Dodger Blue' */
}

/* 2. Estilos para la imagen (Generador) */
.lottery-image {
    /* Control de tamaño */
    width: 20px;
    height: 20px;
    /* 🔥 NUEVO: Espacio superior para "despegar" la imagen */
    margin-top: 20px;
    /* Ajusta este valor (20px) al espacio que necesites */
    /* Se mantiene el centrado horizontal y la alineación */
    display: block;
    /* Cambiado a block para centrarlo mejor dentro de la tarjeta */
    margin-left: auto;
    margin-right: auto;
}

/* Estilos para la bola de número (Generador) */
.bola {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 120px;
    margin: 20px auto 10px;
    background-color: #ffffff;
    /* Color rojo vibrante */
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(248, 248, 248, 0.6);
    font-size: 3em;
    font-weight: bold;
    color: white;
    transition: transform 0.3s ease-out;
}

/* Estilo de animación de la bola (Generador) */
.bola.animating {
    animation: shake 0.5s infinite alternate;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    100% {
        transform: translate(-1px, -1px) rotate(-1deg);
    }
}

/* 🚀 ESTILOS DEL BOTÓN AGRADABLE AL USUARIO (Generador) */
.boton-generar {
    /* Colores y Tipografía */
    background-color: #B91C1C;
    /* Azul brillante */
    color: rgb(255, 255, 255);
    font-size: 1.25em;
    font-weight: 700;
    text-transform: uppercase;
    /* Forma y Espaciado */
    padding: 15px 30px;
    margin: 25px 0;
    /* Espacio superior e inferior */
    border: none;
    border-radius: 30px;
    /* Bordes redondeados */
    cursor: pointer;
    /* Sombra y Transición */
    box-shadow: 0 4px 15px rgba(16, 42, 70, 0.4);
    transition: all 0.3s ease;
    /* Transiciones suaves para efectos */
    width: 90%;
    /* Ancho completo dentro de la tarjeta */
    max-width: 300px;
}

/* Efecto al pasar el ratón (Hover) (Generador) */
.boton-generar:hover:not(:disabled) {
    background-color: #002D72;
    /* Azul más oscuro */
    box-shadow: 0 8px 20px #B91C1C(0, 123, 255, 0.6);
    transform: translateY(-2px);
    /* Pequeño levantamiento */
}

/* Efecto al presionar (Active) (Generador) */
.boton-generar:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Estilo para el botón deshabilitado (Generador) */
.boton-generar:disabled {
    background-color: #002D72;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

/* Estilos para el texto informativo (Generador) */
.info-text {
    font-size: 1em;
    color: #555;
    line-height: 1.5;
}

.info-text span {
    font-weight: bold;
    color: #ff4560;
    /* Color que contrasta */
}

#subtitulo {
    color: #333;
}

/* --- (INICIO) ESTILOS DE RESULTADOS DE LOTERIA --- */

/* --- Estilos Generales y Contenedor Principal --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #f7f4f4;
    /* Fondo suave */
    color: #000000;
    /* Color de texto principal */
    padding: 40px 20px;
    /* Padding general, ajustado para móviles */
    box-sizing: border-box;
    text-align: center;
    /* Centra elementos inline/inline-block */
}

/* Nuevo contenedor para envolver todo el contenido principal */
.main-content-wrapper {
    max-width: 700px;
    /* Ancho máximo para el contenido principal */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 0 auto;
}

/* Contenedor del Dropdown (Se mantiene la fecha principal aquí, como la teníamos) */
.dropdown-container {
    background-color: #fff;
    padding: 30px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #1E90FF;
    /* Borde sólido de 4px de grosor y color 'Dodger Blue' */
}

/* Tarjeta de Lotería (Cada una tendrá su fecha individual) */
.lottery-card {
    background-color: #fff;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    /* CLAVE para posicionar .card-date */
    overflow-x: visible;
    border-radius: 20px;
    border: 1px solid #1E90FF;
    /* Borde sólido de 4px de grosor y color 'Dodger Blue' */
}

/* Ocultar la barra de scroll (aunque overflow: visible no la genera) */
.lottery-card::-webkit-scrollbar {
    display: none;
}

.lottery-card {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* --- Estilos para la Fecha y Hora PRINCIPAL (en el Dropdown Container) --- */
/* Lo mantenemos por si el usuario lo quiere ver arriba del todo */
#fecha-actual {
    /* Posicionamiento absoluto */
    top: 15px;
    right: 15px;
    margin: 0;
    font-size: 0.9em;
    color: #0e0d0dad;
    /* Color de acento */
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    z-index: 10;
}

/* --- Estilos para la Fecha en Cada Tarjeta de Lotería (NUEVO ESTILO) --- */
.card-date {
    position: absolute;
    /* Posicionamiento absoluto dentro de .lottery-card */
    top: 15px;
    right: 15px;
    font-size: 0.9em;
    color: #777;
    /* Color de fecha más tenue */
    font-weight: bold;
    text-align: right;
    line-height: 1.2;
    z-index: 2;
    padding-right: 5px;
    /* Pequeño ajuste para el borde */
}

/* --- Estilos para el Título Principal --- */
h1 {
    margin-top: 10px;
    margin-bottom: 25px;
    padding-top: 5px;
    color: #461713;
    font-size: 1.8em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    text-align: center;
}

/* --- Estilos para Sub-encabezados (ej: Horarios, Nombres de sorteos secundarios) --- */
h2,
h4 {
    color: #040464;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

.lottery-header h4 {
    /* Estilo específico para los horarios dentro del header */
    margin: 0;
    color: #555;
    font-size: 1em;
    font-weight: normal;
    white-space: nowrap;
}

/* --- Estilos del Dropdown (Se mantienen) --- */
.dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
    border-radius: 10px;
}

.dropdown-button {
    background: linear-gradient(135deg, #002D72 0%, #B91C1C 100%);
    color: white;
    padding: 15px 25px;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.18);
    transition: background-color 0.3s ease, transform 0.2s ease-in-out, box-shadow 0.3s ease;
    font-size: 1.1em;
    width: 75%;
    text-align: center;
    position: relative;
    box-sizing: border-box;
}

.dropdown-button::after {
    content: '\25BE';
    position: absolute;
    right: 20px;
    border-radius: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.dropdown-button:hover {
    background: linear-gradient(135deg, #040464 0%, #040464 100%);
    transform: scale(1.01);
    box-shadow: 5px 5px 10px rgba(214, 8, 8, 0.25);
    border-radius: 10px;
}

.dropdown:hover .dropdown-button::after {
    transform: translateY(-50%) rotate(180deg);
    border-radius: 10px;
}

/* --- Estilos del contenido del Dropdown (enlaces) --- */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 100%;
    box-shadow: 0 10px 20px 0 rgba(197, 10, 10, 0.12);
    z-index: 10;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    box-sizing: border-box;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px;
}

.dropdown:hover .dropdown-content {
    display: block;
    border-radius: 10px;
}

.dropdown-content a {
    color: #070464;
    padding: 12px 24px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 1em;
    text-align: left;
    border-radius: 20px;
}

.dropdown-content a:hover {
    background-color: #e0e0e0;
    color: #792620;
}

/* --- Estilos para las imágenes de los logos en el Dropdown --- */
.dropdown-content a img {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    object-fit: contain;
    flex-shrink: 0;
}

/* --- Estilos para el texto de los nombres de lotería (CENTRADO) --- */
.dropdown-content a span {
    flex-grow: 1;
    text-align: center;
}

/* --- Estilos para la Sección de Resultados de Lotería --- */
.lottery-results-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    text-align: left;
}

.lottery-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
}

/* --- Estilo para las imágenes de logos dentro de cada tarjeta --- */
.lottery-image,
.lottery-image.small {
    width: 130px;
    height: 130px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Ajuste para el contenedor de la hora si el logo es muy grande */
.lottery-header>*:last-child {
    flex-shrink: 0;
    margin-left: 20px;
    /* Espacio entre logo y hora */
    text-align: right;
}

/* --- Estilos para el contenedor de bolas --- */
.balls-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    margin: 15px auto;
    padding: 0;
    width: 100%;
}

/* --- Nuevo contenedor para la bola y el ranking --- */
.ball-and-rank-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 8px;
    margin-bottom: 15px;
}

/* --- Estilos para la forma de "Bola" de los números --- */
.ball-value {
    border: 1px solid #ddd;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    min-width: 70px;
    height: 70px;
    box-sizing: border-box;
    background-color: #f8f8f8;
    color: #000000;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    cursor: default;
    border-radius: 50%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    flex-basis: auto;
    position: relative;
}

.ball-value::before {
    content: none;
}

.ball-value:hover {
    transform: translateY(-3px);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

/* --- Estilos para el ranking debajo de la bola --- */
.ball-rank::before {
    content: attr(data-rank);
    font-size: 0.8em;
    font-weight: bold;
    color: #777676;
    margin-top: 5px;
    display: block;
    text-align: center;
}

.ball-rank {
    display: block;
    height: 3em;
}

/* Colores específicos para algunas bolas */
.ball-value.yellow {
    background-color: #efb810;
    color: #ffffff;
    border-color: #070707;
}

.ball-value.red {
    background-color: #B91C1C;
    color: rgb(255, 255, 255);
    border-color: #000000;
}

.ball-value.blue {
    background-color: #002D72;
    color: rgb(255, 255, 255);
    border-color: #0d0d0e;
}

/* --- Estilos para las bolas especiales con texto --- */
.balls-container .ball-value.special-balls {
    border-radius: 8px;
    height: auto;
    min-width: 90px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: normal;
    transition: none;
    box-shadow: 1px 1px 3px rgba(243, 242, 242, 0.1);
    margin: 0;
    flex-shrink: 0;
    flex-basis: auto;
    position: relative;
}

.balls-container .ball-value.special-balls::before {
    content: none;
}

.balls-container .ball-value.special-balls:hover {
    transform: none;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.balls-container .ball-value.special-balls::after {
    content: attr(data-label);
    position: static;
    transform: none;
    font-size: 0.9em;
    color: #131212;
    white-space: nowrap;
    margin-top: 8px;
    font-weight: normal;
}

/* --- Estilos para Separadores (Horizontal Rule) --- */
hr {
    border: none;
    height: 1px;
    background-color: #eee;
    margin: 20px 0;
    width: 100%;
}

/* --- Estilos para Párrafos dentro de resultados --- */
.lottery-results-section p {
    font-size: 0.9em;
    color: #b62626;
    margin-top: 10px;
}

/* --- Media Query para pantallas grandes (escritorio/tablet) --- */
@media (min-width: 768px) {
    .main-content-wrapper {
        max-width: 700px;
        gap: 30px;
    }

    .dropdown-container,
    .lottery-card {
        padding: 40px 30px;
    }

    #fecha-actual {
        font-size: 1 em;
    }

    .card-date {
        font-size: 1em;
    }

    /* Logos en Tarjetas (Escritorio) - UNIFICADO */
    .lottery-image,
    .lottery-image.small {
        width: 130px;
        height: 130px;
        position: left;
    }

    /* Logos en Dropdown (Escritorio) - AJUSTADO */
    .dropdown-content a img {
        width: 80px;
        height: 80px;
    }

    .ball-value {
        min-width: 90px;
        height: 90px;
        font-size: 2.5em;
    }

    .balls-container .ball-value.special-balls {
        min-width: 120px;
        padding: 25px 20px;
        font-size: 1.8em;
    }

    .balls-container .ball-value.special-balls::after {
        font-size: 1em;
    }

    .ball-and-rank-container {
        margin: 0 15px;
        margin-bottom: 20px;
    }

    .ball-rank::before {
        font-size: 1em;
    }
}

/* --- Media Query para pantallas pequeñas (principalmente móviles) --- */
@media (max-width: 520px) {
    body {
        padding: 20px 10px;
    }

    .dropdown-container,
    .lottery-card {
        padding: 20px 15px;
    }

    #fecha-actual {
        top: 5px;
        right: 5px;
        font-size: 0.8em;
    }

    .card-date {
        top: 8px;
        right: 8px;
        font-size: 0.8em;
    }

    h1 {
        font-size: 1.6em;
        margin-top: 10px;
        margin-bottom: 20px;
    }

    h2,
    h4 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .lottery-header h4 {
        font-size: 0.9em;
        margin: 0;
        text-align: right;
    }

    .dropdown-button {
        font-size: 1em;
        padding: 12px 20px;
    }

    .dropdown-content a {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .dropdown-content a img {
        width: 60px;
        height: 60px;
        margin-right: 12px;
    }

    .dropdown-content a span {
        flex-grow: 1;
        text-align: center;
    }

    /* Logos en Tarjetas (Móvil) - UNIFICADO */
    .lottery-image,
    .lottery-image.small {
        width: 150px;
        height: 150px;
    }

    .lottery-header>*:last-child {
        margin-left: 5px;
    }

    .ball-rank::before {
        font-size: 0.7em;
        margin-top: 3px;
    }

    .ball-and-rank-container {
        margin: 0 4px;
        margin-bottom: 10px;
    }

    .ball-value {
        min-width: 50px;
        height: 50px;
        font-size: 1.5em;
    }

    .balls-container .ball-value.special-balls {
        min-width: 65px;
        padding: 12px 10px;
        font-size: 1.3em;
    }

    .balls-container .ball-value.special-balls::after {
        font-size: 0.7em;
        margin-top: 5px;
    }

    .lottery-results-section p {
        font-size: 0.8em;
    }
}

/* --- (FIN) ESTILOS DE RESULTADOS DE LOTERIA --- */


/* -------------------------- */
/* ESTILOS DEL BOTÓN DE SCROLL */
/* -------------------------- */
#scrollBtn {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    /* Mantiene el botón en la misma posición */
    bottom: 3vh;
    /* 3% de la altura de la ventana (Responsive) */
    right: 3vw;
    /* 3% del ancho de la ventana (Responsive) */
    z-index: 999;
    /* Asegura que esté por encima de todo */
    cursor: pointer;
    /* Apariencia */
    width: 50px;
    height: 50px;
    background-color: #B91C1C;
    border: none;
    border-radius: 50%;
    /* Redondo */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s, transform 0.3s;
    /* Centrado de la flecha */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Estilo de la flecha interna (Creada con CSS) */
#scrollBtn::before {
    content: '';
    width: 10px;
    height: 10px;
    border-top: 3px solid white;
    border-right: 3px solid white;
    /* Gira y ajusta la posición para formar la punta de flecha */
    transform: translateY(20%) rotate(-45deg);
}

#scrollBtn:hover {
    background-color: #002D72;
    transform: scale(1.1);
}

/* Media Query para pantallas grandes (Escritorio) */
@media (min-width: 768px) {
    #scrollBtn {
        width: 60px;
        height: 60px;
        bottom: 30px;
        /* Posición fija en píxeles */
        right: 30px;
    }

    #scrollBtn::before {
        width: 12px;
        height: 12px;
    }
}

/* --- (INICIO) ESTILOS DEL FOOTER Y GUÍA --- */
/*
 Nota: La mayoría de estos estilos vienen de Tailwind.
 La configuración de Tailwind y los estilos base se cargan desde el CDN.
 Estos estilos son para el layout del footer.
*/
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Estilo para la fuente de la guía de loterías */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

main.flex-grow {
    flex-grow: 1;
}

/* --- (FIN) ESTILOS DEL FOOTER Y GUÍA --- */