/* GlazeLog — Ceramic Glaze Recipe Tracker styles */
:root {
  --bg: #1a1612;
  --bg-surface: #231e18;
  --bg-panel: #2c2520;
  --bg-input: #352d26;
  --border: #443b32;
  --border-light: #554a3f;
  --text: #e8e0d6;
  --text-muted: #9a8e80;
  --text-dim: #6b6055;
  --accent: #e8a030;
  --accent-hover: #f0b04a;
  --accent-dim: #a07020;
  --danger: #d4604a;
  --danger-hover: #e0705a;
  --success: #6aaa6a;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

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

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

.skip-link {
  position: absolute; top: -100%;
  background: var(--accent); color: var(--bg);
  padding: 8px 16px; border-radius: var(--radius-sm);
  z-index: 100; font-weight: 600;
}
.skip-link:focus { top: 8px; left: 8px; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--accent-hover); text-decoration: underline; }

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { color: var(--accent); }
.logo-text { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.logo-accent { color: var(--accent); }

.main-nav { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
}
.nav-link:hover, .nav-link:focus { color: var(--text); background: var(--bg-input); text-decoration: none; }
.nav-link.active { color: var(--accent); background: var(--bg-input); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 48px 20px 40px; }
.hero h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 640px; margin-bottom: 24px; }
.hero-stats { display: flex; gap: 32px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* Workspace */
.workspace { max-width: 1200px; margin: 0 auto; padding: 32px 20px; }
.workspace-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; align-items: start;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.panel-header h2 { font-size: 1.1rem; font-weight: 600; }

/* Form */
#recipeForm { padding: 20px; }
.form-row { margin-bottom: 16px; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.req { color: var(--danger); }
.form-input {
  width: 100%; padding: 8px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.95rem; font-family: var(--font);
  transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,160,48,0.2); }
.form-textarea { resize: vertical; min-height: 60px; }
.form-select { appearance: none; cursor: pointer; }
.form-search { max-width: 200px; padding: 6px 10px; font-size: 0.85rem; }

.preset-bar {
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.preset-label { font-size: 0.8rem; color: var(--text-dim); }

.oxide-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.oxide-row {
  display: grid; grid-template-columns: 1fr 80px 36px; gap: 8px; align-items: center;
}
.oxide-pct { text-align: center; }

.form-actions { display: flex; gap: 8px; padding-top: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font);
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-input); color: var(--text); }
.btn-preset { background: var(--bg-input); color: var(--accent); padding: 4px 10px; font-size: 0.8rem; border: 1px solid var(--border); }
.btn-preset:hover { background: var(--border); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { color: var(--danger-hover); }
.btn-icon { padding: 4px 8px; font-size: 1.1rem; line-height: 1; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-remove-oxide { color: var(--text-dim); background: transparent; border: 1px solid var(--border); }
.btn-remove-oxide:hover { color: var(--danger); border-color: var(--danger); }

/* Recipe list */
.list-actions { display: flex; align-items: center; gap: 8px; }
.recipe-list { max-height: 600px; overflow-y: auto; }

.recipe-card {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.recipe-card:hover { background: var(--bg-input); }
.recipe-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.recipe-card-name { font-weight: 600; font-size: 1rem; }
.recipe-card-meta { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }
.recipe-card-oxides { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; font-family: var(--font-mono); }
.recipe-card-actions { display: flex; gap: 4px; flex-shrink: 0; }

.stale-badge {
  display: inline-block; padding: 1px 6px; border-radius: 10px;
  background: rgba(212,96,74,0.2); color: var(--danger);
  font-size: 0.7rem; font-weight: 600; margin-left: 6px;
  text-transform: uppercase; letter-spacing: 0.03em;
}

.batch-list { margin-top: 8px; padding-left: 16px; border-left: 2px solid var(--border); }
.batch-item {
  padding: 6px 0; font-size: 0.85rem; color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.batch-item-date { color: var(--accent-dim); font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap; }
.batch-item-details { flex: 1; }

.empty-state {
  padding: 48px 20px; text-align: center; color: var(--text-dim);
}
.empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--text-dim); }

/* Compare */
.compare-section {
  max-width: 1200px; margin: 0 auto; padding: 32px 20px;
  border-top: 1px solid var(--border);
}
.compare-section h2 { font-size: 1.3rem; margin-bottom: 8px; }
.compare-help { color: var(--text-muted); margin-bottom: 20px; }
.compare-controls {
  display: flex; align-items: flex-end; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.compare-select-group { flex: 1; min-width: 200px; }
.compare-vs { font-weight: 700; color: var(--accent); padding-bottom: 8px; }
.compare-table-wrap { overflow-x: auto; }
.compare-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.compare-table th, .compare-table td {
  padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.compare-table th { background: var(--bg-input); color: var(--text-muted); font-weight: 500; width: 20%; }
.compare-table td { width: 40%; }
.compare-table tr:last-child td, .compare-table tr:last-child th { border-bottom: none; }
.compare-diff { color: var(--accent); font-weight: 600; }

/* Guide */
.guide-section {
  max-width: 1200px; margin: 0 auto; padding: 32px 20px;
  border-top: 1px solid var(--border);
}
.guide-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.guide-block h2 { font-size: 1.1rem; margin-bottom: 12px; color: var(--accent); }
.guide-block p, .guide-block li, .guide-block dd { color: var(--text-muted); font-size: 0.95rem; }
.guide-block ol, .guide-block ul { padding-left: 20px; }
.guide-block li { margin-bottom: 8px; }
.guide-block dl { display: grid; gap: 8px; }
.guide-block dt { font-weight: 600; color: var(--text); }
.guide-block dd { margin-bottom: 8px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; }
#batchForm { padding: 20px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px; padding: 24px 20px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.footer-inner p { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 4px; }
.footer-link { color: var(--text-dim); }
.footer-link:hover { color: var(--accent); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Responsive */
@media (max-width: 900px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .hero-stats { gap: 20px; }
  .compare-controls { flex-direction: column; align-items: stretch; }
  .compare-vs { text-align: center; padding: 0; }
}
@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .main-nav { width: 100%; overflow-x: auto; }
  .form-row-split { grid-template-columns: 1fr; }
  .oxide-row { grid-template-columns: 1fr 60px 32px; }
  .preset-bar { flex-direction: column; align-items: flex-start; }
  .list-actions { flex-direction: column; align-items: stretch; }
  .form-search { max-width: 100%; }
}

/* Focus visible */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Selection */
::selection { background: var(--accent); color: var(--bg); }



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
