/* =========================================================================
   Orbo Search — static stylesheet (migrated from Next.js/Tailwind)
   Dark theme, gradient background, custom fonts, GCSE widget overrides.
   ========================================================================= */

/* ---- Design tokens (HSL channels, same as original CSS variables) ------- */
:root {
  --background: 240 10% 5%;
  --foreground: 0 0% 95%;
  --card: 240 10% 7%;
  --card-foreground: 0 0% 95%;
  --primary: 218 80% 56%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 5% 16%;
  --secondary-foreground: 0 0% 95%;
  --muted: 240 5% 16%;
  --muted-foreground: 240 5% 65%;
  --accent: 250 20% 45%;
  --border: 240 5% 16%;
  --ring: 218 80% 56%;
  --radius: 1rem;

  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-brand: "Gothic A1", "DM Sans", sans-serif;
}

/* ---- Reset --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid hsl(var(--border));
}
* {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
}

/* ---- Base ---------------------------------------------------------------- */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-weight: 400;
  color: hsl(var(--foreground));
  letter-spacing: 0.01em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: #0b0b0c;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, hsl(217 70% 22% / 0.55) 0%, transparent 60%),
    radial-gradient(ellipse 70% 60% at 100% 100%, hsl(250 45% 25% / 0.4) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 90%, hsl(200 60% 20% / 0.35) 0%, transparent 55%),
    linear-gradient(180deg, #0b0d14 0%, #0a0a0d 50%, #0b0b0f 100%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
p { line-height: 1.625; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

/* ---- Layout primitives --------------------------------------------------- */
.app {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
.app > main { flex: 1 1 auto; }

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* =========================================================================
   Navbar (legal/info pages)
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid hsl(var(--border) / 0.4);
  background: hsl(var(--background) / 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.15);
}
.site-header__inner {
  display: flex;
  align-items: center;
  height: 4rem;
}
@media (min-width: 768px) { .site-header__inner { height: 4.5rem; } }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.brand__logo { width: 36px; height: 36px; border-radius: 0.5rem; }
.brand__name {
  font-family: var(--font-brand);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #fff;
  font-size: 1.25rem;
}
@media (min-width: 768px) { .brand__name { font-size: 1.5rem; } }

/* =========================================================================
   Home page
   ========================================================================= */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: calc(6rem + env(safe-area-inset-top)) 1rem 4rem;
  text-align: center;
}
.home__inner {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
}
.home__logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 0.5rem;
  border-radius: 1.5rem;
}
.home__title {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 500;
  color: #fff;
  margin-top: 1.25rem;
}
.home__subtitle {
  font-size: 1.125rem;
  font-weight: 300;
  color: hsl(var(--muted-foreground));
  margin-top: 0.5rem;
}
.home__search { width: 100%; margin-top: 4rem; }
.home__trending { width: 100%; margin-top: 4rem; }

/* =========================================================================
   Search form (big — home / no-results)
   ========================================================================= */
.search {
  position: relative;
  width: 100%;
  transition: transform 0.5s;
}
.search__input {
  width: 100%;
  height: 4rem;
  padding: 1rem 1.5rem;
  border-radius: 9999px;
  background: hsl(var(--secondary) / 0.4);
  border: 2px solid hsl(var(--secondary) / 0.6);
  outline: none;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.2);
  transition: border-color 0.5s, box-shadow 0.5s, transform 0.5s;
}
.search__input::placeholder { color: hsl(var(--muted-foreground)); }
.search__input:focus {
  border-color: hsl(var(--primary) / 0.6);
  transform: scale(1.01);
}
.search__input:hover { box-shadow: 0 6px 25px -2px rgba(0, 0, 0, 0.2); }
.search__btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border-radius: 9999px;
  background: hsl(var(--primary));
  color: #fff;
  box-shadow: 0 2px 12px -2px hsl(218 80% 56% / 0.5);
  transition: background-color 0.3s;
}
.search__btn:hover { background: hsl(var(--primary) / 0.85); }
.search__btn svg { width: 1.5rem; height: 1.5rem; }

/* Compact search form (results header) */
.search--compact .search__input {
  height: 3rem;
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.15);
}
.search--compact .search__btn { right: 0.5rem; padding: 0.5rem; }
.search--compact .search__btn svg { width: 1.25rem; height: 1.25rem; }

/* =========================================================================
   Trending searches
   ========================================================================= */
.trending { display: flex; flex-direction: column; gap: 0.75rem; }
.trending__label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground) / 0.7);
  text-align: center;
}
.trending__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}
.trending__item {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground) / 0.8);
  text-underline-offset: 4px;
  transition: color 0.3s;
}
.trending__item:hover { color: hsl(var(--foreground)); text-decoration: underline; }

/* =========================================================================
   Results page header (sticky search bar)
   ========================================================================= */
.results-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--background) / 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border) / 0.4);
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.15);
}
.results-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}
@media (min-width: 768px) { .results-header__inner { gap: 1.5rem; } }
.results-header .brand { flex-shrink: 0; }
.results-header__logo { width: 32px; height: 32px; border-radius: 0.5rem; }
.results-header .brand__name { display: none; }
@media (min-width: 640px) { .results-header .brand__name { display: inline-block; font-size: 1.125rem; } }
@media (min-width: 768px) { .results-header .brand__name { font-size: 1.5rem; } }
.results-header .search { max-width: 42rem; }

.results-main { padding: 2rem 0; }
.results-meta { margin-bottom: 1.5rem; color: hsl(var(--muted-foreground)); }
.results-meta strong { font-weight: 500; color: hsl(var(--foreground)); }

/* =========================================================================
   Google CSE (gcse-searchresults-only) — restyle to match dark theme.
   Google injects markup + inline styles, so overrides need !important.
   Selectors below target the real generated DOM (.gsc-* / .gs-*).
   ========================================================================= */
.gsc-control-cse,
.gsc-control-cse * {
  font-family: var(--font-sans) !important;
  box-sizing: border-box;
}
.gsc-control-cse {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

/* Hide the duplicate search form the widget injects (we have our own) */
.gsc-search-box,
.gsc-search-box-tools { display: none !important; }

/* ---- Tabs (Web / Image) ---- */
.gsc-tabsArea {
  border: 0 !important;
  border-bottom: 1px solid hsl(var(--border) / 0.5) !important;
  margin: 0 0 1.25rem !important;
  background: transparent !important;
}
.gsc-tabHeader {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  color: hsl(var(--muted-foreground)) !important;
  padding: 0.6rem 1rem !important;
  margin: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s !important;
}
.gsc-tabHeader.gsc-tabhActive {
  color: hsl(var(--foreground)) !important;
  border-bottom-color: hsl(var(--primary)) !important;
  background: transparent !important;
}
.gsc-tabHeader.gsc-tabhInactive:hover { color: hsl(var(--foreground)) !important; }
.gs-spacer { display: none !important; }

/* ---- Top bar: result info + "Sort by" ---- */
.gsc-above-wrapper-area {
  border: 0 !important;
  padding: 0 !important;
  margin-bottom: 1rem !important;
}
.gsc-above-wrapper-area-container { width: 100% !important; }
.gsc-result-info {
  color: hsl(var(--muted-foreground)) !important;
  font-size: 0.875rem !important;
  padding: 0 !important;
}
.gsc-orderby-label,
.gsc-orderby-label.gsc-inline-block {
  color: hsl(var(--muted-foreground)) !important;
  font-size: 0.875rem !important;
}
.gsc-selected-option-container,
.gsc-selected-option-container.gsc-inline-block {
  background: hsl(var(--secondary) / 0.4) !important;
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 0.375rem !important;
  color: hsl(var(--foreground)) !important;
  min-width: 84px !important;
  padding: 3px 22px 3px 10px !important;
  position: relative !important;
}
/* The selected label text — Google renders it dark, invisible on dark bg */
.gsc-selected-option-container,
.gsc-selected-option-container *,
.gsc-option-selector,
.gsc-selected-option,
.gsc-option { color: hsl(var(--foreground)) !important; }
.gsc-option-menu {
  background: hsl(var(--card)) !important;
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4) !important;
}
.gsc-option-menu-item { background: transparent !important; }
.gsc-option-menu-item-highlighted { background: hsl(var(--secondary) / 0.5) !important; }

/* ---- Result row → left-accent on hover (matches design) ---- */
.gsc-webResult.gsc-result {
  border: 0 !important;
  border-left: 2px solid transparent !important;
  border-radius: 0.5rem !important;
  padding: 1rem !important;
  margin: 0 0 0.25rem !important;
  background: transparent !important;
  transition: background-color 0.3s, border-color 0.3s !important;
}
.gsc-webResult.gsc-result:hover {
  border-left-color: hsl(var(--primary) / 0.5) !important;
  background: hsl(var(--secondary) / 0.2) !important;
}
.gs-webResult.gs-result,
.gsc-table-result,
.gsc-thumbnail-inside,
.gsc-url-top { padding: 0 !important; background: transparent !important; }
.gsc-webResult-divider {
  border-top: 1px solid hsl(var(--border) / 0.3) !important;
  margin: 0 !important;
}

/* ---- Title ---- */
.gs-title,
.gsc-result .gs-title,
a.gs-title,
.gs-title b {
  color: hsl(var(--primary)) !important;
  font-size: 1.25rem !important;
  font-weight: 500 !important;
  height: auto !important;
  line-height: 1.35 !important;
  text-decoration: none !important;
}
a.gs-title:hover,
a.gs-title:hover b {
  color: hsl(var(--primary)) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

/* ---- Visible URL ---- */
.gsc-url-top,
.gsc-url-bottom,
.gs-visibleUrl,
.gs-visibleUrl-long,
.gs-visibleUrl-short,
.gs-visibleUrl-breadcrumb,
.gs-visibleUrl-breadcrumb span {
  color: hsl(var(--muted-foreground)) !important;
  font-size: 0.875rem !important;
}
.gs-visibleUrl-long { display: none !important; }
.gsc-url-bottom { display: none !important; }

/* ---- Snippet / description ---- */
.gs-snippet,
.gsc-table-cell-snippet-close .gs-snippet,
.gs-bidi-start-align.gs-snippet {
  color: hsl(var(--muted-foreground)) !important;
  font-size: 1rem !important;
  line-height: 1.625 !important;
}
.gs-snippet b,
.gs-visibleUrl b,
.gs-title b { color: inherit !important; font-weight: 500 !important; }

/* ---- Thumbnails (kill the white boxes; round + frame) ---- */
.gsc-table-cell-thumbnail,
.gsc-thumbnail,
.gsc-thumbnail-left { padding: 0 0 0 1rem !important; }
.gs-image-box,
.gs-web-image-box,
.gs-web-image-box-landscape,
.gs-web-image-box-portrait {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
img.gs-image,
.gs-image-box img {
  border: 1px solid hsl(var(--border) / 0.6) !important;
  border-radius: 0.5rem !important;
  background: hsl(var(--secondary) / 0.4) !important;
  object-fit: cover !important;
  max-width: 110px !important;
  width: 110px !important;
  height: 82px !important;
}
.gs-web-image-box-portrait img.gs-image { height: 110px !important; }

/* ---- Pagination ---- */
.gsc-cursor-box { margin: 1.5rem 0 !important; background: transparent !important; }
.gsc-cursor-page {
  color: hsl(var(--primary)) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0.375rem !important;
  padding: 0.3rem 0.7rem !important;
  margin: 0 0.15rem !important;
  text-shadow: none !important;
}
.gsc-cursor-page:hover { background: hsl(var(--secondary) / 0.4) !important; text-decoration: none !important; }
.gsc-cursor-page.gsc-cursor-current-page {
  background: hsl(var(--primary) / 0.15) !important;
  color: hsl(var(--foreground)) !important;
}

/* ---- "Search on Google" + branding footer ---- */
.gcsc-find-more-on-google,
.gcsc-find-more-on-google-text,
.gcsc-find-more-on-google-query { color: hsl(var(--primary)) !important; }
.gcsc-find-more-on-google-magnifier { fill: hsl(var(--primary)) !important; }
.gcsc-more-maybe-branding-root { margin-top: 0.5rem !important; }
.gcsc-branding { opacity: 0.55 !important; margin-top: 0.75rem !important; }

/* ---- "No results" message from Google ---- */
.gs-no-results-result .gs-snippet,
.gsc-no-results-result .gs-snippet {
  color: hsl(var(--muted-foreground)) !important;
  background: hsl(var(--card)) !important;
  border: 1px solid hsl(var(--border) / 0.5) !important;
  border-radius: 0.75rem !important;
  padding: 1.25rem !important;
}

/* =========================================================================
   No-results page (custom)
   ========================================================================= */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: calc(6rem + env(safe-area-inset-top)) 1rem 4rem;
  text-align: center;
}
.empty__inner { width: 100%; max-width: 36rem; margin: 0 auto; }
.empty__logo { width: 88px; height: 88px; margin: 0 auto 1.5rem; border-radius: 1.25rem; }
.empty__title {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 500;
  color: #fff;
}
.empty__text {
  font-size: 1.05rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.75rem;
}
.empty__text strong { color: hsl(var(--foreground)); font-weight: 500; }
.empty__search { width: 100%; margin-top: 2.5rem; }

/* =========================================================================
   Legal / info pages
   ========================================================================= */
.page { padding: 3rem 0; }
.page__inner { max-width: 48rem; margin: 0 auto; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: background-color 0.3s;
}
.back-link:hover { background: hsl(var(--secondary) / 0.3); }
.back-link svg { width: 1rem; height: 1rem; transition: transform 0.2s; }
.back-link:hover svg { transform: translateX(-4px); }

.page h1 { font-size: 2.25rem; font-weight: 700; margin-bottom: 1.5rem; }
.page h2 { font-size: 1.5rem; font-weight: 600; }
.page h3 { font-size: 1.25rem; font-weight: 500; }

.prose { display: flex; flex-direction: column; gap: 2rem; font-size: 1.05rem; }
.prose > p:first-of-type { font-size: 1.125rem; color: hsl(var(--muted-foreground)); }
.prose section { display: flex; flex-direction: column; gap: 1rem; }
.prose .updated { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.prose ul {
  list-style: disc;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.prose ul li { margin-left: 0; }
.prose .lead-strong { font-weight: 500; }
.prose .accent { color: hsl(var(--primary)); }

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
}
.card h3 { margin-bottom: 1rem; font-size: 1.25rem; font-weight: 600; }
.card p { margin-bottom: 1rem; }
.card p:last-child { margin-bottom: 0; }
.card .muted { color: hsl(var(--muted-foreground)); }

/* Contact form */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form__row { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) { .form__row { grid-template-columns: 1fr 1fr; } }
.form label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }
.form input,
.form textarea {
  width: 100%;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  background: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border));
  outline: none;
  transition: border-color 0.2s;
}
.form input:focus,
.form textarea:focus { border-color: hsl(var(--primary)); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.625rem 1.25rem;
  font-weight: 500;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transition: background-color 0.3s;
}
.btn:hover { background: hsl(var(--primary) / 0.85); }
.btn:disabled { opacity: 0.6; cursor: default; }

/* Contact form submit status message */
.form-message {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}
.form-message--success {
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--foreground));
  border-color: hsl(var(--primary) / 0.4);
}
.form-message--error {
  background: hsl(0 60% 40% / 0.15);
  color: hsl(0 0% 92%);
  border-color: hsl(0 60% 50% / 0.5);
}

/* =========================================================================
   Footer (global)
   ========================================================================= */
.site-footer {
  border-top: 1px solid hsl(var(--border) / 0.4);
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(12px);
}
.site-footer__inner { padding: 2rem 0; }
.site-footer__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .site-footer__links { flex-direction: row; gap: 2.5rem; }
}
.footer-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: color 0.3s;
}
.footer-link:hover { color: hsl(var(--primary) / 0.9); }
.site-footer__copy {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.gcsc-more-maybe-branding-root {
  display: none !important;
}
