/* daam.in — Clean, utilitarian price intelligence */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e2e2e2;
  --text: #1a1a1a;
  --text-muted: #777;
  --green: #0a7c42;
  --green-bg: #e6f7ee;
  --red: #c0392b;
  --red-bg: #fde8e6;
  --accent: #1a56db;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

*, *::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;
  font-size: 15px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* Header */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text) !important;
  text-decoration: none !important;
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: auto;
}

.nav-search {
  display: flex;
  gap: 0.25rem;
}

.nav-search input {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  width: 220px;
  outline: none;
}

.nav-search input:focus { border-color: var(--accent); }

.nav-search button, button[type="submit"] {
  padding: 0.4rem 1rem;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
}

.nav-search button:hover, button[type="submit"]:hover {
  background: #333;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-dot { color: var(--green); }

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0.5rem 0 1.5rem;
}

.hero-search {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.hero-search input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
}

.hero-search input:focus { border-color: var(--accent); }

.hero-search button {
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
}

/* Categories */
section { margin: 2rem 0; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; font-weight: 600; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none !important;
  color: var(--text);
  transition: border-color 0.15s;
}

.cat-card:hover { border-color: var(--accent); }
.cat-icon { font-size: 1.5rem; }
.cat-name { font-weight: 600; font-size: 1.05rem; }
.cat-desc { font-size: 0.85rem; color: var(--text-muted); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  white-space: nowrap;
}

th a { color: var(--text-muted); }
th a:hover { color: var(--accent); text-decoration: none; }

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f5f8ff; }

.highlight-row { background: #f0f4ff !important; }
.highlight-row:hover { background: #e8edfc !important; }

.num { text-align: right; font-family: var(--mono); font-size: 0.85rem; }
.nowrap { white-space: nowrap; }

.spark {
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.price-up {
  color: var(--red);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.price-down {
  color: var(--green);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.muted { color: var(--text-muted); font-size: 0.85rem; }

.label-in {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
}

/* Item detail */
.item-header { margin: 1rem 0; }
.item-header h1 { font-size: 1.75rem; font-weight: 700; }

.item-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.provider-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
}

.item-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .item-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.5rem; }
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.price-card-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.price-card-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--mono);
}

.price-card-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.5;
}

.btn-visit {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: #fff !important;
  border-radius: var(--radius);
  font-size: 0.85rem;
  text-decoration: none !important;
}

.btn-visit:hover { background: #333; }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.chart-card h3 { font-size: 1rem; margin-bottom: 0.75rem; }

.ascii-chart {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-x: auto;
  white-space: pre;
  color: var(--accent);
}

table.compact { font-size: 0.8rem; }
table.compact th, table.compact td { padding: 0.3rem 0.6rem; }

details {
  margin-top: 0.75rem;
}

details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Alert form */
.alert-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.alert-section h3 { font-size: 1rem; margin-bottom: 0.75rem; }

.alert-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.alert-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.alert-form input[type="number"],
.alert-form input[type="email"] {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
}

.alert-form input:focus { border-color: var(--accent); }

#alert-result { font-size: 0.9rem; padding: 0.4rem 0; }

/* Footer */
footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p { margin: 0.25rem 0; }
