/* Note: This file uses standalone colors. Consider adopting shared design tokens from premium-shared.css in future. */

/**
 * Affiliate Plugin — Frontend Stylesheet
 *
 * Styles for the affiliate dashboard modal, referral cards, and stats.
 * Replaces all inline style="" attributes from class-affiliate-ajax.php.
 */

/* ---------------------------------------------------------------
   Affiliate Modal — Code Display
   --------------------------------------------------------------- */
.strp-sub-modal-code-section {
    text-align: center;
    margin-bottom: 30px;
}

.strp-sub-modal-code-label {
    font-size: .875rem;
    color: #666;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.strp-sub-modal-code-row {
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.strp-sub-modal-code-value {
    font-size: 2rem;
    font-weight: 800;
    color: #8444F9;
    letter-spacing: 3px;
    padding: 12px 30px;
    background: rgba(132, 68, 249, .1);
    border: 2px solid rgba(132, 68, 249, .3);
    border-radius: 12px;
    font-family: monospace;
}

.strp-sub-modal-copy-btn {
    background: rgba(132, 68, 249, .1);
    border: 2px solid rgba(132, 68, 249, .3);
    border-radius: 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #8444F9;
}

/* ---------------------------------------------------------------
   Affiliate Modal — Stats Grid
   --------------------------------------------------------------- */
.strp-sub-modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.strp-sub-modal-stat {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid;
}

.strp-sub-modal-stat--purple {
    background: rgba(132, 68, 249, .05);
    border-color: rgba(132, 68, 249, .2);
}

.strp-sub-modal-stat--green {
    background: rgba(0, 212, 170, .05);
    border-color: rgba(0, 212, 170, .2);
}

.strp-sub-modal-stat__value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.strp-sub-modal-stat--purple .strp-sub-modal-stat__value {
    color: #8444F9;
}

.strp-sub-modal-stat--green .strp-sub-modal-stat__value {
    color: #00d4aa;
}

.strp-sub-modal-stat__label {
    color: #666;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ---------------------------------------------------------------
   Affiliate Modal — Payout Settings
   --------------------------------------------------------------- */
.strp-sub-modal-payout-settings {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
}

.strp-sub-modal-payout-settings h4 {
    margin: 0 0 20px;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.strp-sub-modal-field {
    margin-bottom: 20px;
}

.strp-sub-modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.strp-sub-modal-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.strp-sub-modal-save-btn {
    background: linear-gradient(135deg, #8444F9, #00d4aa);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
}

/* ---------------------------------------------------------------
   Affiliate Modal — Last Payout
   --------------------------------------------------------------- */
.strp-sub-modal-last-payout {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .05);
    margin-top: 20px;
}

.strp-sub-modal-last-payout__label {
    font-size: .85rem;
    color: #666;
    margin-bottom: 8px;
}

.strp-sub-modal-last-payout__value {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

/* ---------------------------------------------------------------
   Affiliate Modal — Pending Badge
   --------------------------------------------------------------- */
.strp-sub-pending-badge {
    display: inline-block;
    background: rgba(0, 212, 170, .1);
    border: 1px solid rgba(0, 212, 170, .3);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: .9rem;
    font-weight: 700;
    color: #00d4aa;
    margin-top: 10px;
}

/* ---------------------------------------------------------------
   Referral Summary (AJAX-loaded)
   --------------------------------------------------------------- */
.strp-sub-referral-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.strp-sub-referral-stat {
    font-size: 24px;
    font-weight: bold;
}

.strp-sub-referral-stat--blue  { color: #2271b1; }
.strp-sub-referral-stat--green { color: #00a32a; }
.strp-sub-referral-stat--muted { color: #666; }

.strp-sub-referral-stat-label {
    color: #666;
    font-size: 13px;
}

/* ---------------------------------------------------------------
   Referral Breakdown (AJAX-loaded)
   --------------------------------------------------------------- */
.strp-sub-referral-breakdown {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.strp-sub-referral-breakdown__title {
    margin: 0 0 15px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.strp-sub-referral-breakdown__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.strp-sub-referral-breakdown__value {
    font-size: 2rem;
    font-weight: bold;
    color: #8444F9;
}

.strp-sub-referral-breakdown__label {
    color: #666;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---------------------------------------------------------------
   Referral Cards (AJAX-loaded)
   --------------------------------------------------------------- */
.strp-sub-referral-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.strp-sub-referral-card--paid {
    background: #f9f9f9;
}

.strp-sub-referral-card__header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.strp-sub-referral-card__order-id {
    font-size: 16px;
}

.strp-sub-referral-card__date {
    color: #666;
}

.strp-sub-referral-card__commission {
    text-align: right;
}

.strp-sub-referral-card__amount {
    font-size: 18px;
    font-weight: bold;
    color: #2271b1;
}

.strp-sub-referral-card__rate {
    font-size: 12px;
    color: #666;
}

.strp-sub-referral-card__calc {
    color: #666;
    margin-bottom: 8px;
}

.strp-sub-referral-card__customer {
    background: #f0f6fc;
    border-left: 3px solid #2271b1;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.strp-sub-referral-card__customer-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.strp-sub-referral-card__customer-info {
    font-size: 13px;
    color: #333;
}

.strp-sub-referral-card__customer-info a {
    color: #2271b1;
    text-decoration: none;
}

/* ---------------------------------------------------------------
   Referral Status Badges
   --------------------------------------------------------------- */
.strp-sub-referral-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.strp-sub-referral-status--paid {
    background: #d4edda;
    color: #155724;
}

.strp-sub-referral-status--trial {
    background: #ffc107;
    color: #333;
}

.strp-sub-referral-status--pending {
    background: #fff3cd;
    color: #856404;
}

/* RTL Support */
[dir="rtl"] .strp-sub-referral-card {
    border-left: none;
    border-right: 3px solid #2271b1;
}

[dir="rtl"] .strp-sub-stats-grid {
    direction: rtl;
}

[dir="rtl"] .strp-sub-modal-content {
    text-align: right;
}

/* Accessibility: Focus styles (WCAG 2.1 AA) */
.strp-sub-stats-card *:focus-visible,
.strp-sub-modal-box *:focus-visible,
.strp-sub-copy-btn:focus-visible,
.strp-sub-save-iban-btn:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

input:focus-visible,
button:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 1px;
}

@media (max-width: 600px) {
    .strp-sub-modal-stats-grid,
    .strp-sub-referral-breakdown__grid {
        grid-template-columns: 1fr;
    }
}
