/**
 * Estilos Frontend - TEDx Créditos Prepagados
 * Version: 1.0.0
 * 
 * Estilos para mostrar información de créditos en carrito y checkout
 */

/* ========================================
   Mensaje de Crédito Aplicado
   ======================================== */
.woocommerce-message.tedx-credito-mensaje {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tedx-credito-mensaje::before {
    content: '💳';
    font-size: 24px;
}

.tedx-credito-mensaje strong {
    color: #065f46;
}

/* ========================================
   Info de Balance en Carrito
   ======================================== */
.tedx-credito-info-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tedx-credito-info-box h3 {
    margin-top: 0;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tedx-credito-info-box h3::before {
    content: '🎁';
    font-size: 24px;
}

.tedx-credito-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.tedx-credito-balance-item {
    text-align: center;
}

.tedx-credito-balance-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.tedx-credito-balance-valor {
    font-size: 24px;
    font-weight: bold;
    color: #fbbf24;
}

/* ========================================
   Fee de Crédito en Tabla
   ======================================== */
.cart_totals .order-total .tedx-credito-fee,
.woocommerce-checkout-review-order-table .tedx-credito-fee {
    color: #10b981;
    font-weight: bold;
}

.cart-discount.coupon-tedxcredito,
.cart-discount[class*="credito"] {
    background: #f0fdf4;
}

.cart-discount.coupon-tedxcredito th,
.cart-discount[class*="credito"] th {
    color: #065f46;
}

.cart-discount.coupon-tedxcredito td,
.cart-discount[class*="credito"] td {
    color: #10b981;
    font-weight: bold;
}

/* ========================================
   Alerta de Saldo Bajo
   ======================================== */
.tedx-credito-alerta {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.tedx-credito-alerta::before {
    content: '⚠️ ';
}

.tedx-credito-alerta strong {
    color: #92400e;
}

/* ========================================
   Badge de Crédito
   ======================================== */
.tedx-credito-badge {
    display: inline-block;
    background: #10b981;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
}

/* ========================================
   Loading State
   ======================================== */
.tedx-credito-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f4f6;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: tedx-spin 0.8s linear infinite;
}

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

/* ========================================
   Error State
   ======================================== */
.tedx-credito-error {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    color: #991b1b;
}

.tedx-credito-error::before {
    content: '❌ ';
}

/* ========================================
   Thank You Page
   ======================================== */
.woocommerce-order-received .tedx-credito-usado {
    background: #f0fdf4;
    border: 2px solid #10b981;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.tedx-credito-usado h3 {
    color: #065f46;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tedx-credito-usado h3::before {
    content: '💳';
    font-size: 24px;
}

.tedx-credito-usado-detalles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.tedx-credito-usado-item {
    background: white;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.tedx-credito-usado-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.tedx-credito-usado-valor {
    font-size: 20px;
    font-weight: bold;
    color: #065f46;
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 768px) {
    .tedx-credito-balance {
        flex-direction: column;
        gap: 15px;
    }
    
    .tedx-credito-balance-item {
        width: 100%;
    }
    
    .tedx-credito-usado-detalles {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Animaciones
   ======================================== */
@keyframes tedx-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tedx-credito-mensaje,
.tedx-credito-info-box,
.tedx-credito-alerta {
    animation: tedx-fadeIn 0.3s ease-out;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .tedx-credito-info-box {
        background: white;
        color: black;
        border: 1px solid #e5e7eb;
    }
    
    .tedx-credito-balance-valor {
        color: black;
    }
}
