/* BIP47 Terminal - Refined Design System */
/* Moving from "hacker aesthetic" to "precision instrument" */

:root {
  /* Color Palette - Refined from pure neon to sophisticated tones */
  --bg-primary: #0a0f0a;        /* Rich dark green-black (was #000) */
  --bg-surface: #111811;        /* Elevated charcoal (was #001100) */
  --bg-elevated: #1a241a;       /* Higher elevation */
  
  --accent-primary: #4ade80;    /* Sage green, less aggressive (was #00ff41) */
  --accent-secondary: #22d3ee;  /* Cyan for interactive states */
  --accent-success: #4ade80;    /* Success states */
  --accent-warning: #f59e0b;    /* Amber, controlled (was #ffaa00) */
  --accent-error: #ef4444;      /* Error states */
  
  --text-primary: #dcfce7;      /* Soft mint white (was #00ff41) */
  --text-secondary: #86efac;    /* Muted sage (was #00aa00) */
  --text-muted: #6b7280;        /* Gray for de-emphasized text */
  
  --border-subtle: rgba(74, 222, 128, 0.15);
  --border-default: rgba(74, 222, 128, 0.3);
  --border-strong: rgba(74, 222, 128, 0.5);
  
  --glow-subtle: rgba(74, 222, 128, 0.1);
  --glow-medium: rgba(74, 222, 128, 0.2);
  --glow-strong: rgba(74, 222, 128, 0.3);
  
  /* Typography Hierarchy */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-data: 'JetBrains Mono', 'Courier New', monospace;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  
  /* Spacing Scale */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-xl);
  flex: 1;
  width: 100%;
}

/* Main Content Area */
.main-content {
  padding: var(--space-xl) 0;
}

/* Site Header */
.site-header {
  text-align: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
}

.site-tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Navigation Bar */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--accent-primary);
}

/* Typography */
h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

/* Navigation */
.nav {
  margin-bottom: var(--space-lg);
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav a:hover {
  color: var(--accent-primary);
}

/* Buttons - Refined */
button {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--accent-primary);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
}

button:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px var(--glow-subtle);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Primary Button Variant */
button.primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  font-weight: 600;
}

button.primary:hover:not(:disabled) {
  background: #3dd074;
  box-shadow: 0 0 20px var(--glow-medium);
}

/* Cards - Refined */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  gap: var(--space-sm);
}

.card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  box-shadow: 0 4px 16px var(--glow-subtle);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: var(--space-xs);
  opacity: 0.9;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
  line-height: 1.2;
}

.card-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
  flex-grow: 1;
}

.card-action {
  font-size: 0.7rem;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  display: inline-block;
  text-align: center;
  transition: all var(--transition-fast);
}

.card:hover .card-action {
  background: rgba(74, 222, 128, 0.2);
  border-color: var(--border-default);
  color: var(--accent-primary);
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

/* 2 columns for tablets (600px - 999px) */
@media (max-width: 999px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 column for mobile (<600px) */
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Coming Soon Badge */
.coming-soon-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 0.6rem;
  background: var(--accent-warning);
  color: var(--bg-primary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.card.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.card.coming-soon:hover {
  transform: none;
  box-shadow: none;
}

/* Supported By Section */
.supported-by {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  text-align: center;
}

.supported-by-heading {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.logo-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  filter: grayscale(100%);
  opacity: 0.7;
}

.logo-link:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.1);
}

.logo-img {
  height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

/* Responsive: Stack logos on smaller screens */
@media (max-width: 600px) {
  .logo-grid {
    gap: var(--space-lg);
  }
  
  .logo-img {
    height: 32px;
    max-width: 100px;
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.footer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: var(--space-xs) 0;
}

.footer-heart {
  color: var(--accent-error);
}

/* Input Fields */
input, textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  font-family: var(--font-data);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--glow-subtle);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* Data/Monospace Text */
.data-text {
  font-family: var(--font-data);
  font-size: 0.8rem;
  color: var(--accent-primary);
  word-break: break-all;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: var(--space-sm);
  vertical-align: middle;
}

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

/* Error States */
.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--accent-error);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--accent-error);
  text-align: center;
}

.error-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

/* Success States */
.success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid var(--accent-success);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--accent-success);
}

/* Utility Classes */
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.text-cyan { color: var(--accent-secondary); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Tooltip Styles */
.tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--accent-secondary);
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-width: 300px;
  white-space: normal;
  text-align: center;
}

.tooltip:hover::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-default);
  z-index: 1001;
}

/* Copy Button Styles */
.copy-btn {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--accent-secondary);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  margin-left: var(--space-sm);
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.copy-btn:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: var(--accent-secondary);
}

.copy-btn.copied {
  background: rgba(74, 222, 128, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* QR Code Display */
.qr-display {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  text-align: center;
}

.qr-display img {
  max-width: 200px;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.qr-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--accent-secondary);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  margin-left: var(--space-sm);
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.qr-toggle-btn:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: var(--accent-secondary);
}

/* Clickable Stats */
.stat-box.clickable {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stat-box.clickable:hover {
  border-color: var(--accent-primary);
  background: rgba(74, 222, 128, 0.05);
}

.stat-box.active {
  border-color: var(--accent-primary);
  background: rgba(74, 222, 128, 0.1);
  box-shadow: 0 0 10px var(--glow-subtle);
}

/* Mobile overflow fix for addresses */
.address-item {
  overflow-x: auto;
  max-width: 100%;
}

.address-item::-webkit-scrollbar {
  height: 4px;
}

.address-item::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.address-item::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 2px;
}
