/* Performance Waterfall Simulator — styles.css — Indigo Night */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #6366F1;
  --secondary: #818CF8;
  --accent: #F43F5E;
  --bg: #0A0A1A;
  --bg-card: rgba(12, 12, 30, 0.92);
  --surface: rgba(25, 25, 60, 0.5);
  --border: rgba(99, 102, 241, 0.1);
  --text: #E4E4F0;
  --text-dim: #8888B0;
  --text-muted: #4A4A70;
  --radius: 12px;
  --radius-sm: 8px;
  --glass: rgba(10, 10, 26, 0.88);
  --transition: 0.25s ease;

  --c-script: #F59E0B;
  --c-css: #8B5CF6;
  --c-image: #10B981;
  --c-font: #06B6D4;
  --c-html: #F43F5E;
  --c-xhr: #EC4899;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--glass); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.header h1 { font-size: 15px; font-weight: 600; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.header-right { display: flex; gap: 8px; }

.btn {
  padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500; cursor: pointer; transition: var(--transition);
}
.btn:hover { border-color: var(--primary); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #4F46E5); border-color: transparent; color: #fff; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { width: 100%; padding: 12px; font-size: 14px; margin: 12px 0; }

.input {
  padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; font-size: 12px; outline: none;
}
.input:focus { border-color: var(--primary); }
.input-sm { width: 100px; }
select.input { cursor: pointer; }

.app-container { max-width: 1200px; margin: 0 auto; padding: 16px; }

.add-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.add-row .input:first-child { flex: 1; min-width: 120px; }

.resources-list { margin: 12px 0; display: flex; flex-direction: column; gap: 4px; }
.res-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px;
}
.res-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.res-name { flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.res-badge { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; background: var(--surface); }
.res-remove { cursor: pointer; opacity: 0.4; font-size: 11px; }
.res-remove:hover { opacity: 1; }

.summary-bar { display: flex; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.summary-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; flex: 1; min-width: 100px; }
.summary-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 4px; }
.summary-value { font-size: 18px; font-weight: 600; }
.summary-value.critical { color: var(--accent); }

.waterfall-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.waterfall-header {
  display: grid; grid-template-columns: 1.2fr 70px 80px 60px 60px 2fr;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted);
}
.waterfall-body { max-height: 400px; overflow-y: auto; }
.wf-row {
  display: grid; grid-template-columns: 1.2fr 70px 80px 60px 60px 2fr;
  padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 11px; align-items: center;
}
.wf-row.critical-path { background: rgba(244, 63, 94, 0.05); }
.wf-name { font-family: 'JetBrains Mono', monospace; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-type { font-size: 10px; text-transform: uppercase; }
.wf-strat { font-size: 10px; }
.wf-size { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); }
.wf-time { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.wf-bar { position: relative; height: 14px; }
.wf-bar-inner { position: absolute; height: 100%; border-radius: 3px; min-width: 3px; transition: all 0.5s ease; }

.time-ruler { display: flex; padding: 4px 12px; font-size: 9px; color: var(--text-muted); border-top: 1px solid var(--border); }
.time-ruler span { flex: 1; text-align: center; }

.recommendations { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.recommendations h3 { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.6px; }
.recommendations ul { list-style: none; }
.recommendations li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-dim); }
.recommendations li:last-child { border-bottom: none; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13px; color: var(--text);
  opacity: 0; transition: all 0.3s ease; z-index: 300; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }

@media (max-width: 800px) {
  .waterfall-header, .wf-row { grid-template-columns: 1fr 60px 60px 50px; }
  .wf-bar, .wf-strat { display: none; }
  .add-row .input-sm { width: 80px; }
}
