/* Estilos para el frontend - Encapsulados para evitar conflictos */

/* Contenedor principal */
.facturas-stripe-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
    line-height: inherit;
}

/* Alias para compatibilidad */
.facturas-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
    line-height: inherit;
}

/* Tabla de facturas */
.facturas-stripe-container .facturas-table,
.facturas-container .facturas-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: inherit;
}

.facturas-stripe-container .facturas-table th,
.facturas-container .facturas-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    font-size: inherit;
}

.facturas-stripe-container .facturas-table td,
.facturas-container .facturas-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
    font-size: inherit;
}

.facturas-stripe-container .facturas-table tr:hover,
.facturas-container .facturas-table tr:hover {
    background-color: #f8f9fa;
}

.facturas-stripe-container .facturas-table tr:last-child td,
.facturas-container .facturas-table tr:last-child td {
    border-bottom: none;
}

/* Estados de facturas */
.estado-factura {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    min-width: 100px;
    text-align: center;
}

.estado-pendiente {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.estado-parcial {
    background-color: #fff8e1;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.estado-completo {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Botones */
.facturas-stripe-container .btn-pagar,
.facturas-stripe-container .btn-ver,
.facturas-container .btn-pagar,
.facturas-container .btn-ver {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.facturas-stripe-container .btn-pagar,
.facturas-container .btn-pagar {
    background-color: #0073aa;
    color: white;
}

.facturas-stripe-container .btn-pagar:hover,
.facturas-container .btn-pagar:hover {
    background-color: #005a87;
    color: white;
}

.facturas-stripe-container .btn-ver,
.facturas-container .btn-ver {
    background-color: #6c757d;
    color: white;
}

.facturas-stripe-container .btn-ver:hover,
.facturas-container .btn-ver:hover {
    background-color: #545b62;
    color: white;
}

/* 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: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.close:hover {
    color: #000;
}

/* Formulario de pago */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

.monto-minimo-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.monto-minimo-info p {
    margin: 6px 0;
    color: #1565c0;
    font-size: 13px;
    line-height: 1.4;
}

.monto-minimo-info p:first-child {
    margin-top: 0;
    font-weight: bold;
    color: #0d47a1;
}

.monto-minimo-info p:last-child {
    margin-bottom: 0;
}

.monto-minimo-info strong {
    color: #d32f2f;
}

/* Elemento de tarjeta de Stripe */
#card-element {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

#card-element.StripeElement--focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

#card-element.StripeElement--invalid {
    border-color: #dc3545;
}

#card-errors {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
}

/* Botón de procesar pago */
#btn-procesar-pago {
    width: 100%;
    padding: 15px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#btn-procesar-pago:hover {
    background-color: #005a87;
}

#btn-procesar-pago:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Información de factura */
.factura-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.factura-info h3 {
    margin-top: 0;
    color: #333;
}

.factura-info p {
    margin: 10px 0;
    color: #666;
}

.factura-info strong {
    color: #333;
}

/* Tabla de pagos */
.pagos-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.pagos-table th,
.pagos-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.pagos-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

/* Mensajes */
.facturas-container p {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .facturas-container {
        padding: 10px;
    }
    
    .facturas-table {
        font-size: 14px;
    }
    
    .facturas-table th,
    .facturas-table td {
        padding: 10px 8px;
    }
    
    .facturas-table th:nth-child(3),
    .facturas-table th:nth-child(4),
    .facturas-table th:nth-child(6),
    .facturas-table td:nth-child(3),
    .facturas-table td:nth-child(4),
    .facturas-table td:nth-child(6) {
        display: none;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .btn-pagar,
    .btn-ver {
        display: block;
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .facturas-table th:nth-child(2),
    .facturas-table td:nth-child(2) {
        display: none;
    }
    
    .estado-factura {
        min-width: 80px;
        font-size: 11px;
        padding: 4px 8px;
    }
}

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

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

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notificaciones */
.notification {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.notification.success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.notification.error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.notification.warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    border: 1px solid #dee2e6;
    text-decoration: none;
    border-radius: 4px;
    color: #0073aa;
    transition: all 0.3s ease;
}

.pagination span.current {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.pagination a:hover {
    background-color: #f8f9fa;
    border-color: #0073aa;
}

/* Filtros */
.facturas-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.facturas-filters h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.filter-group {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Estadísticas */
.facturas-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* Animación para actualización de estadísticas */
.stat-card {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.updated {
    background-color: #d4edda;
    animation: updatePulse 1s ease-in-out;
}

@keyframes updatePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background-color: #c3e6cb; }
    100% { transform: scale(1); }
}

.stat-number {
    transition: color 0.3s ease;
}

.stat-card.updated .stat-number {
    color: #155724;
} 