/* Webboll Affiliate - Public CSS */
:root {
    --wba-brand: #7c3aed;
    --wba-bg: #f8fafc;
    --wba-card: #ffffff;
    --wba-border: #e2e8f0;
    --wba-text: #1e293b;
    --wba-muted: #64748b;
    --wba-radius: 12px;
    --wba-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
}

.wba-wrap * { box-sizing: border-box; }
.wba-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--wba-text); max-width: 960px; margin: 0 auto; padding: 0 0 40px; }

/* Header */
.wba-header { background: var(--brand, var(--wba-brand)); color: #fff; border-radius: var(--wba-radius); padding: 24px; margin-bottom: 24px; }
.wba-header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.wba-header-left { display: flex; align-items: center; gap: 14px; }
.wba-avatar { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.wba-username { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.wba-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #fff; }
.wba-balance-box { text-align: right; }
.wba-balance-label { font-size: 12px; opacity: .8; margin-bottom: 2px; }
.wba-balance-amount { font-size: 28px; font-weight: 800; }

/* Level progress */
.wba-level-progress { margin-top: 18px; }
.wba-progress-info { display: flex; justify-content: space-between; font-size: 13px; opacity: .9; margin-bottom: 6px; }
.wba-progress-bar { height: 8px; background: rgba(255,255,255,.25); border-radius: 4px; overflow: hidden; }
.wba-progress-fill { height: 100%; background: #fff; border-radius: 4px; transition: width .5s ease; }

/* Tabs */
.wba-tabs { display: flex; gap: 4px; background: var(--wba-bg); border: 1px solid var(--wba-border); border-radius: 10px; padding: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.wba-tab { flex: 1; min-width: 100px; padding: 8px 14px; border: none; background: transparent; border-radius: 7px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--wba-muted); transition: all .2s; }
.wba-tab:hover { background: var(--wba-card); color: var(--wba-text); }
.wba-tab.active { background: var(--wba-card); color: var(--wba-brand); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Tab content */
.wba-tab-content { display: none; }
.wba-tab-content.active { display: block; }

/* Stat cards */
.wba-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.wba-stat-card { background: var(--wba-card); border: 1px solid var(--wba-border); border-radius: var(--wba-radius); padding: 20px; text-align: center; box-shadow: var(--wba-shadow); }
.wba-stat-icon { font-size: 28px; margin-bottom: 8px; }
.wba-stat-value { font-size: 22px; font-weight: 700; color: var(--wba-text); margin-bottom: 4px; }
.wba-stat-label { font-size: 12px; color: var(--wba-muted); font-weight: 500; }

/* Cards */
.wba-card { background: var(--wba-card); border: 1px solid var(--wba-border); border-radius: var(--wba-radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--wba-shadow); }
.wba-card h3 { margin: 0 0 16px; font-size: 16px; font-weight: 600; }

/* Link box */
.wba-link-card {}
.wba-link-row { display: flex; gap: 8px; margin-bottom: 8px; }
.wba-link-row input { flex: 1; padding: 10px 12px; border: 1px solid var(--wba-border); border-radius: 8px; font-size: 13px; background: var(--wba-bg); color: var(--wba-text); min-width: 0; }
.wba-link-hint { font-size: 12px; color: var(--wba-muted); margin: 0; }

/* Buttons */
.wba-btn { padding: 9px 18px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .2s; }
.wba-btn-primary { background: var(--wba-brand); color: #fff; }
.wba-btn-primary:hover { filter: brightness(1.1); }
.wba-btn-secondary { background: var(--wba-bg); color: var(--wba-text); border: 1px solid var(--wba-border); }
.wba-btn-secondary:hover { background: var(--wba-border); }
.wba-btn-copy { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; white-space: nowrap; }
.wba-btn-copy:hover { background: #dcfce7; }

/* Commission info */
.wba-commission-info { display: flex; flex-direction: column; gap: 12px; }
.wba-commission-info > div { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--wba-border); }
.wba-commission-info > div:last-child { border-bottom: none; }
.wba-comm-label { font-size: 13px; color: var(--wba-muted); min-width: 140px; }
.wba-comm-rate { font-size: 18px; color: var(--wba-brand); }

/* Chart */
.wba-chart-wrap { position: relative; height: 220px; }

/* Tables */
.wba-table-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.wba-table-header h3 { margin: 0; }
.wba-filter-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.wba-filter { padding: 5px 12px; border: 1px solid var(--wba-border); border-radius: 6px; background: transparent; cursor: pointer; font-size: 13px; color: var(--wba-muted); }
.wba-filter.active { background: var(--wba-brand); color: #fff; border-color: var(--wba-brand); }
.wba-table-responsive { overflow-x: auto; }
.wba-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wba-table th { text-align: left; padding: 10px 12px; background: var(--wba-bg); border-bottom: 1px solid var(--wba-border); font-weight: 600; color: var(--wba-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.wba-table td { padding: 10px 12px; border-bottom: 1px solid var(--wba-border); }
.wba-table tr:last-child td { border-bottom: none; }
.wba-table tr:hover td { background: var(--wba-bg); }
.wba-empty { text-align: center; color: var(--wba-muted); padding: 32px !important; }

/* Status badges */
.wba-status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.wba-status-click    { background: #f1f5f9; color: #475569; }
.wba-status-pending  { background: #fef3c7; color: #92400e; }
.wba-status-approved { background: #dcfce7; color: #166534; }
.wba-status-rejected { background: #fee2e2; color: #991b1b; }
.wba-status-paid     { background: #dbeafe; color: #1e40af; }

/* Payout form */
.wba-payout-form, .wba-form-row { }
.wba-form-row { margin-bottom: 14px; }
.wba-form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--wba-muted); }
.wba-form-row input,
.wba-form-row select,
.wba-form-row textarea { width: 100%; max-width: 400px; padding: 9px 12px; border: 1px solid var(--wba-border); border-radius: 8px; font-size: 14px; background: var(--wba-bg); }
.wba-form-row textarea { resize: vertical; }

/* Message */
.wba-message { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.wba-message.success { background: #dcfce7; color: #166534; }
.wba-message.error   { background: #fee2e2; color: #991b1b; }
.wba-info-note { background: #f1f5f9; padding: 12px; border-radius: 8px; font-size: 14px; color: var(--wba-muted); }

/* Levels list */
.wba-levels-list { display: flex; flex-direction: column; gap: 0; }
.wba-level-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--wba-border); }
.wba-level-row:last-child { border-bottom: none; }
.wba-level-row.wba-level-current { background: #faf5ff; margin: 0 -24px; padding: 12px 24px; border-radius: 8px; }
.wba-level-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.wba-level-info { flex: 1; }
.wba-level-info strong { display: block; font-size: 14px; }
.wba-level-info small { color: var(--wba-muted); font-size: 12px; }
.wba-level-rate { font-size: 16px; font-weight: 700; color: var(--wba-brand); }
.wba-current-tag { display: inline-block; margin-left: 8px; background: var(--wba-brand); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 4px; font-weight: 600; }

/* Apply form */
.wba-apply-wrap { max-width: 480px; margin: 0 auto; }
.wba-apply-card { background: var(--wba-card); border: 1px solid var(--wba-border); border-radius: var(--wba-radius); padding: 32px; text-align: center; box-shadow: var(--wba-shadow); }
.wba-apply-card h2 { margin-top: 0; }

/* Big link box */
.wba-link-desc { color: var(--wba-muted); font-size: 14px; margin: 0 0 16px; }
.wba-link-big-box { background: var(--wba-bg); border: 2px solid var(--wba-brand); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.wba-link-code-label { font-size: 13px; color: var(--wba-muted); margin-bottom: 10px; }
.wba-link-display-row { display: flex; gap: 8px; }
.wba-link-input-big { flex: 1; padding: 12px 14px; border: 1px solid var(--wba-border); border-radius: 8px; font-size: 13px; background: #fff; color: var(--wba-text); font-family: monospace; min-width: 0; font-weight: 600; }
.wba-btn-copy-big { padding: 12px 20px; font-size: 14px; white-space: nowrap; }

/* Share buttons */
.wba-share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wba-share-label { font-size: 13px; color: var(--wba-muted); font-weight: 600; }
.wba-share-btn { display: inline-block; padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; transition: opacity .2s; }
.wba-share-btn:hover { opacity: .85; text-decoration: none; }
.wba-share-wa { background: #25d366; color: #fff; }
.wba-share-tg { background: #0088cc; color: #fff; }
.wba-share-tw { background: #000; color: #fff; }
.wba-share-fb { background: #1877f2; color: #fff; }

@media (max-width: 600px) {
    .wba-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .wba-header-inner { flex-direction: column; align-items: flex-start; }
    .wba-balance-box { text-align: left; }
    .wba-tabs { gap: 2px; }
    .wba-tab { font-size: 12px; padding: 7px 8px; }
    .wba-link-row { flex-direction: column; }
}
