/* ============================================================
   NPM Package Size Checker — Styles
   Theme: Dark mode with Lime Green palette
   ============================================================ */

:root {
  --primary: #84CC16;
  --primary-hover: #9AE22A;
  --secondary: #A3E635;
  --accent: #D9F99D;
  --bg: #0A0A0A;
  --bg-card: #141414;
  --bg-glass: rgba(20, 20, 20, 0.7);
  --bg-input: #111111;
  --border: rgba(132, 204, 22, 0.15);
  --border-hover: rgba(132, 204, 22, 0.35);
  --text: #F0F0F0;
  --text-muted: #A0A0A0;
  --text-dim: #666;
  --danger: #EF4444;
  --warning: #F59E0B;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 200ms ease;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --glow: 0 0 16px rgba(132, 204, 22, 0.12);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

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

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Header */
.header {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.logo-group { display: flex; align-items: center; gap: 12px; }

.logo-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-glass);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

h1 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.tagline { font-size: 0.78rem; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}

.btn-primary {
  background: var(--primary); color: #000;
}
.btn-primary:hover {
  background: var(--primary-hover); box-shadow: var(--glow);
}

.btn-ghost {
  background: var(--bg-card); color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--border-hover); color: var(--text);
}

/* Search */
.search-section { margin-bottom: 28px; }

.search-row { display: flex; gap: 10px; }

.search-wrap { flex: 1; position: relative; }

.search-ico {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text-dim); pointer-events: none;
}

#searchInput {
  width: 100%; padding: 12px 16px 12px 42px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font); font-size: 0.95rem; outline: none;
  transition: border-color var(--transition);
}
#searchInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}
#searchInput::placeholder { color: var(--text-dim); }

/* Autocomplete */
.autocomplete {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); max-height: 220px; overflow-y: auto;
  z-index: 100; display: none; box-shadow: var(--shadow);
}
.autocomplete.visible { display: block; }

.ac-item {
  padding: 10px 14px; cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(132, 204, 22, 0.05);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: rgba(132, 204, 22, 0.08); }
.ac-name { font-weight: 600; font-size: 0.85rem; }
.ac-desc { font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Recent searches */
.recent-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.recent-bar[hidden] { display: none; }
.recent-label { font-size: 0.75rem; color: var(--text-dim); }
.recent-list { display: flex; gap: 6px; flex-wrap: wrap; }

.recent-tag {
  padding: 4px 10px; font-size: 0.75rem; font-weight: 500;
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: 16px; color: var(--secondary); cursor: pointer;
  transition: all var(--transition);
}
.recent-tag:hover { border-color: var(--primary); background: rgba(132, 204, 22, 0.08); }

/* Loader */
.loader { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 50px 20px; }
.loader[hidden] { display: none; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results[hidden] { display: none; }
.results { animation: fadeUp 350ms ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* Hero Stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); }
.stat-card .label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 4px; }
.stat-card .value { font-size: 1.4rem; font-weight: 700; color: var(--secondary); }
.stat-card .sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.stat-card.warn .value { color: var(--warning); }
.stat-card.danger .value { color: var(--danger); }

/* Panels */
.panel {
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.panel-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; }

/* Dependency Tree */
.dep-tree { font-size: 0.82rem; max-height: 340px; overflow-y: auto; }

.dep-node {
  padding: 4px 0 4px 18px;
  border-left: 1px solid rgba(132, 204, 22, 0.12);
  position: relative;
}
.dep-node::before {
  content: ''; position: absolute; left: 0; top: 14px;
  width: 12px; height: 1px; background: rgba(132, 204, 22, 0.12);
}
.dep-name { font-weight: 600; color: var(--text); }
.dep-ver { color: var(--text-dim); font-size: 0.75rem; margin-left: 4px; }

/* Trends chart */
#trendsChart { width: 100%; max-height: 220px; }

/* Alternatives table */
.alt-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.alt-table th { text-align: left; padding: 8px 10px; color: var(--text-dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.alt-table td { padding: 10px; border-bottom: 1px solid rgba(132, 204, 22, 0.05); }
.alt-table tr:hover td { background: rgba(132, 204, 22, 0.03); }
.alt-best { color: var(--secondary); font-weight: 700; }

/* Export row */
.export-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state[hidden] { display: none; }
.empty-icon { margin-bottom: 16px; }
.empty-state h2 { font-size: 1.15rem; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 0.88rem; max-width: 400px; margin: 0 auto; }

/* Responsive */
@media (max-width: 640px) {
  .search-row { flex-direction: column; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 1.1rem; }
}
