.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: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.85);
  border-bottom-right-radius: 10px;
  padding: 3px 8px 3px 6px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(2,6,23,0.10);
  font-weight: 600;
}
.platform-banner .platform-logo {
  height: 16px;
  width: 16px;
  margin: 0;
  border-radius: 3px;
  box-shadow: none;
}
.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;margin-left:8px;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}

/* hamburger menu for brand */
.brand-menu{position:relative}
.brand-hamburger{width:27px;height:27px;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}
brand-hamburger{
  width:27px;
  height:27px;
  border-radius:6px;
  background:linear-gradient(135deg,var(--primary),var(--accent));
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:white;
  border:0;
  cursor:pointer;
  transition: transform 0.18s cubic-bezier(.4,2,.3,1), box-shadow 0.18s cubic-bezier(.4,2,.3,1);
}
.brand-hamburger:hover, .brand-hamburger:focus {
  transform: scale(1.13) rotate(-6deg);
  box-shadow: 0 4px 18px rgba(124,58,237,0.18);
  outline: none;
}
.brand-hamburger.active-tilt {
  transform: scale(1.13) rotate(-6deg);
  box-shadow: 0 4px 18px rgba(124,58,237,0.18);
  outline: none;
}
.brand-title{margin-left:6px;font-weight:800;color:#0f172a}

/* Brand logo placed in the title area: keep it contained within the header */
.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}

/* .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;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%}
.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 button:hover, .header-search button:focus{
  transform:scale(1.13) rotate(-6deg);
  box-shadow:0 8px 30px rgba(124,58,237,0.18);
  outline:none;
} */
.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:800px){
  .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}
}
