/* WC Multi-Level Affiliates – Frontend Portal Styles */

.wc-mla-portal {
    font-family: inherit;
    color: #1a1a1a;
    max-width: 960px;
    margin: 0 auto;
}

/* Login / Register */
.wc-mla-login-prompt,
.wc-mla-register {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
}

.wc-mla-register h2 { margin-top: 0; }

.wc-mla-field {
    margin-bottom: 1rem;
    text-align: left;
}

.wc-mla-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.wc-mla-field input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Buttons */
.wc-mla-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}

.wc-mla-btn:hover { background: #135e96; }

/* Notices */
.wc-mla-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 14px;
}

.wc-mla-notice-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* Dashboard header */
.wc-mla-portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.wc-mla-portal-header h2 { margin: 0 0 6px; }

/* Rank / group / status badges */
.wc-mla-rank-badge,
.wc-mla-group-badge,
.wc-mla-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 4px;
}

.wc-mla-rank-badge   { background: #fef3c7; color: #92400e; }
.wc-mla-group-badge  { background: #e0e7ff; color: #3730a3; }
.wc-mla-status-active   { background: #d1fae5; color: #065f46; }
.wc-mla-status-inactive { background: #fee2e2; color: #991b1b; }
.wc-mla-status-pending  { background: #fef9c3; color: #713f12; }

/* Stats grid */
.wc-mla-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
}

.wc-mla-stat {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wc-mla-stat .label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.wc-mla-stat .value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
}

/* Referral box */
.wc-mla-referral-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.wc-mla-referral-box h3 { margin: 0 0 10px; font-size: 15px; }

.wc-mla-copy-wrap {
    display: flex;
    gap: 8px;
}

.wc-mla-copy-wrap input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #1e40af;
    font-family: monospace;
}

.wc-mla-ref-code-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: #4b5563;
}

/* Tabs */
.wc-mla-tab-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 -1px;
    display: flex;
    gap: 4px;
}

.wc-mla-tab-nav a {
    display: block;
    padding: 9px 18px;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    text-decoration: none;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    background: #f3f4f6;
    transition: background .15s;
}

.wc-mla-tab-nav a.active,
.wc-mla-tab-nav a:hover {
    background: #fff;
    color: #2271b1;
}

.wc-mla-tab-content {
    display: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0 6px 6px 6px;
    padding: 1.25rem;
}

.wc-mla-tab-content.active { display: block; }

/* Portal table */
.wc-mla-portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wc-mla-portal-table th,
.wc-mla-portal-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.wc-mla-portal-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.wc-mla-portal-table tr:last-child td { border-bottom: none; }

/* Pills (inline badges in tables) */
.wc-mla-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.wc-mla-pill-direct   { background: #e0e7ff; color: #3730a3; }
.wc-mla-pill-override { background: #fde68a; color: #78350f; }
.wc-mla-pill-pending  { background: #fef3c7; color: #92400e; }
.wc-mla-pill-approved { background: #dbeafe; color: #1e40af; }
.wc-mla-pill-paid     { background: #d1fae5; color: #065f46; }
.wc-mla-pill-cancelled{ background: #fee2e2; color: #991b1b; }
.wc-mla-pill-active   { background: #d1fae5; color: #065f46; }
.wc-mla-pill-inactive { background: #f3f4f6; color: #6b7280; }

/* Responsive */
@media (max-width: 600px) {
    .wc-mla-stats-grid   { grid-template-columns: 1fr 1fr; }
    .wc-mla-copy-wrap    { flex-direction: column; }
    .wc-mla-tab-nav      { flex-wrap: wrap; }
    .wc-mla-portal-table { display: block; overflow-x: auto; }
}

/* ── My Account integration ────────────────────────────────── */

/* Profile banner */
.wc-mla-profile-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e3a5f 0%, #2271b1 100%);
    color: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 10px;
}

.wc-mla-profile-name {
    margin: 0 0 6px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.wc-mla-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wc-mla-profile-id {
    font-size: 13px;
    opacity: .8;
    align-self: center;
}

/* Join hero */
.wc-mla-join-hero {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.wc-mla-join-hero h2 {
    margin-top: 0;
    color: #0c4a6e;
}

.wc-mla-join-rates {
    margin-top: 1rem;
}

.wc-mla-join-rates h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #0369a1;
}

.wc-mla-join-rates ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wc-mla-join-rates li {
    background: #fff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
}

/* Notice on My Account dashboard */
.wc-mla-join-notice {
    margin-bottom: 1rem;
}

/* Register form inside My Account */
.wc-mla-register-form {
    max-width: 480px;
}

/* Empty state */
.wc-mla-empty {
    color: #6b7280;
    font-style: italic;
    padding: 1rem 0;
}

/* ══════════════════════════════════════════════════════════
 * LOGIN PAGE  [wc_mla_login]
 * ══════════════════════════════════════════════════════════ */

.wc-mla-login-page,
.wc-mla-register-page {
    max-width: 560px;
    margin: 0 auto;
}

/* Auth box – shared by login + register */
.wc-mla-auth-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem 2.25rem;
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
}

.wc-mla-auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.wc-mla-auth-header h2,
.wc-mla-auth-header h3 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    color: #111827;
}

.wc-mla-auth-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* Form fields – extend existing .wc-mla-field */
.wc-mla-form .wc-mla-field input[type="text"],
.wc-mla-form .wc-mla-field input[type="email"],
.wc-mla-form .wc-mla-field input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}

.wc-mla-form .wc-mla-field input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34,113,177,.12);
}

.wc-mla-form .wc-mla-field label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: #374151;
}

.wc-mla-forgot-link {
    font-weight: 400;
    font-size: 12px;
    color: #2271b1;
    text-decoration: none;
}

.wc-mla-forgot-link:hover { text-decoration: underline; }

/* Password wrap with show/hide toggle */
.wc-mla-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.wc-mla-password-wrap input[type="password"],
.wc-mla-password-wrap input[type="text"] {
    flex: 1;
    padding-right: 42px !important;
}

.wc-mla-toggle-pw {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: .5;
    padding: 0;
    line-height: 1;
    transition: opacity .15s;
}

.wc-mla-toggle-pw:hover { opacity: 1; }

/* Remember / terms checkboxes */
.wc-mla-remember label,
.wc-mla-terms label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
}

/* Full-width button */
.wc-mla-btn-full {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 12px;
    font-size: 15px;
    border-radius: 8px;
    margin-top: 4px;
}

/* Outline variant */
.wc-mla-btn-outline {
    background: transparent !important;
    border: 2px solid #2271b1;
    color: #2271b1 !important;
}

.wc-mla-btn-outline:hover {
    background: #2271b1 !important;
    color: #fff !important;
}

/* Auth separator */
.wc-mla-auth-sep {
    display: inline-block;
    margin: 0 10px;
    color: #9ca3af;
    font-size: 13px;
}

/* Footer link row */
.wc-mla-auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.wc-mla-auth-footer a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

.wc-mla-auth-footer a:hover { text-decoration: underline; }

/* Error notice */
.wc-mla-notice-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 1rem;
    font-size: 13px;
}

/* ══════════════════════════════════════════════════════════
 * REGISTRATION PAGE  [wc_mla_register]
 * ══════════════════════════════════════════════════════════ */

.wc-mla-register-page {
    max-width: 640px;
}

/* Hero promo block */
.wc-mla-reg-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2271b1 100%);
    color: #fff;
    border-radius: 12px;
    padding: 2rem 2.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.wc-mla-reg-hero h2 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    color: #fff;
}

.wc-mla-reg-hero p {
    margin: 0 0 1.25rem;
    opacity: .85;
    font-size: 15px;
}

/* Commission rate badges in hero */
.wc-mla-reg-rates {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.wc-mla-rate-badge {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
}

.wc-mla-rate-badge .rate-level {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .8;
}

.wc-mla-rate-badge .rate-pct {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

/* Two-column name row */
.wc-mla-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Required star */
.req { color: #ef4444; margin-left: 2px; }

/* Password strength indicator */
.wc-mla-pw-strength {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    min-height: 16px;
}

/* Referral code hint */
.wc-mla-field-hint { font-size: 12px; margin: 4px 0 0; }
.wc-mla-hint-success { color: #065f46; }

/* ══════════════════════════════════════════════════════════
 * DASHBOARD  [wc_mla_portal]
 * ══════════════════════════════════════════════════════════ */

/* Dashboard max width wider */
.wc-mla-dashboard { max-width: 960px; margin: 0 auto; }

/* Dash header */
.wc-mla-dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e3a5f 0%, #2271b1 100%);
    color: #fff;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

.wc-mla-dash-name {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.wc-mla-dash-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wc-mla-dash-meta {
    text-align: right;
    font-size: 13px;
    color: rgba(255,255,255,.8);
    align-self: center;
}

.wc-mla-signout-link {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 12px;
    margin-top: 4px;
    display: inline-block;
}

.wc-mla-signout-link:hover { color: #fff; text-decoration: underline; }

/* Referral box two rows */
.wc-mla-ref-row { margin-bottom: 10px; }
.wc-mla-ref-row:last-child { margin-bottom: 0; }
.wc-mla-ref-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 5px;
}

/* Not-affiliate prompt */
.wc-mla-not-affiliate {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 2.5rem 2rem;
    text-align: center;
}

/* Login prompt on portal page */
.wc-mla-login-prompt {
    text-align: center;
    padding: 3rem 2rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.wc-mla-login-prompt p {
    color: #4b5563;
    font-size: 15px;
    margin-bottom: 1.25rem;
}

/* ══════════════════════════════════════════════════════════
 * RESPONSIVE
 * ══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .wc-mla-auth-box        { padding: 1.5rem 1.25rem; }
    .wc-mla-reg-hero        { padding: 1.5rem 1.25rem; }
    .wc-mla-form-row        { grid-template-columns: 1fr; gap: 0; }
    .wc-mla-dash-header     { flex-direction: column; }
    .wc-mla-dash-meta       { text-align: left; }
    .wc-mla-reg-rates       { gap: 8px; }
    .wc-mla-rate-badge      { padding: 8px 12px; }
    .wc-mla-rate-badge .rate-pct { font-size: 1.15rem; }
}

/* ══════════════════════════════════════════════════════════
 * CAMPAIGNS TAB
 * ══════════════════════════════════════════════════════════ */

.wc-mla-campaigns-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wc-mla-campaigns-header h3 { margin: 0; }

/* Campaign create/edit form */
.wc-mla-campaign-form-wrap {
    background: #f8faff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.wc-mla-campaign-form-wrap h4 {
    margin: 0 0 1rem;
    font-size: 15px;
    color: #1e40af;
}

/* 4-column UTM row */
.wc-mla-form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Section label above UTM row */
.wc-mla-field-group-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    margin: 1rem 0 6px;
}

/* Form action buttons row */
.wc-mla-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* Generated URL output box */
.wc-mla-generated-url-wrap {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #bfdbfe;
}

.wc-mla-generated-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}

/* Small copy wrap inside table */
.wc-mla-copy-wrap-sm {
    gap: 5px;
}

.wc-mla-copy-wrap-sm input[type="text"] {
    font-size: 11px;
    padding: 5px 8px;
    width: 160px;
    flex: none;
    font-family: monospace;
}

/* UTM tag pills in campaign list */
.wc-mla-utm-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 3px;
}

.wc-mla-utm-tag {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
}

/* Tracking URL input in table */
.wc-mla-tracking-url-input {
    font-size: 11px;
    font-family: monospace;
    color: #1e40af;
    background: #f0f6ff;
    border: 1px solid #bfdbfe !important;
    border-radius: 5px;
    padding: 5px 8px;
    width: 160px;
}

/* ══════════════════════════════════════════════════════════
 * BUTTON VARIANTS
 * ══════════════════════════════════════════════════════════ */

/* Small button */
.wc-mla-btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
}

/* Ghost / outlined button */
.wc-mla-btn-ghost {
    background: transparent !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
}

.wc-mla-btn-ghost:hover {
    background: #f3f4f6 !important;
    color: #111 !important;
}

/* Plain link-style button */
.wc-mla-btn-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
    line-height: 1;
}

.wc-mla-btn-link:hover { text-decoration: underline; }

/* Danger link */
.wc-mla-btn-danger { color: #dc2626 !important; }
.wc-mla-btn-danger:hover { color: #991b1b !important; }

/* ══════════════════════════════════════════════════════════
 * SETTINGS TAB
 * ══════════════════════════════════════════════════════════ */

.wc-mla-settings-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.wc-mla-settings-section h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.wc-mla-settings-section p {
    color: #4b5563;
    font-size: 13px;
    margin: 0 0 10px;
    line-height: 1.6;
}

/* Info grid (label : value pairs) */
.wc-mla-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.wc-mla-info-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-mla-info-item .info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    font-weight: 600;
}

.wc-mla-info-item .info-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.wc-mla-info-item code {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* ══════════════════════════════════════════════════════════
 * RESPONSIVE — CAMPAIGNS & SETTINGS
 * ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .wc-mla-form-row-4     { grid-template-columns: 1fr 1fr; }
    .wc-mla-info-grid      { grid-template-columns: 1fr; }
    .wc-mla-copy-wrap-sm input[type="text"] { width: 100%; }
    .wc-mla-tracking-url-input              { width: 100%; }
}

@media (max-width: 480px) {
    .wc-mla-form-row-4     { grid-template-columns: 1fr; }
    .wc-mla-form-actions   { flex-direction: column; }
    .wc-mla-campaign-form-wrap { padding: 1rem; }
}
