/* Estilos para el frontend de sorteos */

.sorteo-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.sorteo-container h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

.sorteo-container p {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
}

.sorteo-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    margin-bottom: 20px;
    /*max-width: 800px;*/
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.numero {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /*border: 2px solid #ccc; */
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    min-height: 50px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    transition: all 0.3s ease;
    padding: 2px;
}

.numero.libre {
    background-color: #bef781;
    color: 212529;
    border-color: #1e7e34;
}

.numero.libre.clickable {
    cursor: pointer;
}

.numero.libre.clickable:hover {
    background-color: #218838;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.numero.reservado {
    background-color: #f3f781;
    color: #212529;
    border-color: #d39e00;
}

.numero.confirmado {
    background-color: #f78181;
    color: #212529;
    border-color: #bd2130;
}

.numero-valor {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.numero-estado {
    font-size: 14px;
    margin-top: 4px;
    font-weight: normal;
}

.numero-nick {
    font-size: 14px;
    margin-top: 4px;
    font-weight: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
}

/* Leyenda */
.sorteo-leyenda {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

.color-libre,
.color-reservado,
.color-confirmado {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.color-libre {
    background-color: #bef781;
}

.color-reservado {
    background-color: #f3f781;
}

.color-confirmado {
    background-color: #f78181;
}

/* Modal */
.modal {
    display: none; 
    
    position: fixed;
    z-index: 1000;
    /* left: 0; */
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 25px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-content h3 {
    margin-top: 0;
    color: #333;
    text-align: center;
    margin-bottom: 25px;
}

.modal-content form p {
    margin-bottom: 15px;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.modal-content input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

.modal-content .button {
    width: 40%  ;
    background-color: #007cba;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.modal-content .button:hover {
    background-color: #005a87;
}

.modal-content input[type="submit"]:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.modal-content form p:last-child {
    text-align: center;
    margin-top: 25px;
}

/* Badge de reCAPTCHA */
.recaptcha-badge-info {
    background: #f0f7ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #0066cc;
}

.recaptcha-badge-info .dashicons {
    color: #0066cc;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.recaptcha-info {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
    margin-top: 15px;
}

.recaptcha-info a {
    color: #0066cc;
    text-decoration: none;
}

.recaptcha-info a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .sorteo-container {
        padding: 10px;
    }
    
    .sorteo-grid {
        gap: 3px;
        max-width: 100%;
    }
    
    .numero {
        min-height: 40px;
        font-size: 10px;
    }
    
    .numero-valor {
        font-size: 12px;
    }
    
    .numero-estado,
    .numero-nick {
        font-size: 8px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px;
    }
    
    .sorteo-leyenda {
        gap: 15px;
    }
    
    .leyenda-item {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .sorteo-grid {
        gap: 2px;
        max-width: 100%;
    }
    
    .numero {
        min-height: 35px;
        font-size: 9px;
    }
    
    .numero-valor {
        font-size: 11px;
    }
    
    .numero-estado,
    .numero-nick {
        font-size: 7px;
    }
}

/* Estilos adicionales para asegurar la matriz */
.sorteo-grid::after {
    content: "";
    display: block;
    clear: both;
}

.sorteo-container .sorteo-grid {
    display: grid !important;
    grid-template-columns: repeat(10, 1fr) !important;
}

/* Debug: temporal para verificar que se cargan los números */
.sorteo-grid:empty::before {
    content: "Cargando sorteo...";
    display: block;
    text-align: center;
    padding: 20px;
    color: #666;
    grid-column: 1 / -1;
}