/* ObituaryWatch — main stylesheet */

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

:root {
  --bg: #080808;
  --fg: #e8e4dc;
  --dim: #5a5650;
  --chalk: #f0ece4;
  --accent: #c8b89a;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Courier Prime", monospace;
  font-size: 14px;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

/* ── Header ── */
.header { text-align: center; margin-bottom: 64px; }
.logo-img {
  width: 132px; height: 132px; object-fit: contain;
  margin-bottom: 18px; display: block;
  margin-left: auto; margin-right: auto;
  filter: drop-shadow(0 0 24px rgba(200,184,154,0.12));
}
.site-name {
  font-family: "Special Elite", cursive;
  font-size: 2.2rem; letter-spacing: 0.15em;
  color: var(--chalk); text-transform: uppercase; margin-bottom: 6px;
}
.site-tagline { font-size: 10px; color: var(--dim); letter-spacing: 0.25em; text-transform: uppercase; }

/* ── Sections ── */
.section { margin-bottom: 48px; position: relative; }
.section-label {
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid #161410; font-family: "Special Elite", cursive;
}
.empty-state { color: var(--dim); font-style: italic; font-size: 13px; padding: 10px 0; }
.empty-state a { color: var(--accent); text-decoration: none; }

/* ── Search ── */
.search-wrap { position: relative; margin-bottom: 6px; }
.search-input {
  width: 100%; background: #0a0806; border: 1px solid #2a2520;
  color: var(--fg); font-family: "Courier Prime", monospace;
  font-size: 15px; padding: 14px 46px 14px 20px;
  border-radius: 50px; outline: none;
  transition: border-color .2s; letter-spacing: 0.02em;
}
.search-input:focus { border-color: #5a5048; }
.search-input::placeholder { color: #3a3630; }
.search-spinner {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; display: none;
}
.search-spinner.active { display: block; }
.search-spinner::after {
  content: ""; display: block; width: 14px; height: 14px;
  border: 1.5px solid #3a3630; border-top-color: #8a8070;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #0d0b09; border: 1px solid #2a2520;
  border-radius: 14px; overflow: hidden;
  z-index: 100; display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.search-result {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; cursor: pointer;
  transition: background .1s; border-bottom: 1px solid #141210;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result.focused { background: #141210; }
.result-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #1a1710; border: 1px solid #2a2520;
  overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #6a6058; font-weight: 700;
}
.result-avatar img { width: 100%; height: 100%; object-fit: cover; }
.result-body { flex: 1; min-width: 0; }
.result-name {
  font-size: 14px; color: #d8d2ca; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-meta {
  font-size: 11px; color: var(--dim); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-age { font-size: 11px; color: #6a6058; margin-top: 1px; }
.result-add {
  font-size: 11px; color: #5a5048; letter-spacing: 0.08em;
  text-transform: uppercase; border: 1px solid #252018;
  padding: 4px 11px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0; transition: all .15s;
}
.search-result:hover .result-add { border-color: #4a4038; color: #9a9088; }
.result-add.watching { color: #4a7a48; border-color: #2a4a28; background: #0a120a; }
.result-highlight { color: #e8d4b8; background: rgba(200,184,154,0.15); border-radius: 2px; padding: 0 1px; }
.search-empty { padding: 16px 20px; color: var(--dim); font-size: 13px; font-style: italic; }

/* ── Categories ── */
.cat-toggle {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: var(--dim);
  font-family: "Courier Prime", monospace;
  font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase;
  cursor: pointer; padding: 14px 0 10px; width: 100%; transition: color .15s;
}
.cat-toggle:hover { color: var(--chalk); }
.cat-toggle-arrow { transition: transform .25s; font-size: 10px; display: inline-block; }
.cat-toggle.open .cat-toggle-arrow { transform: rotate(90deg); }
.cat-section { display: none; }
.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding-bottom: 20px;
}
.cat-card {
  background: #0a0806; border: 1px solid #252018;
  border-radius: 12px; padding: 14px 10px; cursor: pointer;
  font-family: "Courier Prime", monospace; color: #7a7468;
  transition: border-color .15s, color .15s; text-align: center;
}
.cat-card:hover { border-color: #3a3428; color: #b0a898; }
.cat-card.selected { border-color: #6a5c48; color: var(--chalk); background: #120f0c; }
.cat-icon { display: block; font-size: 20px; margin-bottom: 6px; }
.cat-label { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.cat-msg { font-size: 11px; color: var(--dim); font-style: italic; margin-bottom: 14px; min-height: 16px; }

/* ── Watchlist pills — React style ── */
.watchlist-preview {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.preview-pill {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  padding: 11px 16px 11px 22px;
  background: black;
  cursor: default;
  transition: background .3s, border-color .3s, transform .15s;
  animation: fadeSlideIn .5s ease both;
}
.preview-pill:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.3);
  transform: scale(1.02);
}
.preview-pill:active { transform: scale(0.98); }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.preview-pill-name {
  font-size: 14px; color: rgba(255,255,255,0.9);
  font-weight: 300; letter-spacing: 0.04em;
}
.preview-pill-x {
  background: none; border: none; color: rgba(255,255,255,0.25);
  cursor: pointer; font-size: 16px; padding: 0 2px;
  font-family: inherit; transition: color .2s; line-height: 1;
}
.preview-pill-x:hover { color: rgba(255,255,255,0.7); }

.view-all-link {
  font-size: 11px; color: var(--dim); text-decoration: none;
  letter-spacing: 0.1em; text-transform: uppercase;
  display: block; text-align: center; margin-top: 12px; transition: color .15s;
}
.view-all-link:hover { color: var(--chalk); }

/* ── Email ── */
.email-row { display: flex; gap: 8px; }
.email-input {
  flex: 1; background: #0a0806; border: 1px solid #2a2520;
  color: var(--fg); font-family: "Courier Prime", monospace;
  font-size: 14px; padding: 12px 18px; border-radius: 50px;
  outline: none; transition: border-color .2s;
}
.email-input:focus { border-color: #5a5048; }
.email-input::placeholder { color: #3a3630; }
.btn-subscribe {
  background: transparent; border: 1px solid #4a4038;
  color: #9a8e80; font-family: "Courier Prime", monospace;
  font-size: 13px; padding: 12px 22px; border-radius: 50px;
  cursor: pointer; transition: border-color .15s, color .15s;
  white-space: nowrap; letter-spacing: 0.05em;
}
.btn-subscribe:hover { border-color: #7a6a58; color: var(--chalk); }
.email-msg { font-size: 11px; color: var(--dim); margin-top: 8px; min-height: 16px; font-style: italic; }

/* ── Watchlist page ── */
.back-link {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--dim); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 40px; transition: color .15s;
}
.back-link:hover { color: var(--chalk); }
.pills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pill {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 50px;
  padding: 11px 16px 11px 22px; background: black;
  transition: background .3s, border-color .3s, transform .15s;
}
.pill:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.3); transform: scale(1.02); }
.pill-name { font-size: 14px; color: rgba(255,255,255,0.9); font-weight: 300; flex: 1; letter-spacing: 0.04em; }
.pill-cat { font-size: 10px; color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; }
.pill-x {
  background: none; border: none; color: rgba(255,255,255,0.2);
  cursor: pointer; font-size: 16px; padding: 0 2px;
  transition: color .15s; font-family: inherit;
}
.pill-x:hover { color: rgba(255,255,255,0.6); }
.death-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid #111; font-size: 13px; }
.death-name { color: #b8b2aa; text-decoration: none; flex: 1; transition: color .15s; }
.death-name:hover { color: var(--chalk); }
.death-date { color: var(--dim); font-size: 11px; }
.death-det { color: #2e2a24; font-size: 11px; }
.rss-bar {
  border: 1px solid #1e1c18; padding: 10px 16px; margin-bottom: 50px;
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--dim);
}
.rss-bar a { color: #c8b89a; text-decoration: none; }

@media (max-width: 600px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .email-row { flex-direction: column; }
  .site-name { font-size: 1.9rem; }
  .watchlist-preview, .pills-grid { grid-template-columns: 1fr; }
}
