/* SearchZee — clean, slightly editorial. Dominant teal accent, mono headers. */

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #15171a;
  --ink-soft: #4a4f57;
  --ink-muted: #7d828b;
  --border: #e6e6e1;
  --border-strong: #d0d0c8;
  --teal: #01ccd3;
  --teal-deep: #009ba1;
  --red: #d30121;
  --link: #1a0dab;
  --link-visited: #6c1ec7;
  --shadow-sm: 0 1px 2px rgba(20, 25, 30, 0.04);
  --shadow-md: 0 4px 14px rgba(20, 25, 30, 0.08);
  --radius: 10px;
  --mono: 'SFMono-Regular', 'Menlo', 'Consolas', 'Liberation Mono', monospace;
  --serif: 'Iowan Old Style', 'Palatino Linotype', 'Georgia', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f12;
    --surface: #15181c;
    --ink: #ecedef;
    --ink-soft: #b8bdc4;
    --ink-muted: #7e848d;
    --border: #25292f;
    --border-strong: #353a42;
    --link: #8ab4f8;
    --link-visited: #c58af9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 20px 60px;
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  margin: 36px 0 36px;
}
.logo {
  display: inline-block;
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  position: relative;
}
.logo:visited { color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-search { color: var(--ink); }
.logo-zee { color: var(--ink-muted); }
.logo-spark {
  font-size: 26px;
  color: var(--teal);
  vertical-align: top;
  margin-left: 4px;
  position: relative;
  top: 4px;
  display: inline-block;
  transform-origin: center;
  animation: spark-spin 8s ease-in-out infinite;
}
@keyframes spark-spin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(90deg) scale(1.15); }
}
.tagline {
  margin: 22px auto 0;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.5;
  max-width: 560px;
}

/* ---------- Search box ---------- */
.search-wrapper {
  position: relative;
  margin: 28px auto 0;
  max-width: 720px;
}
.search-box {
  width: 100%;
  padding: 20px 110px 20px 28px;
  font-size: 17px;
  font-family: var(--sans);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  box-shadow: 0 2px 14px rgba(20, 25, 30, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box::placeholder { color: var(--ink-muted); font-weight: 400; }
.search-box:focus {
  border-color: var(--ink-muted);
  box-shadow: 0 4px 22px rgba(20, 25, 30, 0.09);
}
.search-clear-btn,
.search-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.search-clear-btn {
  right: 60px;
  width: 30px;
  height: 30px;
  font-size: 14px;
  color: var(--ink-muted);
  border-radius: 50%;
  display: none;
}
.search-clear-btn:hover { background: var(--border); color: var(--ink); }
.search-clear-btn.visible { display: flex; }
.search-btn {
  right: 18px;
  width: 32px;
  height: 32px;
  color: var(--teal);
  border-radius: 50%;
  transition: color 0.15s, transform 0.1s;
}
.search-btn:hover { color: var(--teal-deep); }
.search-btn:active { transform: translateY(-50%) scale(0.92); }

/* ---------- Type selector ---------- */
.search-type-selector {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 0;
}
.search-type-option {
  cursor: pointer;
  position: relative;
}
.search-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.search-type-option span {
  display: inline-block;
  padding: 6px 16px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--ink-soft);
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.search-type-option:hover span { color: var(--ink); }
.search-type-option input:checked + span {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ---------- Date filter ---------- */
.date-filter {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 14px 0 0;
}
.date-filter-label {
  font-size: 12px;
  color: var(--ink-muted);
  font-family: var(--mono);
  margin-right: 4px;
}
.date-filter-btn {
  background: none;
  border: 1px solid transparent;
  padding: 4px 10px;
  font-size: 12.5px;
  color: var(--link);
  cursor: pointer;
  font-family: var(--mono);
  border-radius: 14px;
  transition: all 0.15s;
}
.date-filter-btn:hover { background: var(--border); }
.date-filter-btn.active {
  color: var(--ink);
  background: var(--border);
  font-weight: 600;
  cursor: default;
}

/* ---------- Shortcuts (home only) ---------- */
.shortcuts-section {
  margin: 42px 0 0;
}
body.searching .shortcuts-section { display: none; }
.shortcuts-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin: 0 0 4px;
  text-align: center;
}
.shortcuts-hint {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 0 0 18px;
}
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.shortcut-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-family: var(--mono);
  transition: all 0.15s;
}
.shortcut-tile:visited { color: var(--ink-soft); }
.shortcut-tile:hover {
  border-color: var(--teal);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.shortcut-tile img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}
.shortcut-tile .shortcut-name {
  font-weight: 500;
  word-break: break-word;
  text-align: center;
}

/* ---------- Status / errors ---------- */
.status {
  margin: 24px 0 0;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.status.error { border-left-color: var(--red); color: var(--red); }

/* ---------- Results ---------- */
.results-container {
  margin: 28px 0 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.result {
  display: block;
}
.result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-family: var(--mono);
}
.result-meta img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}
.result-meta .result-source { color: var(--ink-soft); }
.result-meta .result-age { color: var(--ink-muted); }
.result-meta .result-age::before { content: '·'; margin-right: 6px; }

.result-title {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 4px;
  font-weight: 500;
}
.result-title a {
  color: var(--link);
}
.result-title a:visited { color: var(--link-visited); }

.result-url {
  font-size: 12.5px;
  color: var(--ink-muted);
  font-family: var(--mono);
  margin-bottom: 6px;
  word-break: break-all;
}

.result-summary {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

.result.news {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}
.result.news .news-thumb {
  width: 130px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--border);
}

/* ---------- Pagination ---------- */
.more-wrapper {
  display: flex;
  justify-content: center;
  margin: 32px 0 0;
}
.more-btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 12px 28px;
  font-size: 14px;
  font-family: var(--mono);
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.more-btn:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.more-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ---------- Related ---------- */
.related-container {
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.related-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin: 0 0 12px;
}
.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.related-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  padding: 7px 14px;
  font-size: 13px;
  font-family: var(--mono);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.15s;
}
.related-chip:hover {
  border-color: var(--teal);
  color: var(--ink);
  background: var(--bg);
}

/* ---------- Footer ---------- */
.footer {
  margin: 60px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-family: var(--mono);
  margin-bottom: 8px;
}
.footer-credit { font-size: 12px; }
.footer-credit a { color: var(--ink-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .container { padding: 40px 14px 40px; }
  .logo { font-size: 52px; }
  .logo-spark { font-size: 20px; top: 2px; }
  .tagline { font-size: 14.5px; margin-top: 16px; }
  .search-box { padding: 16px 92px 16px 22px; font-size: 16px; }
  .result-title { font-size: 18px; }
  .result.news { grid-template-columns: 1fr; }
  .result.news .news-thumb { width: 100%; height: 160px; }
  .shortcuts-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}