/* AffiliatePage Styles — Inter font, mobile-first */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

.affiliate-page {
  min-height: calc(100vh - 72px);
  width: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(15,23,42,0.9) 0%, #070a12 100%);
  color: #f8fafc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 16px 12px 80px;
  box-sizing: border-box;
}

/* Loading & Not Auth */
.loading-container, .not-authenticated-container {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(34,197,94,0.2);
  border-top-color: #22c55e;
  border-radius: 50%;
  animation: affSpin 0.8s linear infinite;
  margin-bottom: 14px;
}

@keyframes affSpin {
  to { transform: rotate(360deg); }
}

.not-authenticated-card {
  background: rgba(15,20,32,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 28px 20px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}

.not-authenticated-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 14px 0 8px;
  color: #fff;
}

.not-authenticated-card p {
  font-size: 13.5px;
  color: #94a3b8;
  margin-bottom: 20px;
  line-height: 1.5;
}

.login-btn {
  background: #22c55e;
  color: #052e16;
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 14px;
  padding: 13px 24px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ── Header ── */
.affiliate-header {
  max-width: 860px;
  margin: 0 auto 16px;
  background: rgba(15,20,32,0.88);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 30px rgba(34,197,94,0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.affiliate-gif {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid #22c55e;
  box-shadow: 0 0 16px rgba(34,197,94,0.3);
  flex-shrink: 0;
}

.header-text h1 {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.header-text p {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

/* ── Main Layout ── */
.affiliate-page .main-content {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  background: rgba(15,20,32,0.88);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.balance-card {
  border-color: rgba(34,197,94,0.3);
  background: linear-gradient(135deg, rgba(15,20,32,0.95) 0%, rgba(34,197,94,0.07) 100%);
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-content h3 {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 600;
  margin: 0 0 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

/* ── Sidebar & Info Cards ── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-card {
  background: rgba(15,20,32,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.info-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #22c55e;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.info-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-card li {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.45;
  position: relative;
  padding-left: 18px;
}

.info-card li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #22c55e;
  font-weight: 900;
  font-size: 11px;
}

.quick-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.quick-stat:last-child { border-bottom: none; }

.quick-stat .label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #94a3b8;
}

.quick-stat .value {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

/* ── Affiliate Section ── */
.affiliate-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Earnings & Links Cards ── */
.earnings-card, .links-section, .indications-section, .application-card {
  background: rgba(15,20,32,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.earnings-card h3, .links-section h3, .indications-section h3, .application-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 14px;
  letter-spacing: -0.2px;
}

.earnings-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #cbd5e1;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.detail-row.total {
  border-bottom: none;
  border-top: 1.5px solid rgba(34,197,94,0.3);
  padding-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.detail-row.total .value {
  color: #22c55e;
  font-size: 16px;
  font-weight: 800;
}

/* ── Links ── */
.links-description {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #94a3b8;
  margin: -6px 0 14px;
  line-height: 1.5;
}

.link-card {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-info h4 {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: #22c55e;
  margin: 0 0 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.link-url {
  background: #080c14;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  padding: 10px 12px;
  font-family: 'Inter', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #38bdf8;
  word-break: break-all;
  user-select: all;
  overflow-x: auto;
  max-width: 100%;
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-btn, .copy-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.preview-btn:hover:not(:disabled), .copy-btn:hover:not(:disabled) {
  background: #22c55e;
  color: #052e16;
  border-color: #22c55e;
}

.preview-btn:disabled, .copy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Application Card ── */
.application-card {
  padding: 24px 16px;
}

.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 22px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: #e2e8f0;
  font-weight: 600;
  background: rgba(255,255,255,0.03);
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}

.benefit-item::before {
  content: "⭐";
  font-size: 15px;
  flex-shrink: 0;
}

.apply-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #052e16 !important;
  border: none;
  border-radius: 12px;
  padding: 15px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 8px 22px -4px rgba(34,197,94,0.5);
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.apply-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(34,197,94,0.6);
}

.apply-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Table ── */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.indications-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  min-width: 420px;
}

.indications-table th {
  text-align: left;
  padding: 10px 12px;
  color: #64748b;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1.5px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}

.indications-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #cbd5e1;
}

.deposit-amount {
  color: #22c55e;
  font-weight: 700;
}

/* ── Earnings Section ── */
.earnings-section { width: 100%; }

/* ── Status cards (pending/rejected) ── */
.status-card {
  background: rgba(15,20,32,0.85);
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}

.status-card.pending { border-color: rgba(234,179,8,0.3); }
.status-card.rejected { border-color: rgba(239,68,68,0.3); }

.status-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin: 14px 0 8px;
}

.status-card p {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: #94a3b8;
  margin-bottom: 8px;
  line-height: 1.5;
}

.status-icon { margin-bottom: 4px; }

/* ── Already affiliate ── */
.already-affiliate-section { display: none; }

.already-affiliate-card {
  background: rgba(15,20,32,0.85);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
}

.already-affiliate-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #22c55e;
  margin: 12px 0 8px;
}

.affiliate-info { margin-top: 18px; text-align: left; }

.affiliate-info h4 {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.example-link {
  background: #080c14;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.example-link code {
  font-family: 'Inter', monospace;
  font-size: 12.5px;
  color: #38bdf8;
  word-break: break-all;
  flex: 1;
}

.copy-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.link-note {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
}

.next-steps {
  margin-top: 18px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
}

.next-steps h4 {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.next-steps ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.next-steps li {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #cbd5e1;
  padding-left: 18px;
  position: relative;
  line-height: 1.4;
}

.next-steps li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #22c55e;
  font-weight: 700;
}

/* ══════════════════════════════════
   RESPONSIVE — MOBILE FIRST
══════════════════════════════════ */

/* Tablets and small desktops */
@media (max-width: 860px) {
  .affiliate-page .main-content {
    grid-template-columns: 1fr;
  }

  .header-content {
    flex-direction: row;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Sidebar goes after main content on mobile */
  .sidebar {
    order: 2;
  }

  .affiliate-section {
    order: 1;
  }
}

/* Mobile phones */
@media (max-width: 600px) {
  .affiliate-page {
    padding: 12px 10px 80px;
  }

  .affiliate-header {
    margin-bottom: 12px;
    padding: 14px 12px;
    border-radius: 16px;
  }

  .affiliate-gif {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .header-text h1 {
    font-size: 15px;
  }

  .header-text p {
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* 3rd stat card goes full width */
  .stats-grid > .stat-card:last-child {
    grid-column: 1 / -1;
  }

  .stat-card {
    padding: 12px 10px;
    gap: 10px;
    border-radius: 12px;
  }

  .stat-value {
    font-size: 15px;
  }

  .stat-content h3 {
    font-size: 9.5px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .earnings-card, .links-section, .indications-section, .application-card {
    padding: 14px 12px;
    border-radius: 14px;
  }

  .earnings-card h3, .links-section h3,
  .indications-section h3, .application-card h3 {
    font-size: 14px;
  }

  .info-card {
    padding: 14px 12px;
    border-radius: 14px;
  }

  .link-url {
    font-size: 11.5px;
    padding: 9px 10px;
  }

  .link-actions {
    flex-direction: row;
  }

  .preview-btn, .copy-btn {
    font-size: 12px;
    padding: 8px 12px;
  }

  .apply-btn {
    font-size: 14px;
    padding: 14px 20px;
  }

  .benefit-item {
    font-size: 12.5px;
    padding: 10px 12px;
  }

  .affiliate-page .main-content {
    gap: 12px;
  }

  .affiliate-section {
    gap: 12px;
  }

  .sidebar {
    gap: 12px;
  }

  .detail-row {
    font-size: 12px;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid > .stat-card:last-child {
    grid-column: auto;
  }

  .header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .affiliate-gif {
    margin: 0 auto;
  }
}

/* No links message */
.no-links-message {
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: #64748b;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

/* Link pending warning */
.link-pending {
  color: #fbbf24 !important;
  font-style: italic;
}

.link-warning {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  color: #fbbf24;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
