@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;600;800&display=swap');

/* ── REFERRAL MAIN CONTAINER ── */
.referral-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 5% 4rem;
}

/* ── REFERRAL PANEL (Premium & Modern) ── */
.referral-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem 0 2rem 0;
  font-family: 'Inter', 'Outfit', sans-serif;
  animation: fadeIn 0.4s ease-out;
}

/* Header with Gradient & Glassmorphism */
.referral-header {
  position: relative;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.08) 0%, rgba(255, 0, 128, 0.05) 100%);
  border: 1px solid rgba(255, 107, 0, 0.15);
  border-radius: var(--radius-lg, 16px);
  padding: 2.5rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

/* Subtle decorative glow */
.referral-header::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.referral-header h3 {
  position: relative;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: linear-gradient(90deg, #ff6b00, #ff0080);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: 1;
}

.referral-header p {
  position: relative;
  color: var(--text-muted, #666);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
  line-height: 1.6;
  z-index: 1;
}

.ref-highlight {
  color: #ff6b00;
  font-weight: 700;
  padding: 2px 6px;
  background: rgba(255, 107, 0, 0.1);
  border-radius: 6px;
}

/* Share Box */
.referral-share-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 1;
  margin-top: 1rem;
}

.share-card {
  background: var(--surface, #fff);
  border: 1px solid rgba(255, 107, 0, 0.15);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.25s ease;
  text-align: left;
}

[data-theme="dark"] .share-card {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.05);
}

.share-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 0, 0.35);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.06);
}

.share-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-card-icon {
  font-size: 1.2rem;
}

.share-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted, #777);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.share-card-body {
  width: 100%;
}

/* Code Display Wrapper - Coupon Style */
.code-display-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--background, #fff1ee);
  border: 2px dashed rgba(255, 107, 0, 0.3);
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  gap: 1rem;
}

[data-theme="dark"] .code-display-wrapper {
  background: rgba(255, 107, 0, 0.05);
}

.code-display {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 1.4rem;
  font-weight: 800;
  color: #ff6b00;
  letter-spacing: 3px;
}

/* Link Display Wrapper - Input Group Style */
.link-display-wrapper {
  display: flex;
  align-items: center;
  background: var(--background, #f9f9f9);
  border: 1px solid var(--border, #eee);
  border-radius: 12px;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

[data-theme="dark"] .link-display-wrapper {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.link-display-wrapper:focus-within {
  border-color: #ff6b00;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

.ref-link-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text-main, #333);
  font-weight: 600;
  outline: none;
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}

[data-theme="dark"] .ref-link-input {
  color: #fff;
}

/* Modern Copy Button */
.btn-copy-ref {
  background: linear-gradient(135deg, #ff6b00, #ff0080);
  color: #fff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.2);
  flex-shrink: 0;
}

.btn-copy-ref:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(255, 107, 0, 0.3);
  filter: brightness(1.05);
}

.btn-copy-ref:active {
  transform: translateY(1px);
}

/* Responsive adjustments for narrow viewports */
@media (max-width: 480px) {
  .code-display-wrapper {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.75rem;
  }

  .code-display {
    text-align: center;
    letter-spacing: 2px;
  }

  .link-display-wrapper {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .ref-link-input {
    text-align: center;
    padding: 0.25rem 0;
  }

  .btn-copy-ref {
    justify-content: center;
  }
}

/* Progress Bar */
.referral-progress {
  margin-top: 2rem;
  text-align: left;
  z-index: 1;
  position: relative;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main, #444);
  margin-bottom: 0.75rem;
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: var(--border, #eaeaea);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b00, #ff0080);
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
}

/* Stats Row */
.referral-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.stat-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #eee);
  border-radius: var(--radius-md, 12px);
  padding: 1.75rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #ff6b00, #ff0080);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(90deg, #ff6b00, #ff0080);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted, #777);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* List Section */
.referral-list-section {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #eee);
  border-radius: var(--radius-lg, 16px);
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.list-header {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main, #222);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed var(--border, #eee);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ref-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--background, #fafafa);
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border, #eee);
  transition: all 0.3s ease;
}

.ref-item:hover {
  background: var(--surface, #fff);
  border-color: #ff6b00;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.08);
  transform: scale(1.01);
}

.ref-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ref-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--border, #eee);
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ref-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main, #333);
  margin-bottom: 0.25rem;
}

.ref-date {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  font-weight: 500;
}

.ref-status-box {
  text-align: right;
}

.ref-status {
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.03);
}

.status-rewarded {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.status-pending {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.status-clawed {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.ref-earn {
  font-size: 1rem;
  font-weight: 800;
  margin-top: 0.5rem;
  color: var(--text-main);
}

.status-rewarded+.ref-earn {
  color: #10b981;
}

.status-clawed+.ref-earn {
  color: #ef4444;
}

/* Toast Notification Styles */
.custom-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #222;
  color: #fff;
  padding: 0.85rem 1.75rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Input Referral Code Box */
.referral-input-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 1.5rem;
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  margin-top: 1rem;
}

[data-theme="dark"] .referral-input-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ref-input-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ref-input-group {
  display: flex;
  gap: 0.5rem;
}

.ref-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Fira Code', monospace;
  outline: none;
  background: var(--surface, #fff);
  color: var(--text-main);
  transition: all 0.3s;
}

.ref-input:focus {
  border-color: #ff6b00;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.btn-submit-ref {
  background: linear-gradient(135deg, #ff6b00, #ff0080);
  color: #fff;
  border: none;
  padding: 0 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2);
}

.btn-submit-ref:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.3);
}

.btn-submit-ref:disabled {
  background: var(--border);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  color: #888;
}

@media (max-width: 768px) {
  .referral-stats-row {
    grid-template-columns: 1fr;
  }

  .ref-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .btn-ref-action {
    width: 100%;
    margin-top: 0.25rem;
    justify-content: center;
  }

  .ref-link-val {
    max-width: 100%;
  }

  .referral-header {
    padding: 2rem 1.25rem;
  }

  .stat-val {
    font-size: 1.5rem;
  }

  .ref-input-group {
    flex-direction: column;
  }

  .btn-submit-ref {
    padding: 0.75rem;
  }
}

/* ── REFERRAL STEPS (Neobrutalism UI) ── */
.referral-steps-section {
  position: relative;
  margin-bottom: 2rem;
  padding: 1.25rem 0;
}

.referral-steps-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Connecting line (Desktop) */
.referral-steps-flow::before {
  content: '';
  position: absolute;
  top: 48px; /* Aligned with icon center */
  left: 15%;
  right: 15%;
  height: 2px;
  background: #000000;
  z-index: 1;
}

.ref-step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Neobrutalist Badge */
.ref-step-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 28px;
  height: 28px;
  background: #ffffff;
  border: var(--border-thin);
  box-shadow: 1.5px 1.5px 0 #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.ref-step-badge.badge-orange {
  color: var(--orange);
}
.ref-step-badge.badge-blue {
  color: #3182ce;
}
.ref-step-badge.badge-green {
  color: #38a169;
}

/* Neobrutalist Step Card */
.ref-step-card {
  background: #ffffff;
  border: var(--border-thin);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  padding: 1.5rem 0.75rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ref-step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Icon Wrapper */
.ref-step-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: var(--border-thin);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  z-index: 2;
}

.bg-orange-light {
  background: #fff1ee;
}
.bg-blue-light {
  background: #ebf8ff;
}
.bg-green-light {
  background: #f0fff4;
}

.ref-step-icon {
  width: 24px;
  height: 24px;
}

.text-orange {
  color: var(--orange);
}
.text-blue {
  color: #3182ce;
}
.text-green {
  color: #38a169;
}

.ref-step-card h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: #000000;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.ref-step-card p {
  font-size: 0.75rem;
  color: #444444;
  line-height: 1.4;
  font-weight: 600;
  margin: 0;
}

/* Responsive Styles */
@media (max-width: 520px) {
  .referral-steps-flow {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .referral-steps-flow::before {
    display: none;
  }
  .ref-step-badge {
    left: 20px;
    transform: none;
  }
  .ref-step-card {
    padding: 1.5rem 1rem 1.25rem 3.75rem;
    text-align: left;
    align-items: flex-start;
  }
  .ref-step-icon-wrapper {
    margin-bottom: 0.75rem;
  }
  .ref-step-card h3 {
    font-size: 1rem;
  }
  .ref-step-card p {
    font-size: 0.8rem;
  }
}