:root {
  --primary: #7c4dff;
  --primary-light: #9a76ff;
  --primary-dark: #5a2fd9;
  --secondary: #00e5ff;
  --dark: #121212;
  --darker: #0a0a0a;
  --light: #f5f5f7;
  --lighter: #ffffff;
  --gray: #2a2a2e;
  --success: #00c853;
  --danger: #ff3d00;
  --warning: #ffab00;
  --gold: #ffd700;
  --gold-light: #ffec80;
  --gold-dark: #e6c200;
  --card-bg: linear-gradient(135deg, rgba(124, 77, 255, 0.15), rgba(0, 229, 255, 0.15));
  --card-border: 1px solid rgba(124, 77, 255, 0.3);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--darker);
  color: var(--light);
  min-height: 100vh;
  line-height: 1.6;
}

/* Background Gradient */
.background-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, var(--dark) 0%, var(--darker) 90%);
  z-index: -2;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header h1 {
  font-size: 2.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

header h1 i {
  margin-right: 0.75rem;
}

.subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.15rem;
  font-weight: 300;
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: var(--card-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(124, 77, 255, 0.15);
}

.card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: shine 4s infinite linear;
  opacity: 0;
}

.card:hover::before {
  opacity: 0.3;
}

@keyframes shine {
  0% { transform: rotate(0deg); opacity: 0; }
  20% { opacity: 0.3; }
  100% { transform: rotate(360deg); opacity: 0; }
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.75rem;
  color: var(--lighter);
  display: flex;
  align-items: center;
  font-weight: 600;
}

.card h2 i {
  margin-right: 1rem;
  color: var(--primary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.stat-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(124, 77, 255, 0.05);
  border-color: rgba(124, 77, 255, 0.2);
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--lighter);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-unit {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Forms */
.form-group {
  margin-bottom: 1.75rem;
  background: rgba(30, 30, 35, 0.6);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 1.5rem;
  border: var(--card-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--lighter);
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.2);
  background: rgba(124, 77, 255, 0.05);
}

.input-group {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
  width: 100%;
  padding: 1.1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--lighter);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Referral Section */
.referral-stats {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  border: var(--card-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.referral-stats::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: shine 4s infinite linear;
  opacity: 0;
}

.referral-stats:hover::before {
  opacity: 0.3;
}

.referral-list-container {
  margin-bottom: 2rem;
}

.referral-grid {
  display: grid;
  grid-template-columns: minmax(50px, auto) minmax(150px, 1fr) minmax(100px, auto);
  gap: 1px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.referral-header {
  padding: 1rem;
  background: rgba(124, 77, 255, 0.2);
  color: white;
  font-weight: 600;
  text-align: center;
}

.referral-item {
  padding: 1rem;
  background: rgba(30, 30, 35, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.referral-item:nth-child(3n+1) {
  justify-content: center;
  font-weight: 500;
  color: var(--secondary);
}

.referral-item:nth-child(3n+2) {
  font-family: 'Roboto Mono', monospace;
}

.referral-item:nth-child(3n+3) i {
  color: var(--success);
  font-size: 0.9rem;
}

.referral-link-container {
  margin-top: 1.5rem;
}

.referral-link-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.referral-link-group input {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(124, 77, 255, 0.3);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px 0 0 8px;
  font-family: 'Roboto Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.referral-link-group button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1.5rem;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.referral-link-group button:hover {
  background: var(--primary-dark);
}

.referral-link-group button:active {
  transform: scale(0.98);
}

.referral-link-group button.copied {
  background: var(--success);
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.no-referrals {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

.referral-row {
  display: contents;
}

.locked-referrer {
  background-color: #f0f0f0;
  cursor: not-allowed;
}

/* Welcome Bonus Card */
#welcome-bonus {
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.15), rgba(0, 229, 255, 0.15));
  border: 1px solid rgba(124, 77, 255, 0.3);
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#welcome-bonus:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(124, 77, 255, 0.15);
}

#welcome-bonus::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: shine 4s infinite linear;
  opacity: 0;
}

.bonus-info {
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.bonus-info p {
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.6;
}

.bonus-amount-container {
  position: relative;
  margin: 2rem auto;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bonus-amount-star {
  position: absolute;
  width: 100%;
  height: 100%;
  color: var(--gold);
  font-size: 180px;
  filter: 
    drop-shadow(0 0 10px rgba(255, 215, 0, 0.7))
    drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
  animation: 
    pulse 2s infinite ease-in-out,
    glow 2s infinite alternate;
  z-index: 0;
}

.bonus-amount {
  position: relative;
  z-index: 1;
  font-size: 3.5rem;
  font-weight: 800;
  color: rgb(232, 36, 212);
  text-shadow: 
    0 0 10px rgba(228, 38, 219, 0.8),
    0 0 20px rgba(205, 28, 193, 0.4);
  background: linear-gradient(135deg, var(), var());
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: -0.5rem;
  letter-spacing: 2px;
  font-family: 'Roboto Mono', monospace;
}

.bonus-stats {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 2rem 0;
}

.bonus-stats .stat-item {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(124, 77, 255, 0.3);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.bonus-stats .stat-item:hover {
  background: rgba(124, 77, 255, 0.05);
  border-color: rgba(124, 77, 255, 0.2);
}

.bonus-stats .stat-label {
  font-size: 1rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.bonus-stats .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 10px rgba(124, 77, 255, 0.7);
}

#bonusStatus {
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#bonusUnlockDate {
  color: var(--secondary);
  font-family: 'Roboto Mono', monospace;
}

#claimBonusBtn {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #000;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1.25rem;
  border: none;
  border-radius: 12px;
  box-shadow: 
    0 4px 15px rgba(255, 215, 0, 0.3),
    0 0 10px rgba(255, 215, 0, 0.2) inset;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  width: 80%;
  margin: 0 auto;
  display: block;
  z-index: 1;
}

#claimBonusBtn::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  transform: rotate(30deg);
  animation: shineBtn 3s infinite;
  z-index: -1;
}

#claimBonusBtn:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 6px 20px rgba(255, 215, 0, 0.5),
    0 0 10px rgba(255, 215, 0, 0.3) inset;
}

#claimBonusBtn:disabled {
  background: linear-gradient(135deg, #666, #888);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
  color: rgba(0, 0, 0, 0.5);
}

#claimBonusBtn:disabled::before {
  display: none;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: none;
}

.toast.error {
  background: var(--danger);
}

/* Spinner icon appearance */
#referralAddress i.fa-spinner {
  font-size: 16px;
  color: var(--gold);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }
  
  header h1 {
    font-size: 2.2rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .bonus-amount-container {
    width: 150px;
    height: 150px;
  }
  
  .bonus-amount-star {
    font-size: 150px;
  }
  
  .bonus-amount {
    font-size: 3rem;
  }
  
  .bonus-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  #claimBonusBtn {
    width: 100%;
  }
  
  .referral-stats {
    padding: 1.5rem;
  }
  
  .form-group {
    padding: 1.25rem;
  }
  
  .action-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  .btn-primary, .btn-secondary {
    padding: 1rem;
  }
  
  .bonus-amount-container {
    width: 120px;
    height: 120px;
  }
  
  .bonus-amount-star {
    font-size: 120px;
  }
  
  .bonus-amount {
    font-size: 2.5rem;
  }
  
  .form-group {
    padding: 1rem;
  }
  
  input[type="number"], 
  input[type="text"] {
    padding: 0.85rem 1rem;
  }
}

/* Copy CSS */

/* Style Copy */
#copyReferralBtn {
  cursor: pointer;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1.5rem;
  border-radius: 0 8px 8px 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 100px;
}

#copyReferralBtn:hover {
  background: var(--primary-dark);
}

#copyReferralBtn:active {
  transform: scale(0.98);
}

#copyReferralBtn.copied {
  background: var(--success);
  animation: pulse 0.5s ease;
}

/**/
.referral-link-group {
  position: relative;
  display: flex;
  align-items: stretch;
}

.referral-link-input {
  flex-grow: 1;
  padding-right: 40px;
  min-height: 48px;
}

/* Feedback */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}