/* Telegram WebApp CSS Variables */
:root {
  /* Monochrome theme (black & white with grayscale only) */
  --tg-theme-bg-color: #0b0b0b;
  --tg-theme-text-color: #ffffff;
  --tg-theme-hint-color: #9a9a9a;
  --tg-theme-link-color: #ffffff; /* keep links white; distinguish via underline */
  --tg-theme-button-color: #ffffff; /* primary buttons become white */
  --tg-theme-button-text-color: #000000; /* black text on white buttons */
  --tg-theme-secondary-bg-color: #141414; /* panels */
  --tg-theme-header-bg-color: #0e0e0e;
  --tg-theme-accent-text-color: #e5e5e5; /* subtle accent as lighter gray */
  --tg-theme-section-bg-color: #141414;
  --tg-theme-section-header-text-color: #b5b5b5;
  --tg-theme-destructive-text-color: #000000; /* danger uses black (no color) */
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  line-height: 1.4;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* Accessible link styling in monochrome: white text with underline */
a {
  color: var(--tg-theme-link-color);
  text-decoration: underline;
}

#app {
  min-height: 100vh;
  position: relative;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background-color: var(--tg-theme-header-bg-color);
  padding: 12px 16px;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* App brand icon */
.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #444444 0%, #666666 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  color: white;
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
}

.share-btn, .settings-btn {
  width: 40px;
  height: 40px;
  border: none;
  background-color: var(--tg-theme-secondary-bg-color);
  border-radius: 8px;
  color: var(--tg-theme-text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.share-btn:hover, .settings-btn:hover {
  opacity: 0.8;
}

.balance {
  background-color: var(--tg-theme-secondary-bg-color);
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Main Content */
.main-content {
  padding: 0 16px;
}

/* Page Navigation */
.page {
  display: none;
  padding: 20px 0;
  animation: fadeIn 0.4s ease-out;
}

.page.active {
  display: block;
}

/* Enhanced Page Headers */
.page-header h2 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Balance Section */
.balance-section {
  text-align: center;
  padding: 40px 0;
  position: relative;
}

.balance-amount {
  font-size: 48px;
  font-weight: 300;
  margin-bottom: 8px;
  color: var(--tg-theme-text-color);
}

.balance-label {
  color: var(--tg-theme-hint-color);
  font-size: 16px;
  margin-bottom: 20px;
}

.refresh-btn {
  position: absolute;
  right: 0;
  top: 20px;
  background: none;
  border: none;
  color: var(--tg-theme-text-color);
  font-size: 24px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.refresh-btn:hover {
  transform: rotate(180deg);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
}

.btn {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
}

.btn-primary {
  background: linear-gradient(135deg, #ffffff, #f0f0f0);
  color: #000000;
  border: none;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  background-color: var(--tg-theme-secondary-bg-color);
  color: var(--tg-theme-text-color);
}

.btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-danger {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: #ffffff;
  width: 100%;
  margin-top: 12px;
  border: none;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
  transition: all 0.3s ease;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

.btn-danger:active {
  transform: translateY(0);
}

/* MEV Section */
.mev-section {
  background-color: var(--tg-theme-section-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mev-section h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--tg-theme-hint-color);
  font-size: 14px;
  margin-bottom: 20px;
}

.chart-container {
  height: 200px;
  position: relative;
}

/* RPC Section (part of dashboard) */
.rpc-section {
  background-color: var(--tg-theme-section-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--tg-theme-hint-color);
  font-size: 14px;
}

.rpc-table {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

.table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  background-color: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  font-size: 14px;
  color: var(--tg-theme-section-header-text-color);
}

.table-body {
  padding: 0;
}

.rpc-node-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rpc-node-item:last-child {
  border-bottom: none;
}

/* Badges (monochrome) */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 1.2;
  text-transform: capitalize;
  border: 1px solid #e5e5e5;
  color: #e5e5e5;
  background-color: transparent;
}
.badge-in {
  border-color: #e5e5e5;
  color: #e5e5e5;
  background-color: transparent;
}
.badge-out {
  border-color: #ffffff;
  color: #000000;
  background-color: #ffffff;
}
.badge-neutral {
  border-color: #5a5a5a;
  color: #e5e5e5;
  background-color: #2b2b2b;
}

/* Referrals (part of dashboard) */
.referrals-section {
  background-color: var(--tg-theme-section-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 20px;
  margin-bottom: 100px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.referrals-section h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.referrals-section p {
  color: var(--tg-theme-hint-color);
  font-size: 14px;
  margin-bottom: 16px;
}

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

.referral-link input {
  flex: 1;
  background-color: var(--tg-theme-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  color: var(--tg-theme-text-color);
  font-size: 14px;
}

.referral-link button {
  background-color: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color);
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
}

/* Profile Page */
.profile-page-content {
  padding-bottom: 100px; /* Extra space for bottom nav */
}

.profile-section, .telegram-details, .preferences-section, .wallet-section {
  background-color: var(--tg-theme-section-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-section h3, .telegram-details h3, .preferences-section h3, .wallet-section h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.profile-info p {
  margin-bottom: 8px;
  font-size: 16px;
}

.telegram-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

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

.username {
  color: var(--tg-theme-accent-text-color);
  font-weight: 500;
}

.premium-status {
  color: var(--tg-theme-hint-color);
  font-size: 14px;
}

/* Preferences Toggles */
.preference-toggles {
  margin-top: 20px;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-item:last-child {
  border-bottom: none;
}

.toggle {
  width: 50px;
  height: 28px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  border: none;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s;
}

.toggle:checked {
  background-color: #e5e5e5; /* subtle gray to distinguish state in monochrome */
}

.toggle::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
}

.toggle:checked::after {
  transform: translateX(22px);
}

/* Wallet Section */
.wallet-section {
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.wallet-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--tg-theme-text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-section h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--tg-theme-text-color);
}

.mnemonic-container {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Crypto Icons */
.crypto-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px;
}

.crypto-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.crypto-icon img:hover {
  transform: scale(1.1);
}

/* Fallback for missing images */
.crypto-icon img:not([src]),
.crypto-icon img[src=""] {
  display: none;
}

.crypto-icon:has(img:not([src])),
.crypto-icon:has(img[src=""]) {
  background: linear-gradient(135deg, #9945FF, #627EEA);
  color: white;
  font-weight: bold;
  font-size: 12px;
}

/* Wallet Type Buttons */
.wallet-type-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.wallet-type-btn {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  color: var(--tg-theme-text-color);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  min-width: 120px;
  justify-content: center;
}

.wallet-type-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wallet-type-btn.active {
  border-color: var(--tg-theme-button-color);
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  box-shadow: 0 0 0 1px var(--tg-theme-button-color);
}

.wallet-type-btn.active .crypto-icon {
  transform: scale(1.1);
}

/* Detection Badge */
.detected-wallet-type {
  margin: 12px 0;
  text-align: center;
}

.detection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Warning Text */
.warning-text {
  color: #ff9800;
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Import Status */
.import-status {
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-weight: 500;
  text-align: center;
}

.import-status.success {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.import-status.error {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.mnemonic-container textarea {
  flex: 1;
  background-color: var(--tg-theme-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  color: var(--tg-theme-text-color);
  font-size: 14px;
  font-family: monospace;
  resize: none;
  min-height: 80px;
}

.mnemonic-container button {
  background-color: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color);
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  align-self: flex-start;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--tg-theme-header-bg-color);
  display: flex;
  padding: 8px 0 env(safe-area-inset-bottom);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  color: var(--tg-theme-hint-color);
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  transition: color 0.2s;
}

.nav-item.active {
  color: var(--tg-theme-accent-text-color);
}

.nav-item svg {
  transition: transform 0.2s;
}

.nav-item:hover svg {
  transform: scale(1.1);
}

/* Support Button */
.support-btn {
  position: fixed;
  bottom: 100px;
  right: 16px;
  background: linear-gradient(135deg, #ffffff, #f0f0f0);
  color: #000000;
  border: none;
  border-radius: 24px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
  z-index: 99;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.support-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.4);
}

.support-btn svg {
  transition: transform 0.2s ease;
}

.support-btn:hover svg {
  transform: scale(1.1);
}

/* Deposit/Withdraw Pages */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
  padding: 0 4px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--tg-theme-text-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.back-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.page-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

/* Deposit Page */
.deposit-info, .withdraw-info {
  background-color: var(--tg-theme-section-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Hide deposit address and legacy instructions on Deposit page (minimal amount-only UI) */
#deposit .deposit-info,
#deposit .wallet-address-container,
#deposit .wallet-section h3,
#deposit .deposit-instructions,
#confirmDepositBtn {
  display: none !important;
}

.deposit-info p, .withdraw-info p {
  color: var(--tg-theme-hint-color);
  margin: 0;
  line-height: 1.5;
}

.wallet-address-container {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.wallet-address-container textarea {
  flex: 1;
  background-color: var(--tg-theme-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 12px;
  color: var(--tg-theme-text-color);
  font-size: 14px;
  font-family: monospace;
  resize: none;
  min-height: 60px;
}

.copy-btn {
  background-color: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.copy-btn:hover {
  opacity: 0.8;
}

.deposit-instructions {
  background-color: var(--tg-theme-section-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.deposit-instructions h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: var(--tg-theme-text-color);
}

.deposit-instructions ol {
  margin: 0;
  padding-left: 20px;
  color: var(--tg-theme-hint-color);
}

.deposit-instructions li {
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Withdraw Page */
.balance-display {
  background-color: var(--tg-theme-section-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.balance-display h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--tg-theme-section-header-text-color);
}

.balance-display .balance-amount {
  font-size: 32px;
  font-weight: 300;
  color: var(--tg-theme-text-color);
  margin: 0;
}

.withdrawal-form {
  background-color: var(--tg-theme-section-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--tg-theme-text-color);
  letter-spacing: 0.5px;
}

.form-select {
  width: 100%;
  background-color: var(--tg-theme-bg-color);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--tg-theme-text-color);
  font-size: 16px;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 48px;
}

.form-select:focus {
  outline: none;
  border-color: var(--tg-theme-button-color);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-textarea {
  width: 100%;
  background-color: var(--tg-theme-bg-color);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--tg-theme-text-color);
  font-size: 14px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  resize: vertical;
  min-height: 100px;
  transition: all 0.3s ease;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--tg-theme-button-color);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 12px;
  font-size: 18px;
  font-weight: 500;
  color: var(--tg-theme-hint-color);
  z-index: 1;
}

.form-group input {
  width: 100%;
  background-color: var(--tg-theme-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 12px;
  color: var(--tg-theme-text-color);
  font-size: 16px;
  transition: all 0.2s;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.form-group input[type="number"] {
  padding-left: 32px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--tg-theme-button-color);
}

.form-group input::placeholder {
  color: var(--tg-theme-hint-color);
}

/* Import Wallet Section */
.import-wallet-section {
  background-color: var(--tg-theme-section-bg-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.import-wallet-section h4 {
  margin-bottom: 16px;
  font-size: 18px;
  color: var(--tg-theme-text-color);
}

.form-control {
  width: 100%;
  background-color: var(--tg-theme-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  color: var(--tg-theme-text-color);
  font-size: 16px;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--tg-theme-button-color);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
  font-family: monospace;
}

.withdrawal-details {
  margin: 20px 0;
  padding: 16px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  color: var(--tg-theme-hint-color);
  font-size: 14px;
}

.detail-row.total {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 8px;
  padding-top: 12px;
  color: var(--tg-theme-text-color);
  font-weight: 600;
  font-size: 16px;
}

.btn-full {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
}

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

/* Responsive Design */
@media (max-width: 480px) {
  .action-buttons {
    flex-direction: column;
  }
  
  .table-header, .rpc-node-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .table-header > div, .rpc-node-item > div {
    padding: 4px 0;
  }
  
  .balance-amount {
    font-size: 36px;
  }
  
  .balance-display .balance-amount {
    font-size: 28px;
  }
  
  .page-header {
    margin-bottom: 20px;
  }
  
  .page-header h2 {
    font-size: 20px;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

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

.page.active {
  animation: fadeIn 0.3s ease-out;
}

/* Chart Styles */
.chart-container canvas {
  border-radius: 8px;
}

/* Button Icons */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

/* RPC Section Enhancements */
.rpc-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rpc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.1);
}

.multiplier-badge {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Referral Section Enhancements */
.referral-stats {
  margin: 20px 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--tg-theme-text-color);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--tg-theme-hint-color);
  margin-top: 4px;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #ffffff, #f0f0f0);
  color: #000000;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.copy-btn.copied {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
}

/* Transaction Section Enhancements */
.tx-item {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: center;
}

.tx-item:last-child {
  border-bottom: none;
}

.tx-time {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
  font-family: monospace;
}

.tx-direction .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.tx-amount {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.amount-sol {
  font-weight: 600;
  color: var(--tg-theme-text-color);
  font-family: monospace;
}

.amount-usd {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
}

.tx-fee {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
  font-family: monospace;
}

.explorer-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--tg-theme-link-color);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.explorer-link:hover {
  color: var(--tg-theme-button-color);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-icon {
  color: var(--tg-theme-hint-color);
  margin-bottom: 16px;
}

.empty-text {
  color: var(--tg-theme-hint-color);
  font-size: 14px;
}

/* Card Enhancements */
.card {
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--tg-theme-text-color);
}

.card .section-subtitle {
  color: var(--tg-theme-hint-color);
  font-size: 14px;
  margin-bottom: 20px;
}
