/* =========================================
   AYLA AFILIADOS - CENTRAL CSS
   ========================================= */

/* Container principal */
#central-afiliados {
    width: 100%;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(180deg, #0a0a0a 0%, #111111 100%);
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-y: auto;
}

/* Header */
.afiliado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.afiliado-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.afiliado-header .btn-voltar {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #888;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.afiliado-header .btn-voltar:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

/* Grid de Cards Saldo */
.afiliados-saldo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.saldo-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
}

.saldo-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

.saldo-card .label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.saldo-card .valor {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
}

.saldo-card.destaque {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.saldo-card.destaque .valor {
    color: #10b981;
}

.saldo-card.pendente .valor {
    color: #f59e0b;
}

.saldo-card.pago .valor {
    color: #3b82f6;
}

/* Link Afiliado Section */
.afiliados-link-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.afiliados-link-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #fff;
}

.link-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.link-input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 14px 16px;
    color: #10b981;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.link-input:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.5);
}

.btn-copiar {
    background: #10b981;
    color: #000;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copiar:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-copiar.copiado {
    background: #3b82f6;
}

/* Estatísticas Grid */
.afiliados-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-card .numero {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.stat-card .desc {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabela Comissões */
.afiliados-comissoes-section {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.afiliados-comissoes-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.comissoes-table {
    width: 100%;
    border-collapse: collapse;
}

.comissoes-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.comissoes-table td {
    padding: 16px;
    font-size: 0.9rem;
    color: #ccc;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.comissoes-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pendente {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-badge.aprovada {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-badge.paga {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-badge.cancelada {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Seção Saque */
.afiliados-saque-section {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.afiliados-saque-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.saque-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.5);
}

.form-group select option {
    background: #1a1a1a;
    color: #fff;
}

.btn-sacar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #000;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: fit-content;
}

.btn-sacar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-sacar:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Dados Bancários */
.afiliados-banco-section {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 24px;
}

.afiliados-banco-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.banco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.banco-grid .form-group input {
    width: 100%;
}

.btn-salvar-banco {
    grid-column: 1 / -1;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-salvar-banco:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

/* Loading State */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.loading-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state p {
    margin: 0;
}

/* Toast Notification */
.toast-afiliados {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #10b981;
    color: #000;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast-afiliados.erro {
    background: #ef4444;
    color: #fff;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #central-afiliados {
        padding: 16px;
    }

    .afiliado-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .afiliado-header h2 {
        font-size: 1.4rem;
    }

    .link-container {
        flex-direction: column;
    }

    .btn-copiar {
        width: 100%;
    }

    .saque-form {
        grid-template-columns: 1fr;
    }

    .comissoes-table {
        display: block;
        overflow-x: auto;
    }
}
