/* ============================================================================
   NickFinder.site — Modular Stylesheet (/css/app.css)
   Zero-CLS layout, smart sticky input box, single-row responsive toolbar,
   minimal distraction-free card labels, centered fancy headings
   ============================================================================ */

:root {
  --card-font-size: 21px;
  --brand-primary: #e11d48;
  --brand-hover: #be123c;
  --header-h: 56px;
}

@media (min-width: 640px) {
  :root {
    --header-h: 64px;
  }
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll; /* Prevents horizontal layout shift between short & tall pages */
}

body {
  font-family: 'Inter', 'Noto Sans Symbols 2', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(225, 29, 72, 0.3);
  border-radius: 9999px;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Smart Auto-Hide Header (Hides on scroll down so Sticky Input Box takes top slot) */
#siteHeader {
  height: var(--header-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
#siteHeader.header-hidden {
  transform: translateY(-100%);
}

/* Sticky Nickname Input Box (Pins smoothly at top when header hides!) */
#stickyInputWrap {
  position: sticky;
  top: 8px;
  z-index: 35;
  transition: top 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}
body.header-visible #stickyInputWrap {
  top: calc(var(--header-h) + 6px);
}
#stickyInputWrap.is-pinned {
  box-shadow: 0 12px 28px -10px rgba(15, 23, 42, 0.22);
}
.dark #stickyInputWrap.is-pinned {
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.65);
}

/* Zero-CLS Reserved Containers */
#categoryStrip {
  min-height: 36px;
}
#cardsContainer.has-reserved-height {
  min-height: 760px;
}

/* Compact Half-Screen Slide Drawer */
.drawer-panel {
  width: 56vw;
  min-width: 215px;
  max-width: 275px;
  transform: translateX(-100%);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 640px) {
  .drawer-panel {
    width: 275px;
    max-width: 285px;
  }
}
.drawer-panel.open {
  transform: translateX(0);
}

/* Single-Row Active Pill */
.pill-active {
  background-color: #e11d48 !important;
  color: #ffffff !important;
  border-color: #e11d48 !important;
  box-shadow: 0 4px 10px -2px rgba(225, 29, 72, 0.36);
}

/* Single-Line Responsive Toolbar (Never wraps - 21 + onto a 2nd row on mobile!) */
.toolbar-single-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 44px;
}
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.65rem;
  font-size: clamp(10.5px, 2.8vw, 12.5px);
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
@media (min-width: 480px) {
  .toolbar-btn {
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
  }
}

/* Style Card — Distraction-Free Focus on Nickname Frame */
.style-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.16s ease,
              border-color 0.16s ease;
}
.style-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(15, 23, 42, 0.12);
}
.dark .style-card:hover {
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.5);
}
.style-card:active {
  transform: scale(0.993);
}

/* Ultra-Subtle Plain Label (Zero heavy border/background, matches chars text) */
.card-style-label {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dark .card-style-label {
  color: #64748b;
}

.preview-text {
  font-size: var(--card-font-size);
  line-height: 1.42;
  word-break: break-word;
  transition: font-size 0.15s ease;
}

/* Bottom Copy Progress Bar */
.card-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background-color: #e11d48;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.style-card.copied-active .card-progress {
  width: 100%;
}

/* Centered Fancy Heading with Accent Underline */
.fancy-heading {
  text-align: center;
  position: relative;
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
}
.fancy-heading::after {
  content: '';
  display: block;
  width: 56px;
  height: 3.5px;
  margin: 0.5rem auto 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, #e11d48, #f97316);
}
.fancy-sub-heading {
  text-align: center;
  position: relative;
  padding-bottom: 0.45rem;
}
.fancy-sub-heading::after {
  content: '';
  display: block;
  width: 40px;
  height: 2.5px;
  margin: 0.35rem auto 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, #e11d48, #fb7185);
  opacity: 0.85;
}

/* Load More Staggered Card Reveal Animation */
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.card-reveal {
  animation: cardReveal 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Spinner for Load More Button */
@keyframes spin360 {
  to { transform: rotate(360deg); }
}
.nf-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin360 0.65s linear infinite;
}

/* Wand Spin Micro-Animation */
@keyframes wandPop {
  0% { transform: scale(1) rotate(0deg); }
  45% { transform: scale(1.14) rotate(-18deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.wand-pop {
  animation: wandPop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Toast Progress */
@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}
.toast-progress-bar {
  animation: toastProgress 2.2s linear forwards;
}

/* Drawer List Item */
.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.48rem 0.65rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.drawer-link:hover {
  background-color: #fff1f2;
  color: #e11d48;
}
.dark .drawer-link:hover {
  background-color: #1b2130;
  color: #fb7185;
}
.drawer-link.active {
  background-color: #e11d48;
  color: #ffffff;
}

/* FAQ Accordion Chevron */
.faq-btn[aria-expanded="true"] .faq-chevron {
  transform: rotate(45deg);
}
.faq-chevron {
  transition: transform 0.2s ease;
}
