/* ReBack Modern UI Styles */

:root {
  --primary: #667eea;
  --primary-dark: #764ba2;
  --success: #56ab2f;
  --success-light: #a8e063;
  --danger: #eb3349;
  --danger-light: #f45c43;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --text-tertiary: #a0aec0;
  --bg-primary: #ffffff;
  --bg-secondary: #f7fafc;
  --bg-tertiary: #e2e8f0;
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 20px 20px; /* 顶部留白 80px for top bar */
  position: relative;
  overflow-x: hidden;
}

/* Top Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  pointer-events: auto;
}

.top-bar-left,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Wallet Badge (Connected State) */
.wallet-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.wallet-badge:hover {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.wallet-badge-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wallet-badge-address {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
}

.wallet-badge-balance {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wallet-badge-disconnect {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(235, 51, 73, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.wallet-badge-disconnect:hover {
  background: rgba(235, 51, 73, 1);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(235, 51, 73, 0.5);
}

/* Wallet Connect Button */
.wallet-connect-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.wallet-connect-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.3) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Referral Button */
.referral-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.referral-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.referral-btn:hover::before {
  left: 100%;
}

.referral-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.3) 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.6);
}

.referral-icon {
  font-size: 18px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Language Switcher */
.lang-switcher {
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.lang-switcher::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.lang-switcher:hover::before {
  left: 100%;
}

.lang-switcher:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.3) 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Container */
.container {
  max-width: 900px;
  width: 100%;
  z-index: 1;
  margin-top: 0; /* Top bar is fixed, no extra margin needed */
}

/* Card */
.card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 48px;
}

.logo {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

h1 {
  font-size: 40px;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 500;
}

/* Status Section */
.status-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.status-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.status-desc {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.6;
}

.status-section.connected {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
}

.status-section.scanning {
  background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
}

.wallet-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.wallet-address-short {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  backdrop-filter: blur(5px);
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-disconnect {
  padding: 10px 24px;
  background: linear-gradient(135deg, rgba(235, 51, 73, 0.9) 0%, rgba(244, 92, 67, 0.9) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(235, 51, 73, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-disconnect:hover {
  background: linear-gradient(135deg, rgba(235, 51, 73, 1) 0%, rgba(244, 92, 67, 1) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(235, 51, 73, 0.5);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 18px 32px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
  color: white;
  margin-top: 24px;
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(86, 171, 47, 0.4);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.stat-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 24px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-value.highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-value.success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Alerts */
.alert {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.8;
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.4s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-info {
  background: #e6f7ff;
  color: #0066cc;
  border-left: 4px solid #0066cc;
}

.alert-warning {
  background: #fff7e6;
  color: #d46b08;
  border-left: 4px solid #d46b08;
}

.alert-success {
  background: #f6ffed;
  color: #52c41a;
  border-left: 4px solid #52c41a;
}

.alert-danger {
  background: #fff1f0;
  color: #ff4d4f;
  border-left: 4px solid #ff4d4f;
}

/* Section Title */
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 16px;
}

/* Token List */
.token-list {
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
}

.token-list::-webkit-scrollbar {
  width: 8px;
}

.token-list::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.token-list::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 4px;
}

.token-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.token-item {
  background: white;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.token-item:last-child {
  margin-bottom: 0;
}

.token-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.token-address {
  font-family: 'Courier New', monospace;
  color: var(--text-secondary);
  font-weight: 500;
}

.token-rent {
  color: var(--success);
  font-weight: 700;
  font-size: 15px;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  overflow: hidden;
  margin: 24px 0 16px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
}

.progress-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.footer p {
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.8;
  margin: 4px 0;
}

/* Wallet Modal */
.wallet-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
  padding: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wallet-modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wallet-modal-content::-webkit-scrollbar {
  width: 8px;
}

.wallet-modal-content::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.wallet-modal-content::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 4px;
}

.wallet-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.wallet-modal-header h3 {
  font-size: 24px;
  color: var(--text-primary);
  font-weight: 700;
  margin: 0;
}

.wallet-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.wallet-modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
  transform: rotate(90deg);
}

/* Wallet Sections */
.wallet-section {
  margin-bottom: 24px;
}

.wallet-section:last-child {
  margin-bottom: 0;
}

.wallet-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wallet-section-title-clickable {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.wallet-section-title-clickable:hover {
  color: var(--primary);
}

.wallet-section-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.wallet-item.wallet-detected:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.wallet-item.wallet-not-detected {
  opacity: 0.6;
}

.wallet-item.wallet-not-detected:hover {
  background: linear-gradient(135deg, var(--text-tertiary) 0%, var(--text-secondary) 100%);
  color: white;
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wallet-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.wallet-name {
  flex: 1;
}

.wallet-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wallet-badge-success {
  background: rgba(86, 171, 47, 0.15);
  color: var(--success);
}

.wallet-badge-install {
  background: rgba(102, 126, 234, 0.15);
  color: var(--primary);
}

.wallet-item.wallet-detected:hover .wallet-badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.wallet-item.wallet-not-detected:hover .wallet-badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 90px 16px 16px 16px; /* 顶部留白 90px */
  }

  .top-bar {
    top: 20px;
    right: 20px;
  }

  .card {
    padding: 32px 24px;
  }
  
  .container {
    margin-top: 0; /* 移动端不需要额外 margin */
  }

  h1 {
    font-size: 32px;
  }

  .logo {
    font-size: 48px;
  }

  .subtitle {
    font-size: 16px;
  }

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

  .stat-card {
    padding: 20px;
  }

  .wallet-modal-content {
    padding: 24px;
    max-height: 90vh;
  }

  .wallet-item {
    padding: 14px 16px;
    font-size: 15px;
  }

  .wallet-icon {
    font-size: 24px;
  }

  .btn {
    padding: 16px 24px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 100px 16px 16px 16px; /* 小屏幕顶部留白 100px */
  }

  .card {
    padding: 24px 20px;
  }

  h1 {
    font-size: 28px;
  }

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

  .wallet-modal-header h3 {
    font-size: 20px;
  }
}

/* Referral Modal */
.referral-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.3s ease;
  padding: 20px;
}

.referral-modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.referral-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.referral-modal-header h3 {
  font-size: 24px;
  color: var(--text-primary);
  font-weight: 700;
  margin: 0;
}

.referral-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.referral-modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
  transform: rotate(90deg);
}

.referral-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.referral-alert {
  padding: 16px 20px;
  background: linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.referral-code-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.referral-code-section label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.referral-code-display {
  display: flex;
  gap: 12px;
  align-items: center;
}

.referral-code-display span {
  flex: 1;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  letter-spacing: 2px;
}

.btn-copy {
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-copy:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.referral-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.referral-stat-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
}

.referral-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.referral-stat-value {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.referral-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.referral-qr-image {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--text-tertiary) 0%, var(--text-secondary) 100%);
  color: white;
}

.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* Responsive for Top Bar */
@media (max-width: 768px) {
  .top-bar {
    top: 20px;
    right: 20px;
    gap: 10px;
  }

  .referral-btn,
  .lang-switcher {
    padding: 10px 18px;
    font-size: 13px;
  }

  .referral-icon {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-end;
  }

  .referral-modal-content {
    padding: 24px;
  }

  .referral-stats-grid {
    grid-template-columns: 1fr;
  }

  .referral-code-display {
    flex-direction: column;
  }

  .btn-copy {
    width: 100%;
  }
}

/* Earnings Modal */
.earnings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  animation: fadeIn 0.3s ease;
  padding: 20px;
}

.earnings-modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.earnings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.earnings-modal-header h3 {
  font-size: 24px;
  color: var(--text-primary);
  font-weight: 700;
  margin: 0;
}

.earnings-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.earnings-modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
  transform: rotate(90deg);
}

.earnings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.earning-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.earning-item:hover {
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.earning-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.earning-date {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.earning-from {
  font-size: 12px;
  color: var(--text-tertiary);
}

.earning-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}

.no-earnings {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* QR Container */
.qr-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.qr-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.referral-qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Tutorial Overlay */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  animation: fadeIn 0.4s ease;
  padding: 20px;
}

.tutorial-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: 48px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.tutorial-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: none;
  border-radius: 50%;
  font-size: 28px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: var(--transition);
}

.tutorial-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.tutorial-step {
  text-align: center;
}

.tutorial-icon {
  font-size: 80px;
  margin-bottom: 24px;
  animation: bounce 2s ease-in-out infinite;
}

.tutorial-step h2 {
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-weight: 700;
}

.tutorial-step p {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.tutorial-list {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.tutorial-list li {
  font-size: 16px;
  color: var(--text-primary);
  padding: 12px 20px;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--success);
}

.tutorial-steps-list {
  text-align: left;
  margin: 32px 0;
}

.tutorial-step-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.tutorial-step-item:hover {
  background: var(--bg-tertiary);
  transform: translateX(8px);
}

.step-number {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 18px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.tutorial-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.tutorial-actions .btn {
  flex: 1;
}

.tutorial-progress {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px solid var(--border-color);
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-color);
  transition: var(--transition);
}

.progress-dot.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  transform: scale(1.3);
}

/* Responsive Tutorial */
@media (max-width: 768px) {
  .tutorial-content {
    padding: 32px 24px;
  }

  .tutorial-icon {
    font-size: 60px;
  }

  .tutorial-step h2 {
    font-size: 24px;
  }

  .tutorial-step p {
    font-size: 16px;
  }

  .tutorial-actions {
    flex-direction: column;
  }
}

/* Print Styles */
@media print {
  .top-bar,
  .btn,
  .footer,
  .tutorial-overlay {
    display: none;
  }
}
