/**
 * GoToolstack — Layout & Grid Architecture
 * Core Web Vitals (Zero CLS), Responsive Flex & Grid Systems.
 */

.app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-w);
  min-width: 260px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 45;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
  cursor: pointer;
  position: sticky;
  top: -20px;
  background: var(--panel);
  z-index: 10;
  margin-top: -20px;
  padding-top: 24px;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-foot {
  margin-top: 16px;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  font-size: 0.73rem;
  color: var(--muted-2);
  line-height: 1.5;
}

/* Main Workspace */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
  contain: layout;
}

.menu-btn {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
  transition: background 0.15s ease;
}

.menu-btn:hover {
  background: var(--panel-2);
}

.top-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.top-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  height: 38px;
  min-height: 38px;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Container Structure */
.main-inner {
  display: flex;
  gap: 32px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 36px;
  align-items: flex-start;
  min-height: 600px;
  box-sizing: border-box;
}

.content-col {
  flex: 1;
  min-width: 0;
}

.content {
  padding: 24px 0 40px;
  width: 100%;
}

/* Sticky Right Rail (300x600 Half-Page Ad) */
.right-rail {
  width: 300px;
  min-height: 630px;
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 20px;
  contain: layout;
}

/* IAB Standardized Zero-CLS Ad Containers & Revenue Optimization */
.ad-slot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 18px 0;
  clear: both;
  box-sizing: border-box;
  contain: layout;
}

/* AdSense Policy Guard: Collapse unfilled ad units once status is determined */
ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}

.ad-slot-wrapper:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.ad-slot-wrapper.ad-empty,
.ad-anchor-mobile:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.ad-anchor-mobile.ad-empty {
  display: none !important;
}


/* Ad containers maintain reserved minimum height when populated (Zero-CLS & Core Web Vitals) */

.sidebar .ad-slot-wrapper,
.ad-slot-sidebarSquare {
  width: 100%;
  min-height: 274px;
  flex-shrink: 0;
  margin-top: auto;
  contain: layout;
  box-sizing: border-box;
}

.ad-slot-topLeaderboard {
  width: 100%;
  min-height: 116px;
  flex-shrink: 0;
  margin: 16px 0 12px;
  contain: layout;
  box-sizing: border-box;
}

.ad-slot-sidebarSticky {
  width: 300px;
  min-height: 624px;
  flex-shrink: 0;
  margin: 0;
  contain: layout;
  box-sizing: border-box;
}

/* ── Result-Under Slot ────────────────────────────────────────────────────
   Position: AFTER tool output, BEFORE SEO guide.
   Highest CPM — user just completed an action (peak engagement/intent).
   Google Policy: Safe separation from interactive buttons/forms (32px safety margin).
   Desktop: 728×90 leaderboard. Mobile: 336×280 / responsive rectangle.
   ──────────────────────────────────────────────────────────────────────── */
.ad-slot-resultUnder {
  width: 100%;
  min-height: 116px;
  flex-shrink: 0;
  margin: 36px 0 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  contain: layout;
  box-sizing: border-box;
}

/* ── In-Article Slot ──────────────────────────────────────────────────────
   Position: AFTER SEO guide (between long-form content blocks).
   Google Policy: must appear between paragraphs — never adjacent to
   another ad slot.
   ──────────────────────────────────────────────────────────────────────── */
.ad-slot-inArticle {
  width: 100%;
  min-height: 116px;
  flex-shrink: 0;
  margin: 36px 0 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  contain: layout;
  box-sizing: border-box;
}


.ad-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 16px;
  line-height: 16px;
  box-sizing: border-box;
}

.ad-container {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  position: relative;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.ad-container-topLeaderboard, .ad-container-top {
  width: 100%;
  max-width: 970px;
  min-height: 90px;
  height: 90px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  box-sizing: border-box;
}

.ad-container-sidebarSticky, .ad-container-sidebar {
  width: 300px;
  min-height: 600px;
  height: 600px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  box-sizing: border-box;
}

.ad-container-resultUnder {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  height: 90px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  box-sizing: border-box;
}

.ad-container-inArticle, .ad-container-infeed {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  height: 90px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  box-sizing: border-box;
}

.ad-container-square {
  width: 100%;
  min-height: 250px;
  height: 250px;
  max-height: 250px;
  flex-shrink: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  box-sizing: border-box;
}

/* Ad Placeholder Styling (High Aesthetic, Non-Distracting) */
.ad-placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  text-align: center;
}

.ad-badge-sp {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 4px;
  background: var(--brand-dim);
  color: var(--brand);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ad-dim-text {
  font-size: 0.72rem;
  color: var(--muted-2);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.03em;
}

/* In-Feed Category Grid Unit (Google Policy Compliant: Distinct, Non-Deceptive, No Fake Cursor) */
.ad-card-infeed-wrapper {
  grid-column: 1 / -1;
  width: 100%;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.ad-card-infeed {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Mobile Sticky Anchor Ad (320x50 / 320x100 - Better Ads Standards Compliant) */
.ad-anchor-mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 64px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ad-anchor-mobile.closed {
  transform: translateY(100%) !important;
  pointer-events: none !important;
}

.ad-anchor-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 50px;
}

.ad-anchor-close {
  position: absolute;
  top: -12px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  z-index: 95;
  transition: all 0.15s ease;
}

.ad-anchor-close:hover {
  background: var(--text);
  color: var(--bg);
  transform: scale(1.08);
}

/* Related Tools Section */
.related-tools-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  width: 100%;
}

.related-tools-head {
  margin-bottom: 20px;
}

.related-tools-head h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.related-tools-head p {
  color: var(--muted);
  font-size: 0.85rem;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

/* Hero Section */
.hero-minimal {
  padding: 32px 20px 24px;
  max-width: 840px;
  margin: 0 auto 36px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ok);
  background: var(--ok-dim);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.hero-minimal h1 {
  font-size: 3.1rem;
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-minimal p {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 660px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* Category Filter Bar */
.category-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 28px;
  flex-wrap: wrap;
}

.cat-filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-filter-btn:hover {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--brand);
}

.cat-filter-btn.active {
  background: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand);
  box-shadow: 0 4px 14px var(--brand-glow);
}

/* Home Section & Grid */
.home-section {
  margin-bottom: 40px;
}

.home-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.home-section-head .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.home-section-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

/* Footer */
footer.app-footer {
  border-top: 1px solid var(--line);
  margin-top: auto;
  background: var(--panel);
  width: 100%;
  min-height: 110px;
  box-sizing: border-box;
  contain: layout;
}

.footer-inner {
  max-width: 1440px;
  padding: 32px 36px 40px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--brand);
}

.footer-disclaimer {
  color: var(--muted-2);
  font-size: 0.8rem;
  line-height: 1.6;
  max-width: 800px;
}

.footer-author {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Responsive Media Queries */
@media (max-width: 1200px) {
  .right-rail {
    display: none !important;
  }
  .main-inner {
    padding: 0 24px;
  }
}

@media (max-width: 880px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 10px;
  }

  .top-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-left: auto;
  }

  .main-inner {
    padding: 0 16px;
  }

  .hero-minimal h1 {
    font-size: 2.1rem;
  }

  .hero-minimal p {
    font-size: 0.98rem;
  }

  .top-search {
    order: 3;
    max-width: none;
    width: 100%;
    margin-top: 2px;
  }

  .ad-slot-topLeaderboard {
    min-height: 76px;
    margin: 10px 0 8px;
  }

  .ad-container-topLeaderboard,
  .ad-container-top {
    min-height: 50px;
    max-width: 360px;
  }

  .ad-slot-resultUnder,
  .ad-slot-inArticle {
    margin: 24px 0 16px;
    padding-top: 12px;
  }

  .ad-anchor-mobile {
    display: flex;
  }

  body {
    padding-bottom: 64px; /* offset for mobile anchor ad */
  }
}

/* ── Cookie Consent Banner (GDPR / ePrivacy) ────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding: 14px 20px;
  animation: slideUpBanner 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpBanner {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.cookie-banner-text a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Corporate Legal & Contact Pages ────────────────────────────────── */
.legal-page,
.contact-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 0 40px;
}

.legal-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.legal-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

.legal-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legal-section {
  margin-bottom: 28px;
}

.legal-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.legal-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 18px 0 8px;
}

.legal-section p, .legal-section li {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.legal-section ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.contact-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.contact-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.contact-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 32px;
}

.contact-form-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
}

