/* Frontend MLM - Dashboard e Shortcodes */

.mlm-dashboard,
.mlm-register-form,
.mlm-network {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header do Dashboard */
.mlm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.mlm-header-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mlm-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mlm-user-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.mlm-btn-logout {
    background: #dc3545;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.mlm-btn-logout:hover {
    background: #c82333;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.mlm-header h2 {
    margin: 0;
    color: #333;
}

/* Responsivo para header */
@media (max-width: 768px) {
    .mlm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .mlm-header-right {
        align-self: flex-end;
    }
}

.mlm-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

.mlm-status-active {
    background: #d4edda;
    color: #155724;
}

.mlm-status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Stats Row */
.mlm-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mlm-stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

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

.mlm-stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.mlm-stat-value {
    font-size: 28px;
    font-weight: bold;
}

/* Link de Afiliado */
.mlm-affiliate-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mlm-affiliate-link h3 {
    margin-top: 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    margin-bottom: 20px;
}

.mlm-link-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    margin-bottom: 20px;
}

.mlm-link-box input {
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255,255,255,0.9);
    color: #333;
}

.mlm-link-box button {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mlm-link-box button:hover {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* QR Code Section */
.mlm-qr-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    text-align: center;
}

.mlm-qr-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: rgba(255,255,255,0.9);
}

.mlm-qr-container {
    display: inline-block;
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.mlm-qr-container canvas {
    display: block;
    border-radius: 4px;
}

.mlm-qr-download {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

.mlm-qr-download:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.mlm-hint {
    margin: 0;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

/* Botões */
.mlm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.mlm-btn-primary {
    background: #667eea;
    color: white;
}

.mlm-btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.mlm-btn-success {
    background: #27ae60;
    color: white;
}

.mlm-btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

/* Withdrawal Box */
.mlm-withdrawal-box {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #27ae60;
    margin-bottom: 30px;
}

.mlm-withdrawal-box h3 {
    margin-top: 0;
    color: #27ae60;
}

.mlm-form-row {
    margin-bottom: 20px;
}

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

.mlm-form-row input,
.mlm-form-row select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.mlm-form-row input:focus,
.mlm-form-row select:focus {
    outline: none;
    border-color: #667eea;
}

/* Tabela de Comissões */
.mlm-commissions-table {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.mlm-commissions-table h3 {
    margin-top: 0;
    color: #333;
}

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

.mlm-commissions-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.mlm-commissions-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.mlm-commissions-table tr:hover {
    background: #f8f9fa;
}

.mlm-commissions-table strong {
    color: #27ae60;
}

/* Formulário de Registro */
.mlm-register-form {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.mlm-register-form h2 {
    margin-top: 0;
    color: #333;
}

.mlm-form-group {
    margin-bottom: 25px;
}

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

.mlm-form-group input,
.mlm-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

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

.mlm-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.mlm-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    color: #721c24;
}

.mlm-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    color: #155724;
}

/* Rede de Afiliados */
.mlm-network {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.mlm-network h2 {
    margin-top: 0;
    color: #333;
}

.mlm-network-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.mlm-stat-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 25px;
    border-radius: 12px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mlm-stat-card strong {
    display: block;
    font-size: 36px;
    margin-bottom: 8px;
}

.mlm-stat-card span {
    font-size: 14px;
    opacity: 0.9;
}

.mlm-network-tree table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.mlm-network-tree th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.mlm-network-tree td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.mlm-network-tree tr:hover {
    background: #f8f9fa;
}

.mlm-network-tree code {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.mlm-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.mlm-badge-active {
    background: #d4edda;
    color: #155724;
}

.mlm-badge-pending {
    background: #fff3cd;
    color: #856404;
}

/* Cadastro Expresso */
.mlm-register-express {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.mlm-register-header {
    text-align: center;
    margin-bottom: 30px;
}

.mlm-register-header h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.mlm-sponsor-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.mlm-form-row-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.mlm-pix-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.mlm-pix-section h3 {
    margin-top: 0;
    color: #27ae60;
}

.mlm-form-actions {
    margin-top: 30px;
    text-align: center;
}

.mlm-btn-large {
    padding: 16px 40px;
    font-size: 16px;
    width: 100%;
}

.mlm-terms {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 20px;
}

.mlm-success-box {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.mlm-success-box h3 {
    margin-top: 0;
    color: white;
}

.mlm-credentials {
    background: rgba(255,255,255,0.2);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.mlm-credentials code {
    background: rgba(255,255,255,0.3);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 16px;
}

/* Árvore Genealógica */
.mlm-tree-view {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
}

.mlm-upline-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
}

.mlm-upline-chain {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.mlm-upline-member {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 150px;
}

.mlm-upline-member.mlm-you {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mlm-upline-member.mlm-you code {
    color: white;
    background: rgba(255,255,255,0.2);
}

.mlm-upline-level {
    display: block;
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

.mlm-arrow {
    font-size: 24px;
    color: #667eea;
}

.mlm-downline-section {
    margin-top: 30px;
}

.mlm-tree-container {
    margin-top: 30px;
    overflow-x: auto;
}

.mlm-tree-level {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-left: 40px;
}

.mlm-tree-level-0 {
    padding-left: 0;
}

.mlm-tree-node {
    position: relative;
}

.mlm-tree-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    min-width: 220px;
    transition: all 0.3s;
}

.mlm-tree-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.mlm-tree-status-active .mlm-tree-card {
    border-color: #27ae60;
}

.mlm-tree-status-pending .mlm-tree-card {
    border-color: #f39c12;
}

.mlm-tree-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    margin: 0 auto 10px;
}

.mlm-tree-info {
    text-align: center;
}

.mlm-tree-info strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.mlm-tree-info code {
    display: block;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
}

.mlm-tree-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

.mlm-tree-stats span {
    padding: 3px 6px;
    background: #f8f9fa;
    border-radius: 4px;
}

.mlm-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* Estatísticas Avançadas */
.mlm-advanced-stats {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
}

.mlm-badge-section {
    margin-bottom: 40px;
}

.mlm-current-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    border: 4px solid;
    margin-bottom: 30px;
}

.mlm-current-badge h2 {
    margin: 0;
    font-size: 36px;
}

.mlm-next-badge {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
}

.mlm-next-badge h3 {
    margin-top: 0;
    color: #667eea;
}

.mlm-progress-item {
    margin-bottom: 20px;
}

.mlm-progress-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.mlm-progress-bar {
    width: 100%;
    height: 25px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 5px;
}

.mlm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.mlm-max-level {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    font-size: 18px;
}

.mlm-stats-grid-advanced {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mlm-stat-card-advanced {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
}

.mlm-stat-card-advanced h4 {
    margin-top: 0;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.mlm-level-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.mlm-level-stat:last-child {
    border-bottom: none;
}

.mlm-performer {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.mlm-performer:last-child {
    border-bottom: none;
}

.mlm-rank {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.mlm-performer strong {
    flex: 1;
}

.mlm-amount {
    color: #27ae60;
    font-weight: bold;
}

.mlm-monthly-chart {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
}

.mlm-monthly-chart h3 {
    margin-top: 0;
    color: #667eea;
}

/* Responsivo */
@media (max-width: 768px) {
    .mlm-stats-row,
    .mlm-network-stats {
        grid-template-columns: 1fr;
    }
    
    .mlm-link-box {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .mlm-affiliate-link {
        padding: 20px 15px;
    }
    
    .mlm-qr-container {
        padding: 10px;
    }
    
    .mlm-qr-container canvas {
        max-width: 150px;
        height: auto;
    }
    
    .mlm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .mlm-register-form,
    .mlm-network {
        padding: 20px;
    }
    
    .mlm-upline-chain {
        flex-direction: column;
    }
    
    .mlm-arrow {
        transform: rotate(90deg);
    }
    
    .mlm-tree-level {
        padding-left: 20px;
    }
    
    .mlm-form-row-group {
        grid-template-columns: 1fr;
    }
    
    .mlm-register-express,
    .mlm-tree-view,
    .mlm-advanced-stats {
        padding: 20px;
    }
}
