/* ============================================
   VYNTR SEARCH ENGINE — STYLES.CSS
   Warm amber light mode / Cool dark blue mode
   Font: Sora (UI) + Crimson Pro (display)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Colors — Light */
  --bg: hsl(48, 40%, 97%);
  --bg-card: hsl(46, 35%, 94%);
  --bg-card-hover: hsl(46, 40%, 91%);
  --bg-input: hsl(50, 50%, 99%);
  --border: hsl(40, 25%, 82%);
  --border-focus: hsl(28, 70%, 55%);
  --text: hsl(30, 15%, 15%);
  --text-muted: hsl(30, 8%, 48%);
  --text-light: hsl(30, 6%, 65%);
  --accent: hsl(28, 80%, 50%);
  --accent-bg: hsl(32, 100%, 95%);
  --accent-text: hsl(25, 80%, 35%);
  --link: hsl(220, 70%, 48%);
  --link-visited: hsl(270, 50%, 45%);
  --success: hsl(142, 60%, 38%);
  --error: hsl(4, 72%, 52%);
  --shadow-sm: 0 1px 3px hsla(30, 20%, 20%, 0.08);
  --shadow-md: 0 4px 16px hsla(30, 20%, 20%, 0.1);
  --shadow-lg: 0 8px 32px hsla(30, 20%, 20%, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Layout */
  --header-h: 60px;
  --results-max: 680px;
  --panel-w: 480px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dark {
  --bg: hsl(230, 15%, 10%);
  --bg-card: hsl(228, 14%, 14%);
  --bg-card-hover: hsl(228, 14%, 18%);
  --bg-input: hsl(228, 16%, 12%);
  --border: hsl(225, 12%, 24%);
  --border-focus: hsl(45, 85%, 60%);
  --text: hsl(215, 20%, 92%);
  --text-muted: hsl(215, 10%, 58%);
  --text-light: hsl(215, 8%, 42%);
  --accent: hsl(45, 85%, 60%);
  --accent-bg: hsl(42, 40%, 16%);
  --accent-text: hsl(48, 100%, 75%);
  --link: hsl(215, 80%, 68%);
  --link-visited: hsl(270, 70%, 72%);
  --success: hsl(142, 60%, 52%);
  --error: hsl(4, 75%, 64%);
  --shadow-sm: 0 1px 3px hsla(220, 30%, 5%, 0.3);
  --shadow-md: 0 4px 16px hsla(220, 30%, 5%, 0.4);
  --shadow-lg: 0 8px 32px hsla(220, 30%, 5%, 0.55);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Sora', 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea { font-family: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ---- Background Orb ---- */
.bg-orb {
  position: fixed;
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 80vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg at 50% 50%,
    var(--accent) 0deg,
    hsl(50, 90%, 75%) 80deg,
    hsl(200, 80%, 70%) 200deg,
    hsl(280, 60%, 70%) 300deg,
    var(--accent) 360deg
  );
  opacity: 0.06;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orbPulse 8s ease-in-out infinite alternate;
}
.dark .bg-orb { opacity: 0.08; }
.results-orb { top: -40vh; opacity: 0.04; }

@keyframes orbPulse {
  from { transform: translateX(-50%) scale(1); }
  to   { transform: translateX(-50%) scale(1.08); }
}

/* ---- Top Navigation (Home) ---- */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  background: hsla(var(--bg-h, 48), 40%, 97%, 0);
  backdrop-filter: blur(0px);
  transition: background 0.3s, backdrop-filter 0.3s;
}
.dark .top-nav { background: hsla(230, 15%, 10%, 0); }

.nav-logo .logo-text {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: -0.03em;
}

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.nav-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
}
.nav-btn:hover { background: var(--bg-card-hover); color: var(--text); transform: translateY(-1px); }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.theme-toggle:hover { background: var(--bg-card-hover); color: var(--text); transform: scale(1.05); }

.icon-sun { display: block; }
.icon-moon { display: none; }
.dark .icon-sun { display: none; }
.dark .icon-moon { display: block; }

/* ---- Hero / Home ---- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 2rem) 2rem 2rem;
  gap: 3rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 640px;
  animation: heroEnter 0.7s var(--ease-out) both;
}

@keyframes heroEnter {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-logo {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  user-select: none;
}
.logo-v {
  color: var(--accent);
  display: inline-block;
  animation: logoV 0.8s var(--ease-spring) both;
  animation-delay: 0.1s;
}
.logo-rest {
  color: var(--text);
  display: inline-block;
  animation: logoRest 0.8s var(--ease-spring) both;
  animation-delay: 0.15s;
}
@keyframes logoV    { from { opacity: 0; transform: scale(0.5) rotate(-8deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes logoRest { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }

.hero-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: heroEnter 0.7s var(--ease-out) both;
  animation-delay: 0.2s;
}

/* ---- Search Bar ---- */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  animation: heroEnter 0.7s var(--ease-out) both;
  animation-delay: 0.25s;
}
.inline-search { max-width: 520px; flex: 1; animation: none; }

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
  box-shadow: var(--shadow-sm);
}
.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px hsla(28, 80%, 50%, 0.15), var(--shadow-md);
}
.dark .search-box:focus-within {
  box-shadow: 0 0 0 3px hsla(45, 85%, 60%, 0.2), var(--shadow-md);
}

.search-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.2s;
}
.search-box:focus-within .search-icon { color: var(--accent); }

.search-input {
  flex: 1;
  height: 50px;
  background: none;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  min-width: 0;
}
.inline-search .search-input { height: 42px; font-size: 0.9rem; }
.search-input::placeholder { color: var(--text-light); }

.search-actions { display: flex; align-items: center; gap: 0.25rem; }

.search-clear {
  width: 26px; height: 26px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}
.search-clear:hover { background: var(--bg-card); color: var(--text); }

.search-submit {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: white;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.inline-search .search-submit { width: 30px; height: 30px; }
.search-submit:hover { transform: scale(1.08); filter: brightness(1.1); }
.search-submit:active { transform: scale(0.95); }

/* Autocomplete */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 50;
  animation: dropdownEnter 0.15s var(--ease-out);
}
@keyframes dropdownEnter {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 0.9rem;
  color: var(--text);
}
.autocomplete-item:hover, .autocomplete-item.active { background: var(--bg-card); }
.autocomplete-item svg { color: var(--text-muted); flex-shrink: 0; }
.autocomplete-item .ac-query { flex: 1; }
.autocomplete-item .ac-query em { font-style: normal; font-weight: 600; color: var(--accent); }
.autocomplete-item .ac-type {
  font-size: 0.72rem;
  color: var(--text-light);
  padding: 0.1rem 0.4rem;
  background: var(--bg-card);
  border-radius: var(--radius-full);
}

/* Search options */
.search-options {
  display: flex;
  gap: 0.4rem;
  animation: heroEnter 0.7s var(--ease-out) both;
  animation-delay: 0.3s;
}
.option-btn {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.18s var(--ease);
  background: transparent;
}
.option-btn:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-focus); }
.option-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ---- Discovery Section ---- */
.discovery-section {
  display: flex;
  gap: 3rem;
  width: 100%;
  max-width: 600px;
  animation: heroEnter 0.7s var(--ease-out) both;
  animation-delay: 0.35s;
}
.discovery-col { flex: 1; }
.discovery-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}
.discovery-list { display: flex; flex-direction: column; gap: 0.25rem; }
.discovery-list li a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.discovery-list li a:hover {
  background: var(--bg-card);
  color: var(--text);
  transform: translateX(3px);
}

/* ---- Footer ---- */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-light);
  z-index: 50;
}
.site-footer a { transition: color 0.15s; }
.site-footer a:hover { color: var(--text-muted); }

/* ============================================
   RESULTS PAGE
   ============================================ */

body.results-page {
  overflow: hidden;
  height: 100vh;
}

/* Results header */
.results-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(12px);
  background: hsla(var(--bg), 0.9);
}
.dark .results-header { background: hsla(230, 15%, 10%, 0.92); }

.results-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
}

.header-logo {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  color: var(--text);
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-left: auto;
}

.filter-tabs {
  display: flex;
  gap: 0.2rem;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  padding: 3px;
}
.filter-tab {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.18s var(--ease);
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active {
  background: var(--bg-input);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Results layout */
.results-layout {
  display: flex;
  height: 100vh;
  padding-top: var(--header-h);
  overflow: hidden;
}

/* Results main column */
.results-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 1.5rem 2rem 4rem;
  max-width: calc(var(--results-max) + 4rem);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.results-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.results-sort { display: flex; align-items: center; gap: 0.4rem; }
.sort-btn {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all 0.15s;
}
.sort-btn:hover { color: var(--text); background: var(--bg-card); }
.sort-btn.active { color: var(--accent); font-weight: 600; }

/* Skeleton loading */
.results-loading { display: flex; flex-direction: column; gap: 1.5rem; }
.skeleton-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  height: 110px;
  animation: shimmer 1.4s ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
  position: relative;
  overflow: hidden;
}
.skeleton-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, hsla(45, 50%, 95%, 0.08), transparent);
  transform: translateX(-100%);
  animation: shimmerSlide 1.4s ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
}
.dark .skeleton-item::after {
  background: linear-gradient(90deg, transparent, hsla(215, 20%, 92%, 0.05), transparent);
}
@keyframes shimmerSlide {
  to { transform: translateX(100%); }
}

/* Results list */
.results-list { display: flex; flex-direction: column; gap: 0.25rem; }

.result-item {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  position: relative;
  animation: resultEnter 0.4s var(--ease-out) both;
  animation-delay: calc(var(--index, 0) * 50ms);
}
@keyframes resultEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-item:hover {
  background: var(--bg-card);
  border-color: var(--border);
}
.result-item.active {
  background: var(--accent-bg);
  border-color: var(--border-focus);
}

.result-source {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.result-favicon {
  width: 16px; height: 16px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}
.result-favicon-placeholder {
  width: 16px; height: 16px;
  border-radius: 3px;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.result-domain {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-url {
  font-size: 0.72rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.result-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--link);
  margin-bottom: 0.3rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}
.result-item:hover .result-title { color: var(--accent); }
.result-item.active .result-title { color: var(--accent-text); }

.result-snippet {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-snippet em { font-style: normal; font-weight: 600; color: var(--text); }

.result-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.result-date {
  font-size: 0.72rem;
  color: var(--text-light);
}
.result-preview-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-light);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  transition: all 0.15s;
}
.result-preview-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-muted);
}
.result-item.active .result-preview-btn { color: var(--accent-text); }

.result-score-badge {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--text-light);
  background: var(--bg-card);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

/* No results */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.no-results-icon { color: var(--border); }
.no-results h2 { font-size: 1.1rem; color: var(--text); }
.no-results p { font-size: 0.85rem; }
.no-results a { color: var(--accent); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.page-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-card);
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { background: var(--bg-card-hover); color: var(--text); border-color: var(--border-focus); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-numbers { display: flex; gap: 0.25rem; }
.page-num {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all 0.15s;
}
.page-num:hover { background: var(--bg-card); border-color: var(--border); }
.page-num.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ============================================
   BROWSER PANEL
   ============================================ */

.browser-panel {
  width: var(--panel-w);
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  transition: width 0.3s var(--ease), opacity 0.3s;
  overflow: hidden;
}
.browser-panel.collapsed {
  width: 0;
  border-left-color: transparent;
}

/* Panel toggle button */
.panel-toggle {
  position: absolute;
  top: 50%;
  left: -14px;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  z-index: 10;
}
.panel-toggle:hover { background: var(--bg-card-hover); color: var(--text); transform: translateY(-50%) scale(1.08); }
.browser-panel.collapsed .panel-toggle { left: -14px; }
.browser-panel.collapsed .panel-toggle svg { transform: rotate(180deg); }

/* Browser chrome tabs */
.browser-chrome {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 0.5rem;
  min-height: 38px;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 2px;
}
.browser-chrome::-webkit-scrollbar { display: none; }

.browser-tabs { display: flex; gap: 2px; flex: 1; min-width: 0; }

.browser-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  max-width: 160px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s;
  flex-shrink: 0;
}
.browser-tab:hover { background: var(--bg-card-hover); color: var(--text); }
.browser-tab.active {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.browser-tab .tab-favicon {
  width: 14px; height: 14px; border-radius: 2px; flex-shrink: 0;
}
.browser-tab .tab-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.browser-tab .tab-close {
  width: 16px; height: 16px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.browser-tab:hover .tab-close,
.browser-tab.active .tab-close { opacity: 1; }
.browser-tab .tab-close:hover { background: var(--border); color: var(--text); }

.new-tab-btn {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.15s;
}
.new-tab-btn:hover { background: var(--bg-card-hover); color: var(--text); }

/* Address bar */
.browser-addressbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.browser-nav-btns { display: flex; gap: 0.2rem; }
.browser-nav-btn {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}
.browser-nav-btn:hover:not(:disabled) { background: var(--bg-card); color: var(--text); }
.browser-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.address-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.6rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.address-bar-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px hsla(28, 80%, 50%, 0.12);
}
.secure-icon { color: var(--success); display: flex; flex-shrink: 0; }
.address-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.78rem;
  color: var(--text);
  min-width: 0;
}
.address-input::placeholder { color: var(--text-light); }
.address-go-btn {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  transition: all 0.15s;
}
.address-go-btn:hover { background: var(--bg-card-hover); color: var(--text); }

.browser-open-btn {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}
.browser-open-btn:hover { background: var(--bg-card); color: var(--text); }

/* Browser viewport */
.browser-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
}

.browser-empty {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2rem;
}
.browser-empty-icon { color: var(--border); }
.browser-empty p { font-size: 0.9rem; color: var(--text-muted); }
.browser-empty span { font-size: 0.78rem; color: var(--text-light); }

/* Progress bar loading */
.browser-loading {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg-card);
  z-index: 5;
}
.browser-loader { width: 200px; }
.loader-track {
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s var(--ease);
  animation: loadProgress 2s var(--ease) forwards;
}
@keyframes loadProgress {
  0%   { width: 0%; }
  30%  { width: 40%; }
  70%  { width: 70%; }
  90%  { width: 90%; }
  100% { width: 95%; }
}
.loading-url { font-size: 0.72rem; color: var(--text-light); max-width: 240px; text-align: center; word-break: break-all; }

.browser-content {
  position: absolute; inset: 0;
}
.browser-content iframe {
  width: 100%; height: 100%;
  border: none;
  background: white;
}

.browser-error {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}
.browser-error svg { color: var(--error); }
.browser-error h3 { font-size: 1rem; color: var(--text); }
.browser-error p { font-size: 0.82rem; }
.retry-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: white;
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 0.5rem;
  transition: all 0.2s;
}
.retry-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ============================================
   TOGGLE SWITCH (for auto-index)
   ============================================ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.2s;
  border-radius: 34px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background-color: var(--accent);
}
input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* ============================================
   MODAL (used for settings & crawl)
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: hsla(220, 20%, 5%, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: modalEnter 0.25s var(--ease-spring);
  margin: 1rem;
}
@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 0.95rem; font-weight: 600; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}
.modal-close:hover { background: var(--bg-card); color: var(--text); }
.modal-body { padding: 1.25rem; }
.modal-body p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.modal-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.modal-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px hsla(28, 80%, 50%, 0.12);
}
.modal-footer {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  padding: 0.75rem 1.25rem 1.1rem;
}
.modal-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex; align-items: center; gap: 0.4rem;
  transition: all 0.18s;
}
.modal-btn.secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.modal-btn.secondary:hover { background: var(--bg-card-hover); color: var(--text); }
.modal-btn.primary {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
}
.modal-btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.82rem;
  color: var(--text);
  min-width: 220px;
  max-width: 340px;
  animation: toastIn 0.3s var(--ease-spring);
}
.toast.removing { animation: toastOut 0.25s var(--ease) forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

.toast-icon { flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon   { color: var(--error); }
.toast.info .toast-icon    { color: var(--link); }

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden { display: none !important; }
.spinning { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .browser-panel {
    position: fixed;
    right: 0; top: var(--header-h); bottom: 0;
    z-index: 80;
    box-shadow: var(--shadow-lg);
    transform: translateX(0);
    transition: transform 0.3s var(--ease), width 0.3s var(--ease);
  }
  .browser-panel.collapsed {
    transform: translateX(100%);
    width: var(--panel-w);
  }
  .panel-toggle {
    left: -36px;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  }
  .results-main { max-width: 100%; padding: 1rem 1rem 4rem; }
}

@media (max-width: 600px) {
  :root { --panel-w: 100vw; }
  .filter-tabs { display: none; }
  .results-header-inner { gap: 0.5rem; }
  .header-logo { font-size: 1.2rem; }
  .discovery-section { gap: 1.5rem; }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.results-main::-webkit-scrollbar { width: 5px; }
.results-main::-webkit-scrollbar-track { background: transparent; }
.results-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
.results-main::-webkit-scrollbar-thumb:hover { background: var(--text-light); }