/* ⚡ Lightning Wallets Comparison — Dark Theme */
:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-hover: #1a1a28;
  --border: #252540;
  --text: #e0e0f0;
  --text-muted: #8888aa;
  --accent: #f7931a;
  --accent-glow: rgba(247, 147, 26, 0.15);
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --blue: #60a5fa;
  --radius: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ——— Header ——— */
header {
  background: linear-gradient(135deg, #0d0d1a 0%, #1a1020 50%, #0d0d1a 100%);
  border-bottom: 1px solid var(--border);
  padding: 3rem 2rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, var(--accent-glow), transparent 60%);
  opacity: 0.3;
  pointer-events: none;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #ffb347);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

header .badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.3rem 1rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

header .badge a {
  color: var(--accent);
  text-decoration: none;
}

/* ——— Main ——— */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* ——— Section ——— */
.section {
  margin-bottom: 3rem;
}

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

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.section-header .count {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.2rem 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ——— Controls ——— */
.controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-box .search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}

.filter-chip.clear {
  border-color: var(--red);
  color: var(--red);
  background: transparent;
}

.filter-chip.clear:hover {
  background: var(--red);
  color: #000;
}

/* ——— Table Wrapper ——— */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  white-space: nowrap;
}

thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  background: #16162a;
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

th:hover {
  color: var(--accent);
}

th .sort-arrow {
  margin-left: 0.3rem;
  font-size: 0.7rem;
  opacity: 0.4;
}

th .sort-arrow.active {
  opacity: 1;
  color: var(--accent);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* Name column */
td.name-cell { font-weight: 600; }
td.name-cell a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}
td.name-cell a:hover { opacity: 0.8; }

/* Link & Repo columns */
td a {
  color: var(--blue);
  text-decoration: none;
  font-size: 0.82rem;
}
td a:hover { text-decoration: underline; }

/* Boolean badges */
td .bool-true {
  color: var(--green);
  font-weight: 600;
}

td .bool-false {
  color: var(--text-muted);
  opacity: 0.5;
}

td .bool-both, td .bool-optional {
  color: var(--yellow);
  font-weight: 600;
}

td .bool-limited {
  color: var(--yellow);
  font-weight: 600;
}

td .bool-unlimited {
  color: var(--green);
  font-weight: 600;
}

/* Fee column */
td.fees-cell {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

td.fees-free {
  color: var(--green);
}

/* Repo column */
td.repo-cell a { color: var(--blue); }
td.repo-na { color: var(--text-muted); font-style: italic; }

/* ——— No results ——— */
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  display: none;
}

.no-results.visible { display: table-row; }

.no-results td {
  font-size: 1rem;
  padding: 3rem;
}

/* ——— Footer ——— */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ——— Responsive ——— */
@media (max-width: 768px) {
  header h1 { font-size: 1.6rem; }
  main { padding: 1rem; }
  .controls { flex-direction: column; }
  th, td { padding: 0.6rem 0.7rem; font-size: 0.78rem; }
}

/* ——— KEY section ——— */
.key {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 1rem;
  font-size: 0.82rem;
}

.key-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.key-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.key-dot.green { background: var(--green); }
.key-dot.yellow { background: var(--yellow); }
.key-dot.muted { background: var(--text-muted); opacity: 0.5; }

/* ——— Floating Donate Button ——— */
.donate-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #f7931a, #ffb347);
  color: #000;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(247, 147, 26, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: donatePulse 2.5s ease-in-out infinite;
}

.donate-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(247, 147, 26, 0.55);
}

.donate-fab:active {
  transform: translateY(-1px) scale(0.98);
}

.donate-icon {
  font-size: 1.1rem;
}

@keyframes donatePulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(247, 147, 26, 0.4); }
  50% { box-shadow: 0 8px 32px rgba(247, 147, 26, 0.6); }
}

/* ——— Donate Modal ——— */
.donate-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.donate-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.donate-modal {
  position: relative;
  width: 90%;
  max-width: 380px;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(247, 147, 26, 0.12), 0 16px 48px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.donate-modal-overlay.open .donate-modal {
  transform: translateY(0) scale(1);
}

.donate-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

.donate-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.donate-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.donate-modal-icon {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.donate-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.donate-modal-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.donate-modal-qr {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.donate-modal-qr img {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  position: relative;
  z-index: 2;
}

.donate-qr-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(247, 147, 26, 0.15), transparent 70%);
  z-index: 1;
}

.donate-modal-invoice {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.donate-modal-invoice input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  outline: none;
}

.donate-modal-invoice input:focus {
  border-color: var(--accent);
}

.donate-copy-btn {
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #000;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s;
}

.donate-copy-btn:hover {
  filter: brightness(1.15);
}

.donate-copy-btn.copied {
  background: var(--green);
}

.donate-modal-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: italic;
  margin-top: 0.5rem;
}

/* Responsive donate */
@media (max-width: 768px) {
  .donate-fab {
    bottom: 1.25rem;
    right: 1.25rem;
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
  }
  .donate-modal {
    padding: 1.5rem;
  }
  .donate-modal-qr img {
    width: 160px;
    height: 160px;
  }
}
