/* Dimi Affiliate Frontend Styles */

/* .dimi-affiliate-register-wrap is owned by registration.css now —
   leaving it here would force max-width: 800px and re-narrow the
   redesigned full-bleed register layout. */
.dimi-affiliate-dashboard-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.dimi-affiliate-dashboard {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.stat-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.stat-box h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.stat-box .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
}

.affiliate-tools {
    margin: 30px 0;
}

.affiliate-tools h4,
.affiliate-tools h5 {
    color: #495057;
    margin-bottom: 15px;
}

.affiliate-links input[type="text"],
.affiliate-links input[type="url"] {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-bottom: 10px;
}

.affiliate-links button {
    padding: 10px 20px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.affiliate-links button:hover {
    background: #005a87;
}

#generate-link-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#generate-link-form input {
    flex: 1;
    margin-bottom: 0 !important;
}

.payout-request {
    margin-top: 20px;
    padding: 20px;
    background: #e7f3ff;
    border: 1px solid #b3d8ff;
    border-radius: 6px;
}

.payout-pending {
    margin-top: 20px;
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.payout-pending h5 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #721c24;
}

.payout-pending .pending-message {
    color: #721c24;
    margin: 10px 0;
    font-size: 14px;
}

.payout-pending .pending-note {
    color: #6f6f6f;
    margin: 10px 0;
    font-size: 13px;
    font-style: italic;
}

.payout-info {
    margin-top: 20px;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.payout-info h5 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #856404;
}

.payout-info p {
    margin: 10px 0;
    font-size: 14px;
}

.payout-info .payout-minimum {
    color: #495057;
}

.payout-info .payout-needed {
    color: #856404;
    font-weight: 500;
}

.recent-referrals {
    margin-top: 30px;
}

.referrals-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

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

.referrals-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

/* Form styles */
.form-group,
.form-row {
    margin-bottom: 20px;
}

.form-group label,
.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

/* Status messages */
.dimi-affiliate-pending,
.dimi-affiliate-rejected,
.dimi-affiliate-suspended,
.dimi-affiliate-error {
    padding: 20px;
    border-radius: 6px;
    text-align: center;
}

.dimi-affiliate-pending {
    background: #fff3cd;
    border: 1px solid #ffecb5;
    color: #856404;
}

.dimi-affiliate-rejected,
.dimi-affiliate-suspended,
.dimi-affiliate-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.dimi-affiliate-login {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

/* Status badges */
.status-pending { 
    background: #fff3cd; 
    color: #856404; 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 12px;
    font-weight: 500;
}

.status-confirmed { 
    background: #d4edda; 
    color: #155724; 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 12px;
    font-weight: 500;
}

.status-rejected { 
    background: #f8d7da; 
    color: #721c24; 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 12px;
    font-weight: 500;
}

/* Shortcode stats */
.dimi-affiliate-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.dimi-affiliate-stats .stat-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    min-width: 150px;
}

.dimi-affiliate-stats .stat-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.dimi-affiliate-stats .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
}

/* Payout History */
.payout-history {
    margin-top: 30px;
}

.payouts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.payouts-table th,
.payouts-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.payouts-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

.payouts-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

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

.status-completed {
    background: #d1edff;
    color: #0c5460;
    border: 1px solid #b3d8ff;
}

.status-processing {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.not-processed,
.no-transaction {
    color: #6c757d;
    font-style: italic;
}

.payout-notes {
    background: #f8f9fa !important;
}

.payout-notes td {
    border-top: none !important;
    padding-top: 5px !important;
    padding-bottom: 15px !important;
}

.notes-content {
    font-size: 13px;
    color: #6c757d;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.no-payouts {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .affiliate-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .stat-box {
        padding: 15px;
    }
    
    .stat-box .stat-value {
        font-size: 20px;
    }
    
    #generate-link-form {
        flex-direction: column;
    }
    
    .dimi-affiliate-stats {
        flex-direction: column;
    }
    
    .referrals-table {
        font-size: 14px;
    }
    
    .referrals-table th,
    .referrals-table td {
        padding: 8px;
    }
}
