/* ============================================
   NPM Package Cost Analyzer — Styles
   Theme: Dark mode with Electric Cyan palette
   ============================================ */

:root {
  --primary: #06B6D4;
  --primary-dim: rgba(6, 182, 212, 0.15);
  --secondary: #22D3EE;
  --accent: #F59E0B;
  --accent-dim: rgba(245, 158, 11, 0.15);
  --bg: #0A1A1F;
  --bg-card: rgba(10, 26, 31, 0.65);
  --bg-surface: #0F2730;
  --border: rgba(6, 182, 212, 0.12);
  --text: #E0F2FE;
  --text-dim: #5B8A9A;
  --danger: #EF4444;
  --success: #10B981;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 250ms ease;
  --font: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(6,182,212,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(245,158,11,0.03) 0%, transparent 50%);
}

.glass-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 1.25rem;
}

.header { padding: 1.25rem; text-align: center; border-bottom: 1px solid var(--border); }
.header-inner { max-width: 860px; margin: 0 auto; }
.logo { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.logo-icon { font-size: 1.75rem; }
.logo h1 {
  font-size: 1.4rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tagline { color: var(--text-dim); font-size: 0.85rem; }

.main { max-width: 860px; margin: 0 auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.section-title { font-size: 0.95rem; font-weight: 600; color: var(--primary); margin-bottom: 0.5rem; }

/* Search */
.search-row { display: flex; gap: 0.5rem; }
.search-input {
  flex: 1; padding: 0.6rem 0.8rem; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 0.9rem;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.quick-tags { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.75rem; align-items: center; }
.quick-label { font-size: 0.75rem; color: var(--text-dim); }
.quick-tag {
  padding: 0.25rem 0.6rem; border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--text-dim); font-family: var(--font); font-size: 0.75rem;
  cursor: pointer; transition: all var(--transition);
}
.quick-tag:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }

/* Package Header */
.pkg-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pkg-name { font-size: 1.3rem; font-weight: 700; color: var(--secondary); }
.pkg-meta { font-size: 0.8rem; color: var(--text-dim); }

/* Cost Grid */
.cost-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.cost-card { text-align: center; padding: 1rem; }
.cost-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.cost-value { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.cost-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.cost-sub { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.15rem; }

/* Speed Bars */
.speed-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.speed-bar-row { display: flex; align-items: center; gap: 0.75rem; }
.speed-label { width: 80px; font-size: 0.78rem; color: var(--text-dim); text-align: right; }
.speed-track { flex: 1; height: 20px; background: var(--bg-surface); border-radius: 10px; overflow: hidden; position: relative; }
.speed-fill { height: 100%; border-radius: 10px; transition: width 600ms ease; }
.speed-time { width: 60px; font-size: 0.78rem; color: var(--text); text-align: left; font-weight: 600; }

/* Dep Tree */
.dep-tree { max-height: 200px; overflow-y: auto; padding: 0.5rem; background: var(--bg-surface); border-radius: var(--radius-sm); font-family: 'SF Mono', monospace; font-size: 0.75rem; color: var(--text-dim); line-height: 1.6; }

/* Alternatives */
.alt-list { display: flex; flex-direction: column; gap: 0.35rem; }
.alt-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; background: var(--bg-surface); border-radius: var(--radius-sm); }
.alt-name { font-weight: 600; color: var(--secondary); font-size: 0.85rem; }
.alt-size { font-size: 0.78rem; color: var(--success); }
.alt-desc { font-size: 0.75rem; color: var(--text-dim); flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1rem; border: none;
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #0891B2); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(6,182,212,0.35); }

.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--primary); color: #fff; padding: 0.75rem 1.5rem; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; z-index: 1000; transition: transform 300ms ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.footer { text-align: center; padding: 1.25rem; color: var(--text-dim); font-size: 0.8rem; border-top: 1px solid var(--border); }

@media (max-width: 600px) { .cost-grid { grid-template-columns: repeat(2, 1fr); } }
