/* =================================== */
/* ESTILOS PARA MÓDULO DE BINGO 2026   */
/* (Optimizado Desktop + Mobile UI/UX) */
/* =================================== */

/* ---- Contenedor Principal ---- */
.bingo-list-wrapper {
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* ---- Tarjetas de Bingo ---- */
.bingo-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-light);
    border-left: 6px solid var(--warning);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.bingo-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.bingo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.bingo-card.pagado {
    border-left-color: #10b981;
}

.bingo-card.pagado::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.bingo-card.pago-parcial {
    border-left-color: #0284c7;
}

.bingo-card.pago-parcial::before {
    background: linear-gradient(90deg, #0284c7, #0369a1);
}

/* ============================================ */
/* HEADER DE LA TARJETA                         */
/* Desktop: 2 columnas | Mobile: Vertical Stack */
/* ============================================ */
.bingo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.25rem;
    margin-bottom: 0.85rem;
    width: 100%;
}

/* ---- LADO IZQUIERDO: Info del Alumno ---- */
.bingo-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bingo-card-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.3;
    word-break: break-word;
}

.bingo-card-info h3 i {
    color: var(--primary);
    flex-shrink: 0;
}

/* Badge del curso */
.bingo-curso-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    background-color: #f1f5f9;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    width: fit-content;
}

.bingo-curso-badge i {
    color: #0284c7;
}

/* Fecha de pago */
.bingo-fecha-pago {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #059669;
    font-weight: 600;
}

/* ---- Hermanos inline ---- */
.bingo-hermanos-inline {
    margin-top: 0.4rem;
    font-size: 0.88rem;
}

.hermanos-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--dark);
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.hermanos-label i {
    color: #6366f1;
}

.hermanos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.hermano-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f8fafc;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--gray-light);
    font-size: 0.82rem;
    word-break: break-word;
}

.hermano-nombre {
    font-weight: 600;
    color: var(--dark);
}

.hermano-curso-badge {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================ */
/* LADO DERECHO: Caja de Cartones Prominente   */
/* ============================================ */
.bingo-card-cartones {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* La caja grande con el número de cartón */
.carton-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 135px;
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
    box-sizing: border-box;
}

.carton-box.carton-pendiente {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #fde68a;
}

.carton-box.carton-pagado {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid #a7f3d0;
}

.carton-box.carton-parcial {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #bae6fd;
}

.carton-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 0.1rem;
}

.carton-numero {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.carton-pagado .carton-numero {
    color: #059669;
}

.carton-pendiente .carton-numero {
    color: #d97706;
}

/* ---- Badge de estado ---- */
.bingo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-pagado {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-parcial {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-pendiente {
    background-color: #fef3c7;
    color: #92400e;
}

/* ---- Extras tags inline ---- */
.extras-tags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.extra-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #0f766e;
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ---- Acciones de la tarjeta ---- */
.bingo-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-light);
}

.bingo-card-actions .btn {
    min-height: 34px;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

/* ---- Panel colapsable de extras ---- */
.bingo-extras-panel {
    margin-top: 1rem;
    overflow: hidden;
    transition: var(--transition);
}

.extras-panel-inner {
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border: 1px dashed #cbd5e1;
}

.extras-panel-inner h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

.extras-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.extras-input-row label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

.extras-cantidad-input {
    width: 80px;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    background-color: white;
    transition: var(--transition);
}

.extras-cantidad-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

/* ---- Inputs de folio ---- */
.extras-folios-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.folio-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.folio-input-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray);
}

.folio-input {
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    transition: var(--transition);
}

.folio-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 105, 92, 0.15);
}

.extras-panel-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.extras-panel-actions .btn {
    min-height: 44px;
}

/* ---- Loading ---- */
.bingo-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3.5rem 1rem;
    color: var(--gray);
    font-size: 1rem;
    font-weight: 500;
}

.bingo-loading i {
    font-size: 1.6rem;
    color: var(--primary);
}

/* ---- Paginación ---- */
.bingo-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--gray-light);
    background: #ffffff;
}

.bingo-pagination .btn {
    min-height: 40px;
    min-width: 40px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 40px;
    color: var(--gray);
    font-weight: 700;
    letter-spacing: 1px;
}

.pagination-info {
    width: 100%;
    text-align: center;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 600;
}

/* ---- Empty state ---- */
.bingo-list-wrapper .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}

.bingo-list-wrapper .empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.bingo-list-wrapper .empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 700;
}

/* ============================================ */
/* RESPONSIVE MÓVIL (BINGO)                     */
/* ============================================ */
@media (max-width: 768px) {
    .bingo-list-wrapper {
        padding: 1rem 0.75rem;
    }

    .bingo-card {
        padding: 1.15rem 1rem;
        margin-bottom: 1rem;
    }

    /* Layout Vertical para Móviles */
    .bingo-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .bingo-card-cartones {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
        padding-top: 0;
        border-top: none;
    }

    .carton-box {
        width: 100%;
        min-width: 0;
        padding: 0.4rem 0.75rem;
    }

    .carton-numero {
        font-size: 1.2rem;
    }

    /* Botones compactos y adaptables en móvil */
    .bingo-card-actions {
        flex-direction: row !important;
        flex-wrap: wrap;
        width: 100%;
        gap: 0.35rem;
    }

    .bingo-card-actions .btn,
    .bingo-card-actions .btn-revertir-pago,
    .bingo-card-actions .badge-pagado-estatico {
        flex: 1 1 auto;
        min-width: 110px;
        min-height: 34px !important;
        font-size: 0.78rem !important;
        padding: 0.35rem 0.6rem !important;
        justify-content: center;
        display: flex;
        align-items: center;
    }

    .extras-panel-inner {
        padding: 1rem;
    }

    .extras-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .extras-cantidad-input {
        width: 100%;
    }

    .extras-folios-container {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .extras-panel-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .extras-panel-actions .btn {
        width: 100%;
        min-height: 46px;
    }

    .bingo-pagination {
        padding: 1rem 0.75rem;
        gap: 0.3rem;
    }

    .bingo-pagination .btn {
        min-height: 42px;
        min-width: 42px;
    }
}

@media (max-width: 480px) {
    .bingo-card-info h3 {
        font-size: 1.1rem;
    }

    .bingo-card-cartones {
        flex-direction: column;
        align-items: stretch;
    }

    .carton-box {
        width: 100%;
    }

    .bingo-badge {
        width: 100%;
        justify-content: center;
        padding: 0.45rem;
    }

    .hermanos-list {
        flex-direction: column;
        align-items: stretch;
    }

    .hermano-item {
        width: 100%;
        justify-content: space-between;
    }
}

/* ============================================================ */
/* NUEVOS ESTILOS: PÍLDORAS DE FOLIOS INDIVIDUALES Y MODAL PAGO */
/* ============================================================ */

/* Píldoras de folios en la tarjeta */
.bingo-folios-grid {
    display: flex;
    flex-wrap: wrap !important;
    gap: 0.4rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0.35rem 0;
}

.folio-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.folio-badge-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.folio-badge-pagado {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.folio-badge-pendiente {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* Modal de Pago Parcial (Estilos complementarios) */
.modal-pago-overlay.modal-pago-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.modal-pago-overlay.modal-pago-visible .modal-pago-card {
    transform: scale(1) translateY(0) !important;
}

.folio-check-item {
    transition: all 0.2s ease;
}

.folio-check-item:hover {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.folio-check-item.item-checked {
    border-color: #059669;
    background-color: #ecfdf5;
}

/* Indicador estático de pago completo (sustituto del botón redundante) */
.badge-pagado-estatico {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #059669;
    padding: 0.35rem 0.65rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    user-select: none;
}

/* Texto sutil cuando no hay folios asignados */
.sin-cartones-text {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Botón Deshacer / Revertir Pago */
.btn-revertir-pago {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #dc2626;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-revertir-pago:hover {
    background-color: #fecaca;
    color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.18);
}

.btn-revertir-pago:active {
    transform: translateY(0);
}