/* ============================================================
   INsearch — Professional White & Grey Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:             #ffffff;
  --surface:        #f9fafb;
  --surface-2:      #f3f4f6;
  --border:         #e5e7eb;
  --border-strong:  #d1d5db;
  --accent:         #111827;
  --accent-hover:   #374151;
  --accent-light:   #f3f4f6;
  --text:           #111827;
  --text-2:         #374151;
  --muted:          #9ca3af;
  --muted-2:        #6b7280;
  --link:           #2563eb;
  --link-hover:     #1d4ed8;
  --link-visited:   #7c3aed;
  --mark-bg:        #fef9c3;
  --mark-text:      #713f12;
  --green:          #16a34a;
  --radius:         8px;
  --radius-sm:      5px;
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.06);
  --shadow:         0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:      0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.05);
  --font:           'Inter', system-ui, sans-serif;
  --mono:           'JetBrains Mono', 'Courier New', monospace;
}

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

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

a { color: inherit; text-decoration: none; }

mark {
  background: var(--mark-bg);
  color: var(--mark-text);
  border-radius: 2px;
  padding: 0 2px;
  font-style: normal;
}

/* ── HOME PAGE ─────────────────────────────────────────────── */

.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.home-main {
  width: 600px;
  max-width: 92vw;
}

.home-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.8rem;
}

.logo-img    { height: 90px; width: auto; display: block; }
.logo-img-sm { height: 30px; width: auto; display: block; }

.home-tagline {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 500;
  color: #9CA3AF;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  width: 100%;
  user-select: none;
}

.home-stats {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.02em;
  width: 100%;
}

.home-footer {
  position: fixed;
  bottom: 1.5rem;
  font-size: 0.73rem;
  color: var(--muted);
  text-align: center;
}

/* ── SEARCH BOX ─────────────────────────────────────────────── */

.search-form { position: relative; width: 100%; }
.search-form-inline { position: relative; flex: 1; max-width: 580px; }

.search-box-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: 50px;
  padding: 0 6px 0 1.2rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}

.search-box-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

.search-icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
  flex-shrink: 0;
  margin-right: 10px;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.97rem;
  padding: 0.8rem 0;
}

.search-input::placeholder { color: var(--muted); }

.search-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.52rem 1.25rem;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.search-btn:hover  { background: var(--accent-hover); }
.search-btn:active { opacity: 0.85; }

/* ── AUTOCOMPLETE ───────────────────────────────────────────── */

.suggestions-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 100;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.suggestions-box.hidden { display: none; }

.suggestion-item {
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-2);
  transition: background 0.1s;
}

.suggestion-item:hover,
.suggestion-item.active { background: var(--surface); }

.suggestion-domain {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
}

/* ── RESULTS HEADER ─────────────────────────────────────────── */

.results-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.85rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.logo-small {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.logo-small .logo-dot   { width: 9px; height: 9px; border-radius: 2px; }
.logo-small .logo-text  { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.5px; }

/* SVG logos */
.logo-img    { height: 90px; width: auto; display: block; }
.logo-img-sm { height: 30px; width: auto; display: block; }

/* ── SEARCH TABS ────────────────────────────────────────────── */

.search-tabs {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 57px;
  z-index: 40;
}

.search-tabs-inner {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 1060px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.search-tabs-inner::-webkit-scrollbar { display: none; }

.search-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted-2);
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}

.search-tab:hover { color: var(--text); }

.search-tab.active {
  color: #E8600A;
  border-bottom-color: #E8600A;
  font-weight: 600;
}

/* ── RESULTS LAYOUT ─────────────────────────────────────────── */

.results-layout {
  display: flex;
  max-width: 1060px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  gap: 3rem;
}

/* ── FILTERS ────────────────────────────────────────────────── */

.filters-panel { width: 190px; flex-shrink: 0; }

.filters-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1.1rem;
  font-weight: 600;
}

.filter-group { margin-bottom: 1.4rem; }

.filter-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted-2);
  margin-bottom: 0.45rem;
  font-weight: 500;
}

.filter-options { display: flex; flex-direction: column; gap: 0.3rem; }

.filter-chip {
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted-2);
  transition: all 0.12s;
  display: inline-block;
  background: var(--bg);
}

.filter-chip:hover  { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); font-weight: 500; }

.filter-domain-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--text-2);
  padding: 0.38rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.remove-filter { color: var(--muted); cursor: pointer; font-style: normal; }
.remove-filter:hover { color: var(--text); }

.cache-badge {
  margin-top: 1.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-family: var(--mono);
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}

.cache-badge.hit {
  color: var(--green);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

/* ── RESULTS ────────────────────────────────────────────────── */

.results-main { flex: 1; min-width: 0; }

.did-you-mean {
  font-size: 1rem;
  color: #4d5156;
  margin-bottom: 1.1rem;
  line-height: 1.7;
}
.dym-label {
  color: #4d5156;
  margin-right: 4px;
}
.dym-suggestion {
  color: #1a0dab;
  font-style: italic;
  text-decoration: none;
  font-weight: 500;
}
.dym-suggestion:hover { text-decoration: underline; }
.dym-suggestion em {
  font-style: normal;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-style: dotted;
}
.dym-original {
  color: #4d5156;
  text-decoration: underline;
  text-decoration-style: dotted;
  font-style: italic;
  font-size: 0.95rem;
}
.dym-original:hover { color: #1a0dab; }
.dym-autocorrect { margin-bottom: 1.4rem; }

.results-meta {
  font-size: 0.8rem;
  color: var(--muted-2);
  margin-bottom: 1.5rem;
}

.took-ms { margin-left: 0.4rem; color: var(--muted); }

.results-list { list-style: none; display: flex; flex-direction: column; gap: 0; }

.result-item {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--border);
}

.result-item:first-child { padding-top: 0; }

.result-domain {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.domain-favicon { font-size: 0.82rem; }
.domain-favicon-img {
  width: 16px; height: 16px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.domain-link {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--green);
  letter-spacing: 0.01em;
}

.domain-link:hover { text-decoration: underline; }

.result-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

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

.result-url {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 0.45rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-snippet {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-2);
}

.result-date {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--mono);
}

/* ── IMAGE GRID ─────────────────────────────────────────────── */

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
  margin-top: 0.5rem;
}

.image-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
  text-decoration: none;
}

.image-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.image-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.image-card:hover .image-thumb img { transform: scale(1.04); }

.image-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.45rem 0.6rem 0.2rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-domain {
  font-size: 0.68rem;
  color: var(--green);
  font-family: var(--mono);
  padding: 0 0.6rem 0.45rem;
}

.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--surface-2);
  color: var(--text-3);
}

/* ── VIDEO GRID ─────────────────────────────────────────────── */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 0.5rem;
}

.video-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  display: block;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.video-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.video-card:hover .video-thumb img { transform: scale(1.04); }

.video-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  background: #1a1a2e;
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.65);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  pointer-events: none;
  transition: background 0.15s, transform 0.15s;
  padding-left: 3px;
}

.video-card:hover .video-play-btn {
  background: #E8600A;
  transform: translate(-50%, -50%) scale(1.1);
}

.video-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.5rem 0.65rem 0.2rem;
  line-height: 1.4;
}

.video-domain {
  font-size: 0.68rem;
  color: var(--green);
  font-family: var(--mono);
  padding: 0 0.65rem 0.5rem;
}

/* ── PAGINATION ─────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.page-btn {
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--muted-2);
  transition: all 0.12s;
  background: var(--bg);
}

.page-btn:hover  { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.page-btn.current { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

/* ── NO RESULTS ─────────────────────────────────────────────── */

.no-results {
  margin-top: 4rem;
  text-align: center;
  color: var(--muted-2);
}

.no-results strong   { color: var(--text); }
.no-results-hint     { margin-top: 0.5rem; font-size: 0.84rem; color: var(--muted); }

.error-msg {
  padding: 1rem 1.2rem;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  color: #dc2626;
  font-size: 0.875rem;
  background: #fef2f2;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */

@media (max-width: 720px) {
  .results-layout        { flex-direction: column; padding: 1rem; gap: 1.5rem; }
  .filters-panel         { width: 100%; }
  .filter-options        { flex-direction: row; flex-wrap: wrap; }
  .results-header        { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 0.85rem 1rem; }
  .search-form-inline    { max-width: 100%; }
}

/* ── TOP STORIES PANEL ──────────────────────────────────────── */
.top-stories-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 0 8px;
  margin-bottom: 20px;
  overflow: hidden;
}
.top-stories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.top-stories-header svg { color: #9ca3af; cursor: pointer; }
.top-stories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 16px 4px;
  scrollbar-width: none;
}
.top-stories-scroll::-webkit-scrollbar { display: none; }
.story-card {
  flex: 0 0 200px;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fafafa;
  transition: box-shadow 0.15s;
}
.story-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.10); }
.story-img-wrap {
  position: relative;
  height: 110px;
  background: #e5e7eb;
  overflow: hidden;
}
.story-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.story-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #9ca3af;
}
.story-live-badge {
  position: absolute;
  top: 7px; left: 7px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.story-body {
  padding: 9px 10px 8px;
}
.story-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 8px;
}
.story-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #6b7280;
}
.story-favicon {
  width: 14px; height: 14px;
  border-radius: 2px;
  object-fit: contain;
  flex-shrink: 0;
}
.story-source { font-weight: 500; color: #374151; }
.story-time::before { content: '·'; margin-right: 4px; }
.more-news-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent, #1A1A2E);
  text-decoration: none;
  border-top: 1px solid #f3f4f6;
  margin-top: 8px;
}
.more-news-link:hover { color: #0ea5e9; }
.more-news-link span { font-size: 1rem; }

/* ── ACTION BUTTONS ── */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.action-job {
  background: #ecfdf5;
  color: #065f46;
  border-color: #6ee7b7;
}
.action-job:hover { background: #d1fae5; color: #065f46; }

.action-book {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.action-book:hover { background: #dbeafe; color: #1d4ed8; }

.action-buy {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}
.action-buy:hover { background: #ffedd5; color: #c2410c; }

.action-register {
  background: #faf5ff;
  color: #6d28d9;
  border-color: #c4b5fd;
}
.action-register:hover { background: #ede9fe; color: #6d28d9; }

.action-contact {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}
.action-contact:hover { background: #dcfce7; color: #166534; }

.action-government {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fda4af;
}
.action-government:hover { background: #ffe4e6; color: #9f1239; }
