/**
 * CSS: Gestión de Cuotas Centro de Padres
 * Autor: Antigravity AI & WordPress Expert
 * Descripción: Estilos premium del plugin, integrados visualmente con Flatsome.
 *              Incluye efectos de glassmorphism, responsive grid y badges semánticos.
 */

/* ==========================================================================
   1. CONTENEDOR PRINCIPAL Y DISEÑO GLASSMORPHISM
   ========================================================================== */

.cuotas-fe-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 0;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #2D3748;
}

/* Encabezado */
.cuotas-fe-header {
    margin-bottom: 25px;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 15px;
}

.cuotas-fe-header h3 {
    font-size: 1.6em;
    font-weight: 800;
    margin-bottom: 5px;
    color: #1a202c;
    letter-spacing: -0.5px;
}

.cuotas-fe-header p {
    font-size: 0.95em;
    color: #718096;
    margin: 0;
}

/* Grid de Información */
.cuotas-fe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .cuotas-fe-grid {
        grid-template-columns: 1fr;
    }
}

/* Tarjetas Estilo Glassmorphism */
.cuotas-fe-card.glass {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cuotas-fe-card.glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(148, 163, 184, 0.1);
}

.cuotas-fe-card-header h4 {
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #2d3748;
    border-left: 3px solid #446084; /* Color Flatsome azul corporativo */
    padding-left: 10px;
    line-height: 1.2;
}

/* Filas de Información */
.cuotas-fe-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
}

.cuotas-fe-info-row:last-child {
    border-bottom: none;
}

.cuotas-fe-info-row .lbl {
    font-size: 0.9em;
    font-weight: 600;
    color: #4a5568;
}

.cuotas-fe-info-row .val {
    font-size: 0.95em;
    font-weight: 700;
    color: #2d3748;
}

.cuotas-fe-info-row .val.highlight {
    font-family: monospace;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.cuotas-fe-info-row .val.price-highlight {
    font-size: 1.3em;
    color: #2d3748;
    font-weight: 800;
}

/* Descuentos */
.cuotas-fe-info-row.discount-row {
    background: #f0fdf4;
    margin: 5px -10px -10px -10px;
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed #bbf7d0;
}

.cuotas-fe-info-row.discount-row .lbl {
    color: #166534;
}

.cuotas-fe-info-row.discount-row .val {
    color: #15803d;
    font-weight: 800;
}

/* ==========================================================================
   2. BADGES SEMÁNTICOS (PAGADO / DEUDA)
   ========================================================================== */

.cuotas-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.8em;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Pagado - Soft Emerald Green */
.cuotas-badge-pagado {
    background-color: hsl(142, 70%, 94%);
    color: hsl(142, 80%, 18%);
    border: 1px solid hsl(142, 60%, 82%);
}

/* Pendiente - Soft Crimson Red */
.cuotas-badge-pendiente {
    background-color: hsl(355, 80%, 95%);
    color: hsl(355, 85%, 22%);
    border: 1px solid hsl(355, 65%, 85%);
}

/* ==========================================================================
   3. SECCIÓN DE ALUMNOS Y TABLAS PREMIUM
   ========================================================================== */

.cuotas-fe-section.glass {
    margin-top: 25px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.05);
}

.cuotas-fe-section h4 {
    font-size: 1.25em;
    font-weight: 800;
    margin: 0 0 15px 0;
    color: #1a202c;
}

/* Tabla */
.cuotas-fe-responsive-table {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.cuotas-fe-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.cuotas-fe-table th {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    font-size: 0.85em;
    border-bottom: 2px solid #edf2f7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cuotas-fe-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.95em;
    color: #2d3748;
}

.cuotas-fe-table tr:last-child td {
    border-bottom: none;
}

.cuotas-fe-table tr:hover td {
    background: rgba(247, 250, 252, 0.4);
}

/* Badge de Curso */
.cuotas-fe-tag-curso {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.8em;
    font-weight: 600;
    background: #edf2f7;
    color: #4a5568;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.cuotas-fe-empty {
    text-align: center;
    padding: 30px;
    background: #fff5f5;
    border-radius: 8px;
    border: 1px solid #fed7d7;
    color: #c53030;
    font-weight: 600;
}

/* ==========================================================================
   4. ÁREAS DE ACCIÓN Y BOTÓN PREMIUM INTERACTIVO
   ========================================================================== */

.cuotas-fe-action-area {
    margin-top: 25px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.cuotas-fe-action-area p {
    font-size: 0.95em;
    line-height: 1.6;
    color: #4a5568;
    margin: 0 0 20px 0;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* Botón de Pago con Degradado e Interacciones */
.cuotas-fe-btn-pagar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 250px;
    padding: 14px 28px;
    font-size: 1em;
    font-weight: 700;
    text-decoration: none !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #446084 0%, #2b3a4a 100%); /* Flatsome tonalidades oscuras premium */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(68, 96, 132, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.cuotas-fe-btn-pagar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(68, 96, 132, 0.4);
    background: linear-gradient(135deg, #4d6d96 0%, #324458 100%);
}

.cuotas-fe-btn-pagar:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(68, 96, 132, 0.3);
}

/* Estados de Error o Bloqueo */
.cuotas-fe-action-area.blocked {
    background: #fff5f5;
    border-color: #fed7d7;
}
.cuotas-fe-action-area.blocked p {
    color: #9b2c2c;
    font-weight: 600;
    margin: 0;
}

/* Estado de Éxito */
.cuotas-fe-action-area.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.cuotas-fe-action-area.success p {
    color: #166534;
    font-weight: 600;
    margin: 0;
    font-size: 1.05em;
}

/* ==========================================================================
   5. SPINNER Y ANIMACIONES PARA EL CARGANDO
   ========================================================================== */

.cuotas-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: cuotas-spin 0.8s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes cuotas-spin {
    to { transform: rotate(360deg); }
}

/* Resaltado dinámico del ítem en la revisión de pedido del checkout */
tr.cuota-checkout-highlight {
    background-color: rgba(240, 253, 244, 0.7) !important;
    border-left: 3px solid #2e7d32;
    transition: all 0.3s ease;
}
tr.cuota-checkout-highlight td {
    padding-left: 10px !important;
}
