@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --background: #f9f7f6;
  --surface: #ffffff;
  --foreground: #251d18;
  --muted: #ede8e3;
  --muted-foreground: #72625a;
  --primary: #f58019;
  --primary-hover: #e07212;
  --primary-foreground: #ffffff;
  --border: #dbd3cc;
  --ring: rgba(245, 128, 25, 0.35);
  --success: #15845f;
  --success-soft: #ddf3eb;
  --radius: 1.5rem;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #120e0b;
    --surface: #1e1713;
    --foreground: #efebe7;
    --muted: #2d241f;
    --muted-foreground: #a6988f;
    --primary: #f5933d;
    --primary-hover: #ffaa5c;
    --primary-foreground: #1f110a;
    --border: #3b2f28;
    --success: #45e3a9;
    --success-soft: #1c3f34;
    --ring: rgba(245, 147, 61, 0.35);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
  }
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Syne', sans-serif; font-weight: 700; line-height: 1.2; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary); }

.hidden { display: none !important; }
.fade-in { animation: fade-in-up 0.6s ease-out; }

/* Navbar */
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 5%; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}
.logo { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; }
.nav-links { display: flex; gap: 2rem; font-weight: 500; align-items: center; }
.nav-links a.active { color: var(--primary); }

/* Wallet Badge */
.wallet-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--muted); padding: 0.5rem 1rem; border-radius: 2rem;
  font-family: monospace; font-size: 0.95rem; font-weight: 600;
  border: 1px solid var(--border);
}
.wallet-badge .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(21, 132, 95, 0.55); animation: dot-pulse 2s infinite;
}

/* Buttons */
.btn {
  background: var(--primary); color: var(--primary-foreground); border: none;
  padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600; border-radius: 3rem;
  cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 40%, transparent);
}
.btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-large { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-small { padding: 0.5rem 1rem; font-size: 0.9rem; box-shadow: none; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); box-shadow: none; }
.btn-outline:hover { background: var(--primary); color: var(--primary-foreground); }

/* Main Container */
.container { max-width: 1100px; margin: 4rem auto; padding: 0 2rem; }

/* Hero Section */
.hero { text-align: center; margin-bottom: 4rem; }
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; letter-spacing: -0.02em; }
.hero p { font-size: 1.2rem; color: var(--muted-foreground); max-width: 600px; margin: 0 auto; }

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.table-card {
  grid-column: 1 / -1; /* Spans full width */
}

/* Glass Card */
.glass-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2.5rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}

.card-content h3 { margin-bottom: 0.5rem; color: var(--foreground); }
.text-muted { color: var(--muted-foreground); font-size: 0.95rem; }

/* Pair Code */
.pair-code-container { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; margin-top: 1.5rem; }
.code-display {
  font-family: monospace; font-size: 3rem; font-weight: 700; letter-spacing: 0.2em;
  background: var(--muted); padding: 1rem 2rem; border-radius: 1rem; color: var(--primary);
  border: 2px dashed var(--border); user-select: all; width: 100%; text-align: center;
}

/* Stats */
.stat-value { font-size: 3.5rem; font-weight: 800; font-family: 'Syne', sans-serif; margin: 1rem 0; color: var(--foreground); }
.stat-badge {
  display: inline-block; padding: 0.25rem 0.75rem; border-radius: 1rem; font-size: 0.85rem; font-weight: 600;
}
.stat-badge.success { background: var(--success-soft); color: var(--success); }

/* Table */
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.table-responsive { overflow-x: auto; }
.tx-table { width: 100%; border-collapse: collapse; text-align: left; }
.tx-table th { padding: 1rem; border-bottom: 2px solid var(--border); color: var(--muted-foreground); font-weight: 600; }
.tx-table td { padding: 1rem; border-bottom: 1px solid var(--border); color: var(--foreground); }
.tx-table tbody tr:hover { background: var(--muted); }
.empty-state td { text-align: center; padding: 4rem 1rem; border: none; }
.empty-content { display: flex; flex-direction: column; align-items: center; color: var(--muted-foreground); }

/* Toast */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; background: var(--foreground); color: var(--background);
  padding: 1rem 2rem; border-radius: 3rem; font-weight: 500; box-shadow: var(--shadow-lg);
  transform: translateY(100px); opacity: 0; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }

@keyframes fade-in-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dot-pulse { 0% { box-shadow: 0 0 0 0 rgba(21, 132, 95, 0.55); } 70% { box-shadow: 0 0 0 6px rgba(21, 132, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 132, 95, 0); } }

@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .navbar { flex-direction: column; gap: 1rem; padding: 1rem; }
  .nav-links { gap: 1rem; font-size: 0.9rem; flex-wrap: wrap; justify-content: center; }
  .hero h1 { font-size: 2.5rem; }
  .code-display { font-size: 2.5rem; padding: 1rem; }
  .glass-card { padding: 1.5rem; }
}