/**
 * Frontend affiliate styles
 *
 * @package WC_Dynamic_Affiliate
 */

.wc-affiliate-dashboard {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.wc-affiliate-dashboard h3,
.wc-affiliate-dashboard h4 {
    margin-top: 30px;
    margin-bottom: 15px;
}

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

.stat-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #212529;
}

.stat-value.pending {
    color: #ffc107;
}

.stat-value.paid {
    color: #28a745;
}

.affiliate-link-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.affiliate-link-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.affiliate-link-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.copy-link-btn {
    padding: 10px 20px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.copy-link-btn:hover {
    background: #005a87;
}

.recent-commissions {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

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

.affiliate-commissions-table th,
.affiliate-commissions-table td {
    padding: 12px;
    text-align: left;
}

/* Affiliate Discount Styling - Green Color */
/* Target the fee row that contains "Affiliate Discount" text */
.woocommerce .cart_totals table.shop_table tr.fee,
.woocommerce-checkout-review-order-table tr.fee {
    /* Check if this row contains affiliate discount */
}

/* Style affiliate discount amount - using attribute selector approach */
.woocommerce .cart_totals table.shop_table tr.fee td:last-child,
.woocommerce-checkout-review-order-table tr.fee td:last-child {
    /* Will be styled via filter */
}
    border-bottom: 1px solid #dee2e6;
}

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

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

.status-pending {
    color: #ffc107;
    font-weight: 600;
}

.status-paid {
    color: #28a745;
    font-weight: 600;
}

/* Cart discount display */
.woocommerce-cart .affiliate-discount th,
.woocommerce-cart .affiliate-discount td {
    color: #28a745;
    font-weight: 600;
}

/* Affiliate Discount Fee - Green Color */
.woocommerce .cart_totals table.shop_table tr.fee td:last-child,
.woocommerce-checkout-review-order-table tr.fee td:last-child {
    /* Target the amount column */
}

.affiliate-discount-amount {
    color: #28a745 !important;
    font-weight: 600;
}

/* Style affiliate discount row - make amount green */
.woocommerce table.shop_table tr.fee td:last-child .amount,
.woocommerce-checkout-review-order-table tr.fee td:last-child .amount {
    /* Will be styled via filter */
}

/* Responsive */
@media (max-width: 768px) {
    .affiliate-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .affiliate-link-container {
        flex-direction: column;
    }
    
    .affiliate-commissions-table {
        font-size: 14px;
    }
    
    .affiliate-commissions-table th,
    .affiliate-commissions-table td {
        padding: 8px;
    }
}
