/* css/affiliate.css — Affiliate Program Styles (Enhanced UX) */

.affiliate-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ── Animations ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.anim-slide-up { animation: slideUp 0.5s ease-out both; }
.anim-fade-in  { animation: fadeIn 0.4s ease-out both; }

/* ── Header ── */
.affiliate-header { text-align: center; margin-bottom: 32px; }
.affiliate-back-link { display: inline-block; color: #888; text-decoration: none; font-size: 0.9rem; margin-bottom: 16px; transition: color 0.2s; }
.affiliate-back-link:hover { color: #00d4ff; }
.affiliate-title { font-size: 1.8rem; font-weight: 700; color: #fff; margin: 0 0 8px; }
.affiliate-title i { color: #00d4ff; }
.affiliate-subtitle { color: #999; font-size: 1rem; margin: 0; }

/* ── Loading ── */
.affiliate-loading { text-align: center; padding: 80px 20px; color: #888; }
.loading-spinner {
  width: 40px; height: 40px; margin: 0 auto 16px;
  border: 3px solid #333; border-top-color: #00d4ff;
  border-radius: 50%; animation: fa-spin 0.8s linear infinite;
}

/* ── Hero / Earnings Preview ── */
.affiliate-hero {
  position: relative;
  background: linear-gradient(135deg, #0a1628 0%, #1a1a3e 50%, #0d1f3c 100%);
  border-radius: 16px;
  padding: 40px 28px;
  margin-bottom: 20px;
  text-align: center;
  overflow: hidden;
  border: 1px solid #1a3050;
}
.hero-glow {
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.08) 0%, transparent 60%);
  animation: glow 4s ease-in-out infinite;
  pointer-events: none;
}
.hero-headline { font-size: 1.6rem; font-weight: 700; color: #fff; margin: 0 0 8px; position: relative; }
.hero-sub { color: #99b; font-size: 1rem; margin: 0 0 28px; position: relative; }

.hero-earnings-preview { position: relative; }
.earnings-calc {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 20px;
  display: inline-block;
  min-width: 280px;
}
.calc-label { color: #99b; font-size: 0.9rem; margin-bottom: 10px; }
.calc-label strong { color: #00d4ff; font-size: 1.1rem; }
.calc-slider {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px; background: #333;
  outline: none; margin: 12px 0;
}
.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px;
  border-radius: 50%; background: #00d4ff; cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}
.calc-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #00d4ff; cursor: pointer; border: none;
}
.calc-result { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.calc-amount {
  font-size: 2.2rem; font-weight: 800; color: #4ade80;
  background: linear-gradient(90deg, #4ade80, #00d4ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.calc-period { color: #888; font-size: 0.85rem; }

/* ── Cards ── */
.affiliate-card {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid #2a2a4a;
  transition: border-color 0.2s;
}
.affiliate-card:hover { border-color: #3a3a6a; }
.affiliate-card h2 { font-size: 1.3rem; color: #fff; margin: 0 0 16px; }
.affiliate-card h2 i { color: #00d4ff; margin-right: 6px; }
.affiliate-card h3 { font-size: 1.1rem; color: #fff; margin: 0 0 12px; }
.affiliate-card h3 i { color: #00d4ff; margin-right: 6px; }

/* ── How-It-Works Steps ── */
.affiliate-how-card { padding: 24px 20px; }
.affiliate-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.affiliate-step {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 200px;
  padding: 12px; border-radius: 10px;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid #2a2a4a;
}
.step-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #00d4ff22, #0080ff22);
  display: flex; align-items: center; justify-content: center;
  color: #00d4ff; font-size: 1.1rem; flex-shrink: 0;
}
.step-content strong { color: #fff; display: block; font-size: 0.9rem; }
.step-content p { color: #888; font-size: 0.8rem; margin: 2px 0 0; }
.step-arrow { color: #444; font-size: 0.8rem; }

/* ── Benefits Grid ── */
.affiliate-benefits {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 16px;
}
.benefit {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: 10px;
  background: #1a1a2e; border: 1px solid #2a2a4a;
}
.benefit i { font-size: 1.3rem; color: #00d4ff; width: 24px; text-align: center; flex-shrink: 0; }
.benefit strong { color: #fff; }
.benefit div { font-size: 0.85rem; color: #bbb; line-height: 1.4; }

/* ── Forms ── */
.affiliate-form .form-group { margin-bottom: 14px; }
.affiliate-form label { display: block; font-size: 0.85rem; color: #aaa; margin-bottom: 4px; font-weight: 500; }
.affiliate-form label i { margin-right: 4px; color: #00d4ff; }
.affiliate-form input,
.affiliate-form textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid #333; border-radius: 8px;
  background: #12122a; color: #e0e0e0;
  font-size: 0.95rem; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.affiliate-form input:focus,
.affiliate-form textarea:focus {
  outline: none; border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}
.affiliate-form small { display: block; color: #666; font-size: 0.8rem; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: #f87171; font-size: 0.85rem; margin-bottom: 12px; }
.form-msg { font-size: 0.85rem; margin-bottom: 12px; padding: 8px 12px; border-radius: 6px; }
.form-msg-success { color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.form-msg-error { color: #f87171; background: rgba(248, 113, 113, 0.1); }

/* Coupon preview */
.coupon-preview-row { display: flex; gap: 12px; align-items: stretch; }
.coupon-preview-row input { flex: 1; }
.coupon-live-preview {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 8px;
  background: linear-gradient(135deg, #00d4ff11, #0080ff11);
  border: 1px dashed #00d4ff44; min-width: 100px;
}
.preview-label { font-size: 0.65rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.preview-code { font-size: 1rem; font-weight: 700; color: #00d4ff; font-family: monospace; }
.coupon-availability { margin-top: 4px; font-size: 0.8rem; }
.avail-free { color: #4ade80; }
.avail-taken { color: #f87171; }

/* ── Buttons ── */
.affiliate-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px;
  font-size: 1rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.affiliate-btn-lg { padding: 14px 32px; font-size: 1.05rem; width: 100%; justify-content: center; }
.affiliate-btn-primary {
  background: linear-gradient(135deg, #00d4ff, #0080ff);
  color: #fff;
}
.affiliate-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3); }
.affiliate-btn-primary:active { transform: translateY(0); }
.affiliate-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.affiliate-btn-secondary { background: #2a2a4a; color: #e0e0e0; }
.affiliate-btn-secondary:hover { background: #3a3a5a; }

/* ── Status Cards ── */
.affiliate-status-card { text-align: center; padding: 48px 24px; }
.status-icon { font-size: 3rem; margin-bottom: 16px; }
.status-pending i { color: #fbbf24; }
.status-rejected i { color: #f87171; }
.status-code { margin-top: 12px; color: #888; }
.status-code strong { color: #00d4ff; font-size: 1.2rem; }
.pending-tips {
  margin-top: 24px; text-align: left;
  background: #12122a; border-radius: 10px; padding: 16px 20px;
  display: inline-block;
}
.pending-tips h4 { color: #aaa; font-size: 0.9rem; margin: 0 0 8px; }
.pending-tips ul { list-style: none; padding: 0; margin: 0; }
.pending-tips li { color: #888; font-size: 0.85rem; padding: 4px 0; }
.pending-tips li i { color: #4ade80; margin-right: 6px; }

/* ── Dashboard Welcome ── */
.dash-welcome {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #0a1628, #1a1a3e);
  border-radius: 14px; padding: 24px 28px;
  margin-bottom: 16px; border: 1px solid #1a3050;
  flex-wrap: wrap; gap: 16px;
}
.dash-welcome-text h2 { font-size: 1.3rem; color: #fff; margin: 0 0 4px; }
.dash-welcome-text h2 span { color: #00d4ff; }
.dash-welcome-text p { color: #888; margin: 0; font-size: 0.9rem; }
.dash-welcome-code { display: flex; align-items: center; gap: 10px; }
.code-badge {
  background: linear-gradient(135deg, #00d4ff22, #0080ff22);
  border: 1px solid #00d4ff44;
  color: #00d4ff; font-weight: 700; font-size: 1.2rem;
  padding: 8px 20px; border-radius: 8px; font-family: monospace;
  letter-spacing: 1px;
}
.copy-code-pill, .copy-link-pill {
  background: #2a2a4a; color: #e0e0e0;
  border: none; border-radius: 8px;
  padding: 10px 16px; cursor: pointer;
  font-size: 0.85rem; font-weight: 500;
  transition: all 0.2s; white-space: nowrap; font-family: inherit;
}
.copy-code-pill:hover, .copy-link-pill:hover { background: #3a3a5a; }

/* ── Stats Grid ── */
.affiliate-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: #1a1a2e; border-radius: 10px;
  padding: 16px; text-align: center;
  border: 1px solid #2a2a4a; position: relative;
  transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover { transform: translateY(-2px); border-color: #3a3a6a; }
.stat-card-highlight { border-color: #00d4ff33; background: linear-gradient(180deg, #1a1a2e, #0d1a30); }
.stat-card-accent { border-color: #4ade8033; background: linear-gradient(180deg, #1a1a2e, #0d2a1a); }

.stat-icon { font-size: 1.2rem; color: #555; margin-bottom: 6px; }
.stat-card-highlight .stat-icon { color: #00d4ff; }
.stat-card-accent .stat-icon { color: #4ade80; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
.stat-label { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Share Card ── */
.affiliate-share-card p { color: #bbb; margin-bottom: 12px; }
.share-link-box { display: flex; gap: 8px; margin-bottom: 16px; }
.share-link-box input {
  flex: 1; padding: 10px 12px;
  border: 1px solid #333; border-radius: 8px;
  background: #12122a; color: #00d4ff;
  font-size: 0.85rem; font-family: monospace;
}

/* Social Buttons */
.social-share-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.social-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: none; border-radius: 8px;
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s; font-family: inherit; color: #fff;
}
.social-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.social-facebook  { background: #1877f2; }
.social-twitter   { background: #1a1a2e; border: 1px solid #444; }
.social-email     { background: #6366f1; }
.social-whatsapp  { background: #25d366; color: #fff; }

/* Share text box */
.share-text-box { position: relative; }
.share-text-box label { display: block; font-size: 0.8rem; color: #666; margin-bottom: 4px; }
.share-text-box textarea {
  width: 100%; padding: 10px 40px 10px 12px;
  border: 1px solid #333; border-radius: 8px;
  background: #12122a; color: #bbb;
  font-size: 0.85rem; font-family: inherit;
  resize: none; box-sizing: border-box;
}
.copy-text-btn {
  position: absolute; top: 28px; right: 8px;
  background: none; border: none; color: #666;
  cursor: pointer; padding: 6px; font-size: 0.9rem;
}
.copy-text-btn:hover { color: #00d4ff; }

/* ── Conversions & Payouts ── */
.conversion-row, .payout-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #1a1a2e22;
  font-size: 0.9rem;
}
.conversion-row:last-child, .payout-row:last-child { border-bottom: none; }
.conv-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(0, 212, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  color: #00d4ff; flex-shrink: 0;
}
.payout-icon { background: rgba(74, 222, 128, 0.1); color: #4ade80; }
.conv-info { flex: 1; }
.conv-label { display: block; color: #ddd; font-size: 0.85rem; }
.conv-date { display: block; color: #666; font-size: 0.75rem; }
.conv-amount { color: #4ade80; font-weight: 700; font-size: 0.95rem; white-space: nowrap; }

.empty-state { text-align: center; padding: 24px 0; color: #555; }
.empty-state i { font-size: 1.5rem; margin-bottom: 8px; display: block; }
.empty-state p { margin: 0; font-style: italic; font-size: 0.9rem; }

/* ── Settings (collapsible) ── */
.affiliate-settings-card summary {
  cursor: pointer; color: #aaa; font-size: 0.95rem; font-weight: 500;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.affiliate-settings-card summary::-webkit-details-marker { display: none; }
.affiliate-settings-card summary i { color: #666; }
.affiliate-settings-card[open] summary { color: #fff; margin-bottom: 4px; }

/* ── Coupon Input on Pricing Page ── */
.coupon-input-section {
  margin-top: 20px; padding: 20px 24px;
  background: linear-gradient(135deg, #0a1628, #12122a);
  border-radius: 12px; border: 1px solid #1a3050;
  position: relative; overflow: hidden;
}
.coupon-input-section::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
  opacity: 0.5;
}
.coupon-input-section h4 { font-size: 0.95rem; color: #ccc; margin: 0 0 10px; }
.coupon-input-section h4 i { color: #00d4ff; margin-right: 4px; }
.coupon-input-row { display: flex; gap: 8px; }
.coupon-input-row input {
  flex: 1; padding: 12px 14px;
  border: 1px solid #333; border-radius: 8px;
  background: #1a1a2e; color: #e0e0e0;
  font-size: 0.95rem; text-transform: uppercase;
  font-family: inherit; letter-spacing: 1px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.coupon-input-row input:focus { outline: none; border-color: #00d4ff; box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1); }
.coupon-input-row button {
  padding: 12px 20px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #00d4ff, #0080ff);
  color: #fff; cursor: pointer; font-size: 0.9rem;
  font-weight: 600; white-space: nowrap; font-family: inherit;
  transition: all 0.2s;
}
.coupon-input-row button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3); }
.coupon-status { margin-top: 10px; font-size: 0.9rem; }
.coupon-valid { color: #4ade80; }
.coupon-invalid { color: #f87171; }

/* Price preview when coupon applied */
.coupon-price-preview {
  margin-top: 12px; padding: 12px 16px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 8px; display: none;
}
.coupon-price-preview.active { display: flex; align-items: center; gap: 12px; }
.price-original { color: #888; text-decoration: line-through; font-size: 0.9rem; }
.price-arrow { color: #4ade80; }
.price-new { color: #4ade80; font-weight: 700; font-size: 1.1rem; }
.price-savings { color: #888; font-size: 0.8rem; margin-left: auto; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .affiliate-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .affiliate-steps { flex-direction: column; }
  .step-arrow { display: none; }
  .share-link-box { flex-direction: column; }
  .stat-value { font-size: 1.2rem; }
  .affiliate-benefits { grid-template-columns: 1fr; }
  .dash-welcome { flex-direction: column; text-align: center; }
  .coupon-preview-row { flex-direction: column; }
  .social-share-buttons { justify-content: center; }
  .hero-headline { font-size: 1.3rem; }
  .calc-amount { font-size: 1.8rem; }
}
