/* ============================================
   Pre-commit Config Builder — Styles
   ============================================ */

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

:root {
  --primary: #E17055;
  --primary-light: #FAB1A0;
  --primary-dark: #c0392b;
  --accent: #0984E3;
  --accent-light: #74b9ff;
  --bg: #1A0F0A;
  --bg-surface: #241810;
  --bg-card: #2e1f16;
  --bg-elevated: #3d2a1e;
  --text: #f0e6df;
  --text-muted: #b09a8a;
  --text-dim: #7a6a5c;
  --border: #4a3528;
  --border-light: #5e4535;
  --success: #00b894;
  --warning: #fdcb6e;
  --error: #e17055;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --glow: 0 0 20px rgba(225, 112, 85, 0.2);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }

/* --- Layout --- */
.app { max-width: 1200px; margin: 0 auto; padding: 0 20px; min-height: 100vh; display: flex; flex-direction: column; }
.header { padding: 28px 0 20px; border-bottom: 1px solid var(--border); }
.header-content { display: flex; flex-direction: column; gap: 6px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo h1 { font-size: 1.4rem; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--primary-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.tagline { color: var(--text-muted); font-size: 0.875rem; margin-left: 44px; }
.main { flex: 1; padding: 20px 0; display: flex; flex-direction: column; gap: 20px; }
.footer { padding: 20px 0; border-top: 1px solid var(--border); text-align: center; }
.footer p { font-size: 0.75rem; color: var(--text-dim); }

/* --- Controls Row --- */
.controls-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.search-group { flex: 1; min-width: 180px; }

.select, .input {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8125rem;
  transition: border-color var(--transition);
}
.select:focus, .input:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow); }
.input { width: 100%; }
.input::placeholder { color: var(--text-dim); }

/* --- Layout Grid --- */
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* --- Panel --- */
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-header h2 { font-size: 0.9375rem; font-weight: 600; }
.panel-actions { display: flex; gap: 8px; }

/* --- Badge --- */
.badge { font-size: 0.6875rem; padding: 3px 10px; background: rgba(225, 112, 85, 0.15); color: var(--primary-light); border-radius: 999px; font-weight: 500; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border: none; border-radius: var(--radius-sm); font-family: var(--font); font-size: 0.8125rem; font-weight: 500; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text); border-color: var(--border-light); }
.btn-primary-sm { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-primary-sm:hover { transform: translateY(-1px); box-shadow: var(--glow); }
.btn-add { padding: 4px 10px; font-size: 0.75rem; background: rgba(225, 112, 85, 0.12); color: var(--primary-light); border: 1px solid rgba(225, 112, 85, 0.25); border-radius: var(--radius-xs); }
.btn-add:hover { background: rgba(225, 112, 85, 0.25); }
.btn-remove { padding: 3px 8px; font-size: 0.6875rem; background: rgba(225, 112, 85, 0.08); color: var(--error); border: 1px solid rgba(225, 112, 85, 0.2); border-radius: var(--radius-xs); cursor: pointer; }
.btn-remove:hover { background: rgba(225, 112, 85, 0.2); }

/* --- Hook List --- */
.hook-list { display: flex; flex-direction: column; gap: 8px; max-height: 500px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

.hook-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all var(--transition); animation: fadeIn 0.2s ease; }
.hook-item:hover { border-color: var(--primary); background: var(--bg-elevated); }
.hook-info { flex: 1; min-width: 0; }
.hook-name { font-size: 0.8125rem; font-weight: 600; color: var(--primary-light); }
.hook-meta { font-size: 0.6875rem; color: var(--text-muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.hook-tag { padding: 1px 6px; background: var(--bg-elevated); border-radius: var(--radius-xs); font-size: 0.625rem; color: var(--text-dim); }
.hook-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

/* --- Config Repos --- */
.config-repos { display: flex; flex-direction: column; gap: 12px; max-height: 500px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

.config-repo { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; animation: fadeIn 0.2s ease; }
.config-repo-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.config-repo-name { font-size: 0.8125rem; font-weight: 600; color: var(--accent-light); font-family: var(--font-mono); word-break: break-all; }
.config-repo-version { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.config-repo-version label { font-size: 0.6875rem; color: var(--text-muted); }
.version-input { width: 100px; padding: 4px 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-family: var(--font-mono); font-size: 0.75rem; }
.version-input:focus { outline: none; border-color: var(--primary); }
.config-hooks { display: flex; flex-direction: column; gap: 6px; }
.config-hook { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: var(--bg-card); border-radius: var(--radius-xs); }
.config-hook-name { font-size: 0.75rem; font-family: var(--font-mono); color: var(--primary-light); }
.config-hook-args { font-size: 0.6875rem; color: var(--text-dim); }

/* Args input */
.args-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.args-input { flex: 1; padding: 3px 8px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-family: var(--font-mono); font-size: 0.6875rem; }
.args-input:focus { outline: none; border-color: var(--primary); }

/* --- YAML Output --- */
.code-output { padding: 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--success); font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; overflow-x: auto; white-space: pre; min-height: 100px; }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 30px 20px; color: var(--text-dim); font-size: 0.8125rem; }

/* --- Toast --- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); padding: 10px 20px; background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: var(--radius-sm); color: var(--text); font-size: 0.8125rem; font-weight: 500; box-shadow: var(--shadow); opacity: 0; transition: all 0.3s ease; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* --- Responsive --- */
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .controls-row { flex-direction: column; }
  .search-group { min-width: 100%; }
  .app { padding: 0 14px; }
  .logo h1 { font-size: 1.1rem; }
  .tagline { margin-left: 0; margin-top: 4px; }
}
