@import url('https://fonts.googleapis.com/css2?family=Wix+Madefor+Display:wght@400..800&family=Wix+Madefor+Text:ital,wght@0,400..800;1,400..800&display=swap');

::selection {
      background-color: rgba(255, 189, 22, 0.6);
    }

/* ── Theming ───────────────────────────────────────────────────────────────── */
:root {
  --heading-font: 'Wix Madefor Display', 'Metropolis', 'Noto Sans Simplified Chinese', 'Arimo', 'Geologica', 'Roboto', system-ui, Arial, sans-serif;
  --body-font: 'Wix Madefor Text', 'Metropolis', 'Noto Sans Simplified Chinese', 'Arimo', 'Geologica', 'Roboto', system-ui, Arial, sans-serif;
  --mono-font: 'JetBrains Mono', system-ui, Courier New, monospace;
  --text-color: #202124;
  --link-color: #1a0dab;
  --background-color: #f2f2f2;
  --card-background: #fff;
  --border-color: #dadce0;
  --snippet-color: #4d5156;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--body-font);
  margin: 0;
  padding: 0;
  background: var(--background-color);
  color: var(--text-color);
}

/* ── Header / Navigation ──────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 15px 40px;
  border-bottom: 1px solid var(--border-color);
  background: var(--card-background);
  transition: box-shadow 0.2s;
}
.header:hover,
.header:focus-within {
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.logo {
  order: 1;
  height: 36px;
  margin-right: 20px;
}

.tabs {
  order: 3;
  flex: 1 1 100%;
  margin-top: 10px;
}
.tabs a {
  margin-right: 16px;
  text-decoration: none;
  color: var(--link-color);
}
.tabs a.active {
  font-weight: bold;
}

.avatar,
.avatar-wrapper {
  order: 4;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-left: auto;
}
.avatar-wrapper {
  margin-top: -102px;
}

/* ── Search Bar / Autocomplete ────────────────────────────────────────────── */
.search-bar {
  order: 2;
  flex: 1 1 auto;
  min-width: 300px;
  display: flex;
  max-width: 700px;
  padding: 10px 15px;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  background: var(--card-background);
  position: relative;
}
.search-bar input {
  flex: 1;
  font-family: var(--body-font);
  font-size: 16px;
  border: none;
  outline: none;
  background: var(--card-background);
  color: var(--text-color);
}
.autocomplete-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--card-background);
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}
.search-bar:focus-within .autocomplete-list {
  display: block;
}
.autocomplete-list li {
  padding: 8px 12px;
  cursor: pointer;
}
.autocomplete-list li:hover {
  background: #f0f0f0;
}

/* ── Results Layout ───────────────────────────────────────────────────────── */
.results-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  margin: 20px 40px;
}
.results {
  flex: 2;
  max-width: 700px;
}

/* ── Images Grid ──────────────────────────────────────────────────────────── */
.images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.images img {
  width: 100%;
  border-radius: 4px;
}

/* ── Individual Result ────────────────────────────────────────────────────── */
.result {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 30px;
}
.result .link {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--text-color);
  text-decoration: none;
}
.result .link img {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 50%;
}
.result .title {
  font-size: 18px;
  font-weight: bold;
  color: var(--link-color);
  text-decoration: none;
}
.result .title:hover {
  text-decoration: underline;
}
.result .snippet {
  font-size: 14px;
  color: var(--snippet-color);
}

/* ── Pagination & Counts ──────────────────────────────────────────────────── */
.pagination {
  text-align: left;
  margin-top: 30px;
}
.pagination a {
  margin-right: 10px;
  font-size: 16px;
  color: var(--link-color);
  text-decoration: none;
}
.search-count {
  margin-top: 0;
}

/* ── WA / Calculator / Info Panels ────────────────────────────────────────── */
.wa-response {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.wa-response h3 {
  margin: 0 0 15px;
  font-size: 18px;
  color: var(--link-color);
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

/* ── Sidebar Info Card ────────────────────────────────────────────────────── */
.info-card {
  border-left: 1px solid var(--border-color);
  padding-left: 10px;
  margin: 12px 0;
}

/* ── Action Button & Hidden Footer ────────────────────────────────────────── */
#askBtn {
  font-family: var(--body-font);
  font-size: 20px;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background-color: #333;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}
#ai-ft {
  display: none;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  background: #f9f9f9;
  border-top: 1px solid var(--border-color);
  padding: 40px 60px;
  transition: box-shadow 0.2s;
}
.footer:hover,
.footer:focus-within {
  box-shadow: 0 -8px 16px rgba(0,0,0,0.2);
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.footer-col h4 {
  margin-bottom: 12px;
  font-size: 16px;
  color: var(--text-color);
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col ul li a {
  font-size: 14px;
  color: var(--link-color);
  text-decoration: none;
}
.footer-col ul li a:hover {
  text-decoration: underline;
}
.footer-col.about p {
  font-size: 14px;
  color: var(--snippet-color);
  line-height: 1.5;
  max-width: 300px;
}
.footer-col.subscribe form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.footer-col.subscribe input[type="email"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}
.footer-col.subscribe button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: var(--link-color);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.footer-col.subscribe button:hover {
  background: #0c0796;
}
.social-links {
  display: flex;
  gap: 12px;
}
.social-links a img {
  width: 24px;
  height: 24px;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #ddd;
  padding-top: 20px;
  font-size: 13px;
  color: #70757a;
}
.footer-bottom a {
  font-size: 13px;
  color: var(--link-color);
  text-decoration: none;
}
.footer-bottom a:hover {
  text-decoration: underline;
}

/* ── Utility & Misc ───────────────────────────────────────────────────────── */
.bluelink {
  color: var(--link-color);
}

/* ── Mixed-Results & FAQ Sections ─────────────────────────────────────────── */
.mixed-images-section,
.mixed-videos-section,
.mixed-news-section,
.faq-section {
  margin: 20px 0;
  padding: 15px 0;
  border-top: 1px solid var(--border-color);
}
.mixed-images-section h3,
.mixed-videos-section h3,
.mixed-news-section h3,
.faq-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-color);
}

/* Images */
.mixed-images-section img {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease;
}
.mixed-images-section img:hover {
  transform: scale(1.05);
}

/* Videos */
.mixed-videos-section img {
  width: 100%;
  transition: opacity 0.2s ease;
}
.mixed-videos-section a:hover img {
  opacity: 0.9;
}
.mixed-videos-section a:hover {
  text-decoration: underline;
}
.mixed-videos-section .video-title {
  color: var(--link-color);
  font-weight: bold;
}
.mixed-videos-section .video-creator,
.mixed-videos-section .video-age {
  color: var(--snippet-color);
}

/* News */
.news-result {
  background: var(--card-background);
  border-left: 3px solid var(--link-color);
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 15px;
  transition: background-color 0.2s ease;
}
.news-result:hover {
  background-color: rgba(0,0,0,0.02);
}
.news-result .news-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--link-color);
  margin-bottom: 5px;
}
.news-result .news-description {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-color);
  margin-bottom: 5px;
}
.news-result .news-meta {
  font-size: 12px;
  color: var(--snippet-color);
}

/* FAQ with source */
.faq-section details {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  margin-bottom: 10px;
  padding: 10px;
  transition: background-color 0.2s ease;
}
.faq-section details:hover {
  background-color: rgba(0,0,0,0.02);
}
.faq-section summary {
  font-weight: bold;
  cursor: pointer;
  color: var(--text-color);
  transition: color 0.2s ease;
}
.faq-section summary:hover {
  color: var(--link-color);
}
.faq-section details p {
  margin: 10px 0 0;
  line-height: 1.4;
  color: var(--text-color);
}
.faq-source {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
}
.faq-source a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--snippet-color);
  text-decoration: none;
  transition: color 0.2s ease;
}
.faq-source a:hover {
  color: var(--link-color);
}
.faq-source img {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── HTML Markup Styling ──────────────────────────────────────────────────── */
.snippet strong,
.snippet b,
.news-result .news-description strong,
.news-result .news-description b,
.faq-section p strong,
.faq-section p b {
  font-weight: 600;
  color: var(--text-color);
}
.snippet em,
.snippet i,
.news-result .news-description em,
.news-result .news-description i,
.faq-section p em,
.faq-section p i {
  font-style: italic;
}
.snippet u {
  text-decoration: underline;
}
.snippet mark,
.news-result .news-description mark,
.faq-section p mark {
  background-color: #ffeb3b;
  padding: 1px 2px;
  border-radius: 2px;
}

/* ── Infobox ──────────────────────────────────────────────────────────────── */
.infobox-section {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--link-color);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.infobox-section h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
}
.infobox-section p {
  margin: 0 0 15px;
  line-height: 1.5;
  color: var(--text-color);
}
.infobox-section a {
  color: var(--link-color);
  transition: opacity 0.2s ease;
}
.infobox-section a:hover {
  opacity: 0.8;
}
.infobox-section .attribute-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}
.infobox-section .attribute-key {
  font-size: 13px;
  font-weight: 600;
  color: var(--snippet-color);
  padding: 4px 0;
}
.infobox-section .attribute-value {
  font-size: 13px;
  color: var(--text-color);
  padding: 4px 0;
  word-break: break-word;
}
.infobox-section .profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Utility Overrides ───────────────────────────────────────────────────── */
.video-title:hover,
#news-result a:hover {
  text-decoration: underline !important;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mixed-images-section div,
  .mixed-videos-section div {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
  }
  .mixed-videos-section div {
    grid-template-columns: 1fr;
  }
  .mixed-images-section img,
  .mixed-videos-section img {
    height: 100px;
  }
  .tabs {
    order: 2;
    margin-top: 10px;
  }
  .search-bar {
    order: 1;
    margin-bottom: 10px;
  }
}

/* ── Dark-Mode Overrides ──────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #ddd;
    --link-color: #4e9af1;
    --background-color: #000;
    --card-background: #111;
    --border-color: #333;
    --snippet-color: #bbb;
  }

  .logoimg {
    filter: invert(1) brightness(2);
  }
  .logoimg.queye-logo {
    filter: none !important;
  }

  .tabs a.active {
    color: #fff;
  }

  .search-bar,
  .autocomplete-list,
  .wa-response,
  .info-card,
  .mixed-videos-section,
  .news-result,
  .faq-section details,
  .mixed-images-section img,
  .footer,
  .footer-col.subscribe input[type="email"],
  .footer-col.subscribe button {
    border-color: var(--border-color);
  }
  .footer,
  .footer-col.subscribe input[type="email"],
  .footer-col.subscribe button {
    background-color: var(--card-background);
  }

  .search-bar input {
    background-color: var(--card-background);
    color: #eee;
  }
  .search-bar input::placeholder {
    color: #888;
  }

  .autocomplete-list li:hover {
    background-color: var(--border-color);
  }

  .news-result:hover {
    background-color: rgba(255,255,255,0.05);
  }

  .faq-section details:hover {
    background-color: rgba(255,255,255,0.05);
  }
  .faq-source {
    border-top: 1px solid var(--border-color);
  }

  .snippet mark,
  .news-result .news-description mark,
  .faq-section p mark {
    background-color: #ffc107;
    color: #000;
  }

  .snippet strong,
  .snippet b,
  .news-result .news-description strong,
  .news-result .news-description b,
  .faq-section p strong,
  .faq-section p b {
    color: #fff;
  }

  .footer-col h4,
  .footer-col p,
  .footer-bottom p {
    color: var(--text-color);
  }
  .footer a,
  .footer-col ul li a,
  .footer-bottom a {
    color: var(--link-color);
  }
  .footer-col ul li a:hover,
  .footer-bottom a:hover {
    text-decoration: underline;
  }
}
