.trending-card:hover .topic-tag {
  background: linear-gradient(90deg, #ede9fe 0%, #f3f4f6 100%);
  color: var(--accent-2);
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(124,58,237,0.10);
  border-radius: 8px;
  padding: 2px 10px;
  transition: background 0.2s, color 0.2s, text-shadow 0.2s;
}

#searchbar-popup-wrapper {
  width: 100%;
  display: block;
  position: relative;
  z-index: 10;
}
#searchbar-results-popup.searchbar-results-popup-hidden {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(.4,0,.2,1), opacity 0.25s cubic-bezier(.4,0,.2,1);
}
#searchbar-results-popup.searchbar-results-popup-visible {
  max-height: 800px;
  opacity: 1;
  overflow: visible;
  transition: max-height 0.35s cubic-bezier(.4,0,.2,1), opacity 0.25s cubic-bezier(.4,0,.2,1);
}
.platform-banner[data-platform="reddit"] {
  background: #ff4500 !important;
  color: #fff;
}
.platform-banner[data-platform="reddit"] .platform-name {
  color: #fff;
}
/* Platform banner for trending-card */
.platform-banner {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 48px;
  min-height: 32px;
  max-width: 120px;
  max-height: 40px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(120deg, rgba(255,255,255,0.85) 0%, rgba(245,245,255,0.95) 100%);
  border-bottom-right-radius: 18px 32px;
  border-top-left-radius: 12px 24px;
  border: 1.5px solid rgba(255,255,255,0.6);
  padding: 4px 16px 4px 12px;
  z-index: 100;
  box-shadow: 0 6px 18px rgba(2,6,23,0.14), 0 2px 8px rgba(255,255,255,0.18) inset;
  font-weight: 600;
  backdrop-filter: blur(8px) brightness(1.10);
  -webkit-backdrop-filter: blur(8px) brightness(1.10);
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
}

.platform-banner .platform-logo {
  height: 20px;
  width: 20px;
  margin: 0 2px 0 0;
  border-radius: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: width 0.3s, height 0.3s;
}
.platform-name {
  font-size: 0.92rem;
  color: #333;
  font-weight: 600;
  letter-spacing: 0.01em;
}
/* Converted minimal styles from banner-login-fun to plain CSS for Flask static usage */
:root{
  --bg: #f8fafc;
  --card: #ffffff;
  --muted: #94a3b8;
  --primary: #6d28d9;
  --accent: #7c3aed;
  --accent-2: #6d28d9;
}
/* Dark mode variables applied when body has .dark */
body.dark{
  --bg: #181a20;
  --card: #071025;
  --muted: #94a3b8;
  --primary: #7c3aed;
  --accent: #06b6d4;
  --accent-2: #10b981;
  --text: #e6eef8;
}
html,body{height:100%;margin:0;font-family:Inter,system-ui,Segoe UI,Roboto,Arial}
body{background:linear-gradient(180deg,var(--bg) 0%, var(--bg) 100%); color:var(--text, #0f172a)}
/* Use grid for header so the center search area never overlaps left/right controls */
/* Compact header: scaled down ~25% for a tighter navbar */
header.appbar{position:fixed;left:0;right:0;top:0;height:54px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;padding:0 15px;background:rgba(255,255,255,0.6);backdrop-filter: blur(6px);box-shadow:0 6px 24px rgba(2,6,23,0.06);z-index:50;gap:9px}
.brand{position:relative;display:flex;align-items:center;gap:12px;z-index:60}
.brand .logo{width:30px;height:30px;border-radius:10px;background:linear-gradient(135deg,var(--primary),var(--accent));box-shadow:0 6px 30px rgba(124,58,237,0.08);display:flex;align-items:center;justify-content:center;cursor:pointer}
.brand h1{font-size:1rem;margin:0;font-weight:700;color:#0f172a}

.brand-title{margin-left:6px;font-weight:800;color:#0f172a}

.brand-title img#brand-logo{max-height:42px;width:auto;display:block;object-fit:contain}

/* Utility for screen-reader-only text kept for accessibility */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important}

/* Searchbar trending results popup styles */
#searchbar-results-popup {
  width: 100%;
  background: var(--card);
  box-shadow: 0 8px 32px rgba(2,6,23,0.12);
  border-radius: 0 0 12px 12px;
  z-index: 10;
  padding: 12px 0;
}
.searchbar-trending-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background 0.18s;
}
.searchbar-trending-card:hover {
  background: rgba(124,58,237,0.08);
}
.searchbar-trending-card img {
  width: 38px;
  height: 38px;
  border-radius: 8px / 14px;
  object-fit: cover;
}
.searchbar-trending-card .platform-banner {
  position: static;
  box-shadow: none;
  background: rgba(255,255,255,0.85);
  padding: 2px 8px;
  border-radius: 8px;
}
.searchbar-trending-card .platform-logo {
  height: 16px;
  width: 16px;
  margin-right: 4px;
}
.searchbar-trending-card .platform-name {
  font-size: 0.92rem;
  color: #333;
  font-weight: 600;
}
.searchbar-trending-card .topic-tag {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* .brand left offset removed to allow flex layout to position it at the left edge */
/* user button (right side) visually matches hamburger but as a pill */
.user-btn{background:linear-gradient(135deg,var(--primary),var(--accent));color:white;padding:6px 9px;border-radius:10px;border:0;cursor:pointer;font-weight:700;display:inline-flex;align-items:center;gap:6px}
.user-btn:hover{filter:brightness(.98)}
.user-btn img:hover, .user-btn img:focus {
  box-shadow: 0 8px 32px rgba(124,58,237,0.32), 0 3px 16px rgba(0,0,0,0.18);
  outline: none;
  transition: box-shadow 0.18s cubic-bezier(.4,2,.3,1);
}
.brand-dropdown{display:none;position:absolute;top:46px;left:0;background:var(--card);border-radius:10px;padding:8px;box-shadow:0 12px 36px rgba(2,6,23,0.08);min-width:160px;z-index:220}
.brand-dropdown a{display:block;padding:8px 10px;color:var(--muted);text-decoration:none;border-radius:10px}
.brand-dropdown a:hover{background:rgba(0,0,0,0.04);color:var(--text)}
.login-banner{display:flex;align-items:center;gap:12px}


.share-btn{display:inline-flex;align-items:center;padding:5px 5px;border-radius:10px;background:linear-gradient(135deg,var(--primary),var(--accent));color:white;border:0;cursor:pointer;font-weight:750;box-shadow:0 6px 20px rgba(124,58,237,0.10);transition: transform 0.18s cubic-bezier(.4,2,.3,1), box-shadow 0.18s cubic-bezier(.4,2,.3,1)}
.share-btn svg{width:20px;height:20px;flex:0 0 auto}
.share-btn .share-label{font-size:0.95rem;line-height:0;display:inline-block;margin-left:6px}
.share-btn:hover, .share-btn:focus{transform: scale(1.13) rotate(-6deg);box-shadow:0 8px 30px rgba(124,58,237,0.18);outline:none}

@media (max-width:800px){
  /* compress label on small screens to keep header neat */
  .share-btn{padding:8px;width:30px;height:30px;border-radius:10px;justify-content:center}
  .share-btn .share-label{display:none}
}

/* Collapse Sign in to icon-only on very small screens (<=420px) and match share button size */
@media (max-width:420px){
  #login-link{
    width:30px !important;
    height:30px !important;
    border-radius:10px !important;
    padding-right: 0px;
    justify-content:center;
    font-size:0; /* hide the textual label but keep the image visible */
    overflow:visible;
  }

}
.login-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 6px;
  border-radius:10px;
  /* fully transparent: no visible background, border or shadow */
  background: transparent;
  color: #000; /* sign-in text should be black */
  border: none;
  cursor:pointer;
  font-weight:750;
  text-decoration:none;
  box-shadow: none;
  transition: transform 0.18s cubic-bezier(.4,2,.3,1);
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.login-btn img{width:30px;height:30px;border-radius:6px;display:block;object-fit:cover}

/* Centered search bar in the header */
.header-search-wrap {
  grid-column: 2;
  justify-self: center;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 780px;
  box-sizing: border-box;
  padding: 0 9px;
}
.header-search {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: 4px 6px;
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 6px 20px rgba(2,6,23,0.04);
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}
.header-search input{flex:1;border:0;padding:8px 10px;border-radius:999px;font-size:0.75rem;color:#0f172a;background:transparent;outline:none}

.header-search button{
  background:linear-gradient(135deg,var(--primary),var(--accent));
  color:white;
  border-radius:10px;
  padding:6px 8px;
  border:0;
  min-width:33px;
  height:27px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  margin-left:6px;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(124,58,237,0.12);
  transition: transform 0.18s cubic-bezier(.4,2,.3,1), box-shadow 0.18s cubic-bezier(.4,2,.3,1);
}

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

@media (max-width:920px){
  /* slightly smaller padding and heights (scaled) */
  header.appbar{height:51px;padding:0 11px}
  .header-search{max-width:560px}
}
@media (max-width:720px){
  header.appbar{grid-template-columns:auto 1fr auto;padding:0 10px;height:48px}
  .header-search{max-width:440px}
}
@media (max-width:480px){
  /* On very small screens keep the search narrow and allow it to shrink */
  header.appbar{grid-template-columns:auto 1fr auto;padding:0 9px;height:45px}
  .header-search{max-width:320px;padding:5px}
  .header-search input{font-size:0.9rem}
}
main.hero{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:96px 20px}
.card{max-width:920px;width:100%;background:var(--card);border-radius:18px;padding:56px;box-shadow:0 30px 80px rgba(2,6,23,0.06);text-align:center}
body.dark .card{background:var(--card);box-shadow:none;color:var(--text)}
.eyebrow{color:var(--muted);text-transform:uppercase;letter-spacing:2px;font-weight:600;font-size:0.8rem}
h2{margin:12px 0 6px;font-size:2.6rem;line-height:1.02}
p.lead{color:var(--muted);font-size:1.05rem;max-width:78%;margin:16px auto}
.features{display:flex;gap:18px;justify-content:center;margin-top:26px}
.feature{background:#f1f5f9;padding:14px 18px;border-radius:12px;color:var(--muted);font-weight:600}
body.dark .feature{background:var(--card);color:var(--text)}
#toaster{
  display:none;
  position:fixed;
  left:50%;
  top:18%;
  transform:translateX(-50%);
  /* Softer, friendly purple tint (lighter than banner buttons) */
  background: linear-gradient(90deg, rgba(124,58,237,0.12), rgba(99,102,241,0.08));
  color: #ffffff;
  padding:18px 22px;
  border-radius:12px;
  box-shadow: 0 12px 40px rgba(124,58,237,0.08);
  font-family: Inter, system-ui;
  font-size:1.05rem;
  z-index:1000;
  max-width:80%;
  text-align:center;
  border: 1px solid rgba(124,58,237,0.10);
}
@media (max-width:720px){.card{padding:28px}h2{font-size:1.6rem}.features{flex-direction:column}header.appbar{height:64px;padding:0 14px}}
@media (max-width:420px){.brand{margin-left:6px}.header-search-wrap{width:88%;left:50%;transform:translate(-50%,-50%)}}

/* Mobile search toggle + overlay styles */
.mobile-search-toggle{display:none;background:transparent;border:0;color:var(--muted);width:40px;height:40px;border-radius:8px;align-items:center;justify-content:center;cursor:pointer}
.mobile-search-toggle svg{display:block}

/* Overlay that slides down on mobile when the magnifier is tapped */
.mobile-search-overlay{position:fixed;left:0;right:0;top:0;height:72px;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,rgba(255,255,255,0.98),rgba(255,255,255,0.95));backdrop-filter:blur(8px);transform:translateY(-120%);transition:transform 280ms cubic-bezier(.2,.9,.25,1);z-index:150;pointer-events:none}
.mobile-search-overlay.active{transform:translateY(0);pointer-events:auto}
.overlay-search{display:flex;align-items:center;gap:8px;width:calc(100% - 32px);max-width:820px;padding:8px 12px;background:var(--card);border-radius:999px;box-shadow:0 12px 32px rgba(2,6,23,0.08);border:1px solid rgba(15,23,42,0.06)}
.overlay-search input{flex:1;border:0;padding:10px 12px;font-size:1rem;background:transparent;outline:none}
.overlay-search .overlay-submit{
  background:linear-gradient(135deg,var(--primary),var(--accent));
  color: white;
  border-radius:10px;
  padding:8px 10px;
  border:0;
  min-width:44px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 6px 24px rgba(124,58,237,0.12);
  transition: transform 0.18s cubic-bezier(.4,2,.3,1), box-shadow 0.18s cubic-bezier(.4,2,.3,1);
}
.overlay-close{background:transparent;border:0;font-size:22px;line-height:1;padding:6px 8px;cursor:pointer;color:var(--muted)}

/* When mobile overlay is active, hide brand and login controls for a cleaner focused experience */
header.appbar.search-active .brand-hamburger,
header.appbar.search-active .brand-title,
header.appbar.search-active .login-banner{
  opacity:0;transform:translateY(-6px);pointer-events:none;transition:opacity 160ms linear, transform 160ms ease-in-out;visibility:hidden
}

/* On small screens hide the full search and show the magnifier toggle instead */
@media (max-width:720px){
  .header-search{display:none}
  .mobile-search-toggle{display:inline-flex}
  .header-search-wrap{width:auto;padding:0 6px}
  .mobile-search-overlay{height:64px}
}

/* Back-to-top button (styled to match the hamburger element) */
.back-to-top{position:fixed;right:18px;bottom:18px;width:36px;height:36px;border-radius:10px;background:linear-gradient(135deg,var(--primary),var(--accent));display:inline-flex;align-items:center;justify-content:center;color:white;border:0;cursor:pointer;opacity:0;transform:translateY(10px);pointer-events:none;transition:opacity 180ms ease, transform 180ms ease, box-shadow 140ms ease;z-index:220}
.back-to-top.visible{opacity:1;transform:translateY(0);pointer-events:auto}
.back-to-top:hover, .back-to-top:focus{transform:scale(1.12) translateY(0) rotate(-6deg);box-shadow:0 8px 30px rgba(124,58,237,0.18);outline:none}
.back-to-top svg{width:16px;height:16px}

/* Slightly larger on touch devices */
@media (hover:none) and (pointer:coarse){
  .back-to-top{width:44px;height:44px;right:16px;bottom:16px;border-radius:10px}
  .back-to-top svg{width:18px;height:18px}
}

/* Disable tilt/hover transform for profile/logout links inside the user menu dropdown */
#user-menu .login-btn,
#user-menu .login-btn:hover,
#user-menu .login-btn:focus{
  transform: none;
  box-shadow: none;
  transition: none;
}

/* Keep pointer and basic hover color if needed but avoid the tilt effect */
#user-menu .login-btn:hover{filter:brightness(0.98);}

/* ===================== */
/* Footer styles         */
/* ===================== */
.site-footer{background:linear-gradient(180deg,rgba(15,23,42,0.02),rgba(15,23,42,0.03));padding:28px 18px;margin-top:28px;border-top:1px solid rgba(15,23,42,0.04);color:var(--muted)}
.site-footer .footer-inner{display:flex;gap:24px;align-items:flex-start;justify-content:space-between;max-width:1200px;margin:0 auto}
.site-footer .footer-block{flex:1;min-width:160px}
.site-footer h3{margin:0 0 8px 0;color:var(--text);font-size:1rem}
.site-footer p{margin:0 0 6px 0;color:var(--muted)}
.site-footer a{color:var(--primary);text-decoration:none}
.site-footer .social-links{display:flex;gap:5px;align-items:center}
.site-footer .social-link{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px}
/* .site-footer .social-link svg{width:18px;height:18px} */
.site-footer .social-link img{width:35px;height:35px;display:block}
.site-footer .subscribe-form{display:flex;gap:8px;align-items:center}
.site-footer .subscribe-form input[type="email"]{padding:8px 10px;border-radius:8px;border:1px solid rgba(15,23,42,0.06);min-width:180px}
.site-footer .subscribe-btn{background:linear-gradient(135deg,var(--primary),var(--accent));color:white;border:0;padding:8px 12px;border-radius:8px;cursor:pointer}
.site-footer .footer-bottom{margin-top:18px;text-align:center;color:var(--muted);font-size:0.95rem}
.site-footer .footer-links{display:inline-flex;gap:8px;align-items:center}

@media (max-width:720px){
  .site-footer .footer-inner{flex-direction:column;align-items:stretch}
  .site-footer .subscribe-form{width:100%}
  .site-footer .social-link{width:34px;height:34px}
}

/* Mobile-specific: place hamburger flush-left and ensure no overlap with brand/logo */
@media (max-width:700px){
  .mobile-only{display:inline-flex}
  .desktop-only{display:none}
  /* Place hamburger at the extreme left (respect safe area) and vertically center inside the header */
  #brand-hamburger{position:fixed;left:calc(env(safe-area-inset-left, 0px) + 8px);top:50%;transform:translateY(-50%);z-index:140;padding:8px;background:linear-gradient(135deg,var(--primary),var(--accent));color:white;border:0;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;box-shadow:0 8px 30px rgba(124,58,237,0.14);transition:transform 160ms ease, box-shadow 160ms ease}
  #brand-hamburger svg{width:18px;height:18px;color:white;display:block}
  #brand-hamburger:active{transform:translateY(-50%) scale(0.98)}
  /* Make room for the hamburger so the brand/logo shifts right and never overlaps — reduced spacing so logo is closer */
  header.appbar{padding-left:64px}
  .brand{margin-left:4px}
  /* Slightly reduce the logo height on very small screens to keep spacing tight */
  #brand-logo{max-height:36px}
  /* Make the side-dock full width on very small screens */
  .mobile-side-dock{width:100vw;max-width:100%}
}

/* On wider screens, hide the mobile hamburger and ensure the brand/logo is flush-left */
@media (min-width:720px){
  #brand-hamburger{display:none !important}
  header.appbar{padding-left:15px}
  .brand{margin-left:0}
  #brand-logo{max-height:42px}
}

/* Mobile side-dock styles */
.mobile-side-dock-backdrop{position:fixed;inset:0;background:rgba(0,0,0,0.36);opacity:0;visibility:hidden;transition:opacity 220ms ease;z-index:1100}
.mobile-side-dock-backdrop.open{opacity:1;visibility:visible}
.mobile-side-dock{position:fixed;left:0;top:0;height:100vh;/* default: cover up to 1/3 of viewport on wider screens */width:33.333vw;max-width:420px;background:var(--card);transform:translateX(-100%);transition:transform 260ms cubic-bezier(.2,.9,.25,1);z-index:1110;padding:18px 14px;overflow:auto;font-size:0.95rem}
.mobile-side-dock.open{transform:translateX(0)}
.mobile-side-dock-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.mobile-side-dock-title{margin:0;font-size:1rem}
.mobile-side-dock-close{background:transparent;border:0;font-size:22px;line-height:1;padding:6px 8px;cursor:pointer}
.mobile-side-dock-nav ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.mobile-side-dock-nav a{display:block;padding:10px 12px;border-radius:8px;text-decoration:none;color:var(--text);font-size:0.95rem}
.mobile-side-dock-nav a:hover{background:rgba(0,0,0,0.04)}


/* Desktop dock (left rail) */
.desktop-dock-rail{
  position:fixed;left:0;top:var(--appbar-height,54px);height:calc(100vh - var(--appbar-height,54px));display:flex;flex-direction:column;align-items:flex-start;z-index:1050;pointer-events:auto;
  /* docked-in by default: 1/40 of viewport width (2.5vw) */
  width:2.5vw;min-width:40px;max-width:120px;background:rgba(255,255,255,0.6);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);transition:width 260ms cubic-bezier(.2,.9,.25,1);
}
.desktop-dock-rail.expanded{width:33.333vw;max-width:240px}

/* hide the internal rail toggle (we'll use the divider toggle below the header) */
.desktop-dock-toggle{display:none}
.desktop-dock{margin-top:8px;height:100%;width:100%;box-shadow:0 12px 36px rgba(2,6,23,0.08);overflow:auto;padding:18px 12px;border-right:1px solid rgba(15,23,42,0.04);box-sizing:border-box}
.desktop-dock ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}
.desktop-dock a{display:block;padding:8px 10px;border-radius:8px;text-decoration:none;color:var(--text);font-weight:700}
.desktop-dock a:hover{background:rgba(0,0,0,0.04)}

/* Divider toggle button to expand/collapse the desktop dock */
.desktop-dock-divider-toggle{position:fixed;left:0;top:calc(var(--appbar-height,54px) + 8px);width:40px;height:40px;border-radius:18px;background:linear-gradient(135deg,var(--primary),var(--accent));border:0;z-index:1055;box-shadow:0 8px 30px rgba(124,58,237,0.12);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transform:translateX(calc(2.5vw - 18px));transition:transform 260ms cubic-bezier(.2,.9,.25,1)}
.desktop-dock-rail.expanded .desktop-dock-divider-toggle{transform:translateX(calc(220px))}
.desktop-dock-divider-toggle .desktop-dock-icon{width:20px;height:20px;display:block;color:white}

/* Hide text labels when dock is collapsed (docked-in) */
.desktop-dock-rail:not(.expanded) .desktop-dock a{font-size:0;color:transparent;text-indent:-9999px;white-space:nowrap;overflow:hidden}

/* Optional: keep focus outlines visible when keyboard navigating */
.desktop-dock-rail:not(.expanded) .desktop-dock a:focus{font-size:inherit;color:inherit;text-indent:0}

/* Hide desktop dock on small viewports where mobile dock applies */
@media (max-width:720px){
  .desktop-dock-rail{display:none}
  .desktop-dock-divider{display:none}
}
