:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --text-primary: #f5f5f5;
  --text-secondary: #9ca3af;
  --accent: #8b5cf6;
  --accent-secondary: #3b82f6;
  --border: #2a2a3a;
  --success: #22c55e;
  --error: #ef4444;
}

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

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 0 0 0.5rem 0.5rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 10000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Selection styles */
::selection {
  background: rgba(139, 92, 246, 0.4);
  color: white;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
}

h1 .gradient {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

header a {
  color: var(--accent);
  text-decoration: underline;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.stat-card {
  background: rgba(18, 18, 26, 0.8);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: rgba(25, 25, 35, 0.9);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Network Distribution Section */
.network-section {
  background: rgba(18, 18, 26, 0.8);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  backdrop-filter: blur(8px);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.section-icon {
  font-size: 1rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.network-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .network-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .network-grid {
    grid-template-columns: 1fr;
  }
}

.network-card {
  background: rgba(30, 30, 45, 0.6);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.2s, transform 0.2s;
  min-width: 0;
}

.network-card:hover {
  background: rgba(40, 40, 55, 0.8);
  transform: translateY(-2px);
}

.network-card-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible; /* Allow logos to float */
}

/* Network logo images - larger and transparent */
.network-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.network-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
}

.network-icon-fallback.sepolia {
  background: linear-gradient(135deg, #627eea, #3b5998);
  color: white;
}

.network-icon-fallback.base-sepolia {
  background: linear-gradient(135deg, #0052ff, #0066ff);
  color: white;
}

.network-icon-fallback.scroll-sepolia {
  background: linear-gradient(135deg, #ffcc80, #ffa726);
  color: #333;
}

.network-icon-fallback.holesky {
  background: linear-gradient(135deg, #ff6b9d, #c44569);
  color: white;
}

.network-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.network-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.network-card-stats {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Redesigned Network Distribution V2 */
.network-grid-v2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .network-grid-v2 {
    grid-template-columns: 1fr;
  }
}

.network-row-v2 {
  background: rgba(30, 30, 45, 0.4);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: transform 0.2s, background 0.2s;
}

.network-row-v2:hover {
  background: rgba(40, 40, 55, 0.6);
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.2);
}

.network-row-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.network-row-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.network-row-claims {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  margin-left: auto;
}

.network-token-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.token-stat-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(10, 10, 15, 0.5);
  padding: 0.4rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.token-stat-pill.eth { border-color: rgba(98, 126, 234, 0.3); }
.token-stat-pill.usdc { border-color: rgba(39, 117, 202, 0.3); }
.token-stat-pill.usdt { border-color: rgba(80, 175, 149, 0.3); }

.token-pill-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

.token-pill-value {
  font-weight: 600;
  color: var(--text-primary);
}

.token-pill-symbol {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

/* Token Selector Styles */
.token-selector {
  display: flex;
  gap: 0.75rem;
  background: rgba(30, 30, 45, 0.6);
  padding: 0.4rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.token-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.token-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.token-option.selected {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.token-icon {
  font-weight: 700;
  color: var(--accent);
}

.token-logo {
  width: 1.1rem;
  height: 1.1rem;
  object-fit: contain;
}

.token-name {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Custom Dropdown Styling (Google Cloud Web3 Style) */
.custom-select.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.custom-select.disabled .select-trigger {
  background: rgba(40, 40, 55, 0.4);
  border-color: var(--border);
}

.custom-select.disabled .select-arrow {
  display: none;
}

.custom-select {
  position: relative;
  width: 100%;
  user-select: none;
}

.select-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: rgba(30, 30, 45, 0.6);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.select-trigger:hover {
  background: rgba(40, 40, 55, 0.8);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.select-trigger:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.custom-select.open .select-trigger {
  border-radius: 0.75rem 0.75rem 0 0;
  border-color: var(--accent);
  background: rgba(40, 40, 55, 0.9);
}

.select-icon {
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.select-text {
  flex: 1;
  font-weight: 500;
}

.select-arrow {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.custom-select.open .select-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}

.select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1a2e;
  border: 1px solid var(--accent);
  border-top: none;
  border-radius: 0 0 0.75rem 0.75rem;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.custom-select.open .select-options {
  display: block;
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text-secondary);
}

.option:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
}

.option.selected {
  background: rgba(139, 92, 246, 0.15);
  color: var(--text-primary);
  font-weight: 600;
}

.option-text {
  flex: 1;
}

.option-check {
  margin-left: 0.5rem;
  color: var(--accent);
  font-size: 1.1rem;
  opacity: 0;
}

.option.selected .option-check {
  opacity: 1;
}


/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

/* Cards */
.card {
  background: rgba(18, 18, 26, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 1rem;
  padding: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.card-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(139, 92, 246, 0.2);
}

.card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--accent);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Form */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

input, select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(30, 30, 40, 0.8);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

input::placeholder {
  color: #6b7280;
}

select option {
  background: var(--bg-secondary);
}

/* Button */
.btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border: none;
  border-radius: 0.5rem;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.98);
}

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

/* Messages */
.message {
  display: none;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.message.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: var(--success);
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: var(--error);
}

.message a {
  color: inherit;
  word-break: break-all;
}

/* Claims List */
.claims-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.claim-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(30, 30, 40, 0.5);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.claim-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.claim-network {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible; /* Allow logos to float */
}

/* Claim network logos - larger and transparent */
.claim-network-logo {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.claim-network-abbr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Network-specific backgrounds for claim fallbacks */
.claim-network-abbr.sepolia {
  background: linear-gradient(135deg, #627eea, #3b5998);
  color: white;
}

.claim-network-abbr.base-sepolia {
  background: linear-gradient(135deg, #0052ff, #0066ff);
  color: white;
}

.claim-network-abbr.scroll-sepolia {
  background: linear-gradient(135deg, #ffcc80, #ffa726);
  color: #333;
}

.claim-network-abbr.holesky {
  background: linear-gradient(135deg, #ff6b9d, #c44569);
  color: white;
}

.claim-address {
  font-family: monospace;
  font-size: 0.85rem;
}

.claim-email {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.claim-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.empty-state {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

footer a {
  color: var(--accent);
}

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

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

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.1) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Focus Visible (keyboard navigation) */
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Input Error State */
input.input-error,
input[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

input.input-error:focus,
input[aria-invalid="true"]:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

/* Toast Container */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  pointer-events: none;
}

@media (max-width: 480px) {
  #toast-container {
    left: 1rem;
    right: 1rem;
    top: 1rem;
    max-width: none;
  }
}

/* Toast */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(18, 18, 26, 0.95);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.toast-success {
  border-color: rgba(34, 197, 94, 0.5);
}

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
}

.toast.toast-info {
  border-color: rgba(59, 130, 246, 0.5);
}

.toast-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error .toast-icon {
  color: var(--error);
}

.toast-info .toast-icon {
  color: var(--accent-secondary);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  word-break: break-word;
}

.toast-message a {
  color: var(--accent);
  text-decoration: underline;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

.toast.toast-exiting {
  animation: toast-out 0.2s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Progress bar for auto-dismiss */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 0.75rem 0.75rem;
  animation: toast-progress linear forwards;
}

.toast-success .toast-progress {
  background: var(--success);
}

.toast-error .toast-progress {
  background: var(--error);
}

@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

