/* Estilos Modernos para o Plugin de Faturas */
.invoice-generator-container,
.client-invoices-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Botões Modernos */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Tabelas Responsivas */
.invoices-table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 20px 0;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
}

.invoices-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.invoices-table th,
.invoices-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.invoices-table tbody tr:hover {
    background-color: #f8f9ff;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pendente {
    background: #fff3cd;
    color: #856404;
}

.status-paga {
    background: #d1e7dd;
    color: #0f5132;
}

/* Modais Modernos */
.invoice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.invoice-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.invoice-modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 18px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
    border-top: 1px solid #eee;
}

/* Modal PIX Específico */
.pix-modal {
    max-width: 500px;
}

.pix-payment-content {
    padding: 24px;
}

.payment-method {
    text-align: center;
    margin-bottom: 24px;
}

.payment-method h4 {
    color: #2c3e50;
    margin: 0;
}

.qr-code-section {
    text-align: center;
    margin-bottom: 24px;
}

#qr-code-container {
    margin-bottom: 20px;
    padding: 20px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pix-code-section {
    text-align: left;
}

.code-input-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.code-input-wrapper input {
    flex: 1;
    font-family: monospace;
    font-size: 12px;
}

.btn-copy {
    padding: 12px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.timer-section {
    text-align: center;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 8px;
}

.countdown-timer {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
}

.payment-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6c757d;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsivo */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .invoices-table-wrapper {
        overflow-x: auto;
    }
    
    .invoices-table {
        min-width: 600px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn-modern {
        width: 100%;
        justify-content: center;
    }
}

/* Scroll Infinito */
.infinite-scroll .invoices-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
}

/* Animações */
.btn-modern {
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before {
    left: 100%;
}

/* Estados de Erro */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d1e7dd;
    color: #0f5132;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #badbcc;
}

/* Botão Pago (Desabilitado) */
.btn-pago {
    display: inline-block;
    padding: 8px 16px;
    background: #e9ecef;
    color: #6c757d;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: not-allowed;
}
