/* ============================================================
   NPM Package Size — Styles
   Theme: Dark mode with Pink/Magenta palette
   ============================================================ */

:root {
  --primary: #EC4899;
  --primary-hover: #F472B6;
  --secondary: #F9A8D4;
  --accent: #FCE7F3;
  --bg: #1A0A15;
  --bg-card: #221420;
  --bg-glass: rgba(34, 20, 32, 0.7);
  --bg-input: #1E0E18;
  --border: rgba(236, 72, 153, 0.15);
  --border-hover: rgba(236, 72, 153, 0.35);
  --text: #F5E6F0;
  --text-muted: #B899AD;
  --text-dim: #7A5E70;
  --danger: #EF4444;
  --success: #10B981;
  --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(236, 72, 153, 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: 900px; margin: 0 auto; padding: 0 20px 60px; }

/* Header */
.header { padding: 24px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-badge { 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.25rem; 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: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--glow); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-accent { background: rgba(236,72,153,0.15); color: var(--primary); border: 1px solid var(--border); }
.btn-accent:hover { background: rgba(236,72,153,0.25); }
.btn-accent:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-outline { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--border-hover); color: var(--text); }

/* Search */
.search-section { margin-bottom: 24px; }
.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(236,72,153,0.1); }
#searchInput::placeholder { color: var(--text-dim); }

/* Suggestions */
.suggestions { 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); }
.suggestions.visible { display: block; }
.sug-item { padding: 10px 14px; cursor: pointer; transition: background var(--transition); border-bottom: 1px solid rgba(236,72,153,0.05); }
.sug-item:last-child { border-bottom: none; }
.sug-item:hover, .sug-item.active { background: rgba(236,72,153,0.08); }
.sug-name { font-weight: 600; font-size: 0.85rem; }
.sug-desc { font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Compare bar */
.compare-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.compare-bar[hidden] { display: none; }
.compare-label { font-size: 0.75rem; color: var(--text-dim); }
.compare-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.compare-tag { display: inline-flex; align-items: center; gap: 4px; 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); }
.compare-tag .x { cursor: pointer; color: var(--text-dim); font-size: 0.85rem; transition: color var(--transition); }
.compare-tag .x:hover { color: var(--danger); }

/* 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 */
.result-area[hidden] { display: none; }
.result-area { animation: fadeUp 350ms ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; 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.3rem; font-weight: 700; color: var(--secondary); }
.stat-card .sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

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

/* Dep Tree */
.dep-tree { font-size: 0.8rem; max-height: 280px; overflow-y: auto; }
.dep-node { padding: 4px 0 4px 16px; border-left: 1px solid rgba(236,72,153,0.1); position: relative; }
.dep-node::before { content: ''; position: absolute; left: 0; top: 14px; width: 10px; height: 1px; background: rgba(236,72,153,0.1); }
.dep-name { font-weight: 600; }
.dep-ver { color: var(--text-dim); font-size: 0.72rem; margin-left: 4px; }

/* Trend Chart */
#trendChart { width: 100%; max-height: 200px; }

/* Download Times */
.download-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.dl-card { background: rgba(236,72,153,0.05); border: 1px solid rgba(236,72,153,0.08); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.dl-speed { font-size: 0.7rem; color: var(--text-dim); margin-bottom: 4px; }
.dl-time { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.dl-label { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

/* Alts Table */
.alt-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.alt-table th { text-align: left; padding: 8px 10px; color: var(--text-dim); font-size: 0.7rem; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.alt-table td { padding: 8px 10px; border-bottom: 1px solid rgba(236,72,153,0.05); }
.alt-best { color: var(--secondary); font-weight: 700; }

/* Compare Table */
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.compare-table th { padding: 10px; text-align: left; color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.compare-table td { padding: 10px; border-bottom: 1px solid rgba(236,72,153,0.05); }
.compare-table td:first-child { color: var(--text-dim); font-weight: 500; }
.cell-best { color: var(--secondary) !important; font-weight: 700; }

.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
.action-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

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

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