/* ==========================================================================
   NamesStyles.com - Production Stylesheet
   Modern, Mobile-First, Accessible (WCAG AA), Zero External Font Requests
   Total size target: < 35 KB minified / clean
   ========================================================================== */

/* --- 1. CSS Custom Properties & Design Tokens --- */
:root {
  /* System Font Stack - Zero Google Fonts network overhead */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Color Palette - Dark Theme (Default) */
  --bg-body: #0b0f19;
  --bg-surface: #131b2e;
  --bg-surface-elevated: #1a243c;
  --bg-surface-hover: #222f4d;
  --border-subtle: #233152;
  --border-strong: #364975;

  /* Typography */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accents */
  --accent-primary: #38bdf8;       /* Electric Sky Blue */
  --accent-primary-hover: #0284c7;
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  --accent-glow: rgba(56, 189, 248, 0.25);
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  /* Layout & Geometry */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
  --max-width: 1200px;
  --touch-target: 44px;

  /* Ad Slot Heights for CLS 0.00 */
  --ad-height-leaderboard: 90px;
  --ad-height-box: 250px;
  --ad-height-content: 280px;
}

/* Light Theme Override */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #6366f1 50%, #9333ea 100%);
  --accent-glow: rgba(2, 132, 199, 0.15);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Auto match system theme if not explicitly set */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-surface-hover: #e2e8f0;
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --accent-primary: #0284c7;
    --accent-primary-hover: #0369a1;
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #6366f1 50%, #9333ea 100%);
    --accent-glow: rgba(2, 132, 199, 0.15);
  }
}

/* --- 2. Baseline Reset & Global Elements --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* Accessible Skip Link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 999999;
  transition: top 0.2s ease;
  text-decoration: none;
}
.skip-to-content:focus {
  top: 1rem;
}

/* Screen reader only helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* --- 3. Header & Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(19, 27, 46, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.25s ease;
}
[data-theme="light"] .site-header {
  background-color: rgba(255, 255, 255, 0.94);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.site-logo:hover {
  text-decoration: none;
}
.logo-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--accent-gradient);
  color: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.main-nav {
  display: none; /* Shown on desktop */
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.4rem 0.2rem;
  position: relative;
  transition: color 0.15s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-primary);
  text-decoration: none;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

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

.theme-toggle {
  width: var(--touch-target);
  height: var(--touch-target);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
}
.theme-icon-light { display: none; font-size: 1.1rem; }
.theme-icon-dark { display: inline-block; font-size: 1.1rem; }
[data-theme="light"] .theme-icon-light { display: inline-block; }
[data-theme="light"] .theme-icon-dark { display: none; }

.mobile-menu-btn {
  width: var(--touch-target);
  height: var(--touch-target);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.hamburger-bar {
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Mobile Nav Drawer open state */
.main-nav.open {
  display: block;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem 1.25rem;
}
.main-nav.open .nav-links {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}
.main-nav.open .nav-links a {
  font-size: 1.05rem;
  width: 100%;
  display: block;
  padding: 0.5rem 0;
}

/* --- 4. Breadcrumbs --- */
.breadcrumb-container {
  padding-top: 1rem;
  padding-bottom: 0.5rem;
}
.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.breadcrumb-separator {
  color: var(--text-dim);
  user-select: none;
}
.breadcrumb-item.active {
  color: var(--text-muted);
  font-weight: 500;
}

/* --- 5. Main Hero & Tool Area --- */
.main-site-content {
  flex: 1 0 auto;
  padding-bottom: 3rem;
}

.hero-section {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  background: var(--bg-surface-elevated);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(1.8rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

.hero-description {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Main Input Area */
.tool-input-wrapper {
  max-width: 820px;
  margin: 2rem auto 1.5rem;
  position: relative;
}

.input-box-container {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-box-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.main-name-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 1.1rem 4rem 1.1rem 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}
.main-name-input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

.clear-input-btn {
  position: absolute;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s ease;
}
.clear-input-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--accent-primary);
}

/* Tool Controls Bar: Search, Character Count, Platform Warning */
.tool-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0 0.5rem;
  font-size: 0.85rem;
}

.char-counter-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.char-counter {
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.char-counter.limit-exceeded {
  color: var(--accent-danger);
  border-color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

.platform-limit-tag {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.filter-actions-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.style-search-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
  width: 140px;
  transition: width 0.2s ease, border-color 0.2s ease;
}
.style-search-input:focus {
  width: 180px;
  border-color: var(--accent-primary);
}

.btn-utility {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}
.btn-utility:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--accent-primary);
}

/* Category Quick-Chips Navigator */
.category-chips-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.75rem 0 1rem;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.category-chips-nav::-webkit-scrollbar {
  height: 4px;
}
.category-chips-nav::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.chip-btn {
  flex: 0 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-decoration: none;
}
.chip-btn:hover,
.chip-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--accent-primary);
}

/* --- 6. Results Grid & Cards --- */
.results-category-section {
  margin-bottom: 2.5rem;
}

.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

.category-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.category-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.style-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.style-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-sm);
}

.card-text-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.card-style-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-preview-text {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-all;
  line-height: 1.4;
  user-select: all;
  min-height: 1.6rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.btn-card-copy {
  min-width: 72px;
  height: 38px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}
.btn-card-copy:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}
.btn-card-copy.copied {
  background: var(--accent-success);
  border-color: var(--accent-success);
  color: #fff;
}

.btn-card-fav {
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.15s ease;
}
.btn-card-fav:hover {
  color: #f43f5e;
  background: var(--bg-surface-elevated);
}
.btn-card-fav.active {
  color: #f43f5e;
}

/* --- 7. Sticky Input Bar on Mobile --- */
.sticky-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(19, 27, 46, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-strong);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(120%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .sticky-mobile-bar {
  background: rgba(255, 255, 255, 0.96);
}
.sticky-mobile-bar.visible {
  transform: translateY(0);
}

.sticky-input-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto;
}
.sticky-name-input {
  flex: 1 1 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}
.sticky-clear-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 8. Server-Rendered Content & SEO Articles --- */
.seo-content-article {
  max-width: 860px;
  margin: 3.5rem auto 1.5rem;
  padding: 0 1rem;
}

.article-section {
  margin-bottom: 2.5rem;
}

.article-h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1rem;
  border-left: 4px solid var(--accent-primary);
  padding-left: 0.75rem;
}

.article-p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

/* Step-by-Step Instructions List */
.steps-ordered-list {
  list-style: none;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.steps-ordered-list li {
  counter-increment: step-counter;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: var(--text-main);
  font-size: 0.95rem;
}
.steps-ordered-list li::before {
  content: counter(step-counter);
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.85rem;
}

/* Tips & Callouts */
.callout-box {
  background: var(--bg-surface);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}
.callout-box.warning {
  border-left-color: var(--accent-warning);
}
.callout-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.callout-text {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.faq-item:hover {
  border-color: var(--border-strong);
}
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-arrow {
  color: var(--text-dim);
  transition: transform 0.2s ease;
}
.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}
.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}
.faq-item.open .faq-answer {
  display: block;
}

/* Related Links Grid */
.related-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}
.related-link-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.15s ease;
}
.related-link-card:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
  text-decoration: none;
  transform: translateY(-2px);
}

/* --- 9. CLS-Free Reserved Ad Containers --- */
.ad-container-outer {
  width: 100%;
  margin: 2rem 0;
  display: flex;
  justify-content: center;
  clear: both;
}

.ad-container {
  width: 100%;
  max-width: 728px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Explicit heights lock CLS to 0.00 */
.ad-slot-top-leaderboard {
  min-height: var(--ad-height-leaderboard);
  height: var(--ad-height-leaderboard);
}
.ad-slot-in-content {
  min-height: var(--ad-height-content);
  height: var(--ad-height-content);
}

.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  user-select: none;
}
.ad-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.ad-sublabel {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.7;
}

/* --- 10. Universal Toast Notification --- */
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 85px;
  transform: translate(-50%, 20px);
  background: #0f172a;
  color: #f8fafc;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-strong);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 10001;
}
[data-theme="light"] .copy-toast {
  background: #1e293b;
}
.copy-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast-icon {
  color: var(--accent-success);
  font-weight: 800;
}

/* Back to top floating button */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 85px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 998;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  transform: translateY(-2px);
}

/* --- 11. Site Footer --- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  font-size: 0.9rem;
}

.footer-top {
  padding: 3.5rem 1.25rem 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.brand-col .footer-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.85rem;
}

.footer-tagline {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  max-width: 320px;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-success);
}

.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.1rem;
  letter-spacing: -0.01em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: color 0.15s ease;
}
.footer-links a:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  padding: 1.25rem 0;
  font-size: 0.8rem;
}
.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.disclaimer-text {
  color: var(--text-dim);
  line-height: 1.5;
}
.copyright-text {
  color: var(--text-muted);
}

/* --- 12. Responsive Breakpoints --- */
@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .main-nav {
    display: block;
  }
  .mobile-menu-btn {
    display: none;
  }
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
  .footer-bottom-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .disclaimer-text {
    max-width: 70%;
  }
  .sticky-mobile-bar {
    display: none; /* Desktop does not need fixed bottom bar */
  }
  .back-to-top {
    bottom: 2rem;
  }
  .copy-toast {
    bottom: 2rem;
  }
}

@media (min-width: 1150px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
