@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   CSS Reset & Normalize
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */
:root {
  /* Colors */
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary: #0f172a;
  --accent: #06b6d4;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-md: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Breakpoints (used in custom logic if needed, media queries rely on CSS preprocessor mostly, but here as reference) */
  --bp-sm: 576px;
  --bp-md: 768px;
  --bp-lg: 992px;
  --bp-xl: 1200px;
  --bp-xxl: 1400px;
}

/* Dark Mode Variables */
html[data-theme='dark'] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --surface: #1e293b;
  --surface-alt: #263148;
  
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --border: #334155;
  --border-light: #1e293b;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --shadow: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 15px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.4);
}

/* ==========================================================================
   Base Typography
   ========================================================================== */
body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; letter-spacing: -0.025em; }
h2 { font-size: 2rem; letter-spacing: -0.025em; }
h3 { font-size: 1.75rem; letter-spacing: -0.025em; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

a {
  color: var(--primary-light);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary);
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

ul { list-style: disc; }
ol { list-style: decimal; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background-color: var(--bg-secondary);
  color: var(--accent-purple);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
}

pre {
  background-color: var(--secondary);
  color: #fff;
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

blockquote {
  border-left: 4px solid var(--primary-light);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1rem;
  font-style: italic;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 1.5rem;
  padding-left: 1.5rem;
}

.container-fluid {
  width: 100%;
  padding-right: 1.5rem;
  padding-left: 1.5rem;
}

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }

/* ==========================================================================
   Spacing Utilities
   ========================================================================== */
.m-0 { margin: 0; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.pt-8 { padding-top: 2rem; }
.pb-8 { padding-bottom: 2rem; }

/* ==========================================================================
   Color & Display Utilities
   ========================================================================== */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.bg-surface { background-color: var(--surface); }
.bg-secondary { background-color: var(--bg-secondary); }

.d-none { display: none; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }

/* ==========================================================================
   Selection & Scrollbar Styles
   ========================================================================== */
::selection {
  background-color: var(--primary-light);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .no-print {
    display: none !important;
  }
  a {
    text-decoration: underline;
    color: #000;
  }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.4s ease-out forwards; }
.animate-slide-down { animation: slideDown 0.4s ease-out forwards; }

/* Responsive Breakpoints Utils */
@media (max-width: 768px) {
  .md-hidden { display: none !important; }
  .md-block { display: block !important; }
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}


/* ==========================================================================
   Extended Utilities (FutureSEOTools completion patch)
   ========================================================================== */

/* Container variants */
.container-narrow { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 1.5rem; }
.container-wide   { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }

/* Sections */
.section    { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.section-lg { padding: 96px 0; }
.section-xs { padding: 24px 0; }

/* Spacing extras */
.mb-3  { margin-bottom: 0.75rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-3  { margin-top: 0.75rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.gap-3 { gap: 0.75rem; }

/* Text sizes */
.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-3xl  { font-size: 1.875rem; }

/* Font weights */
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold{ font-weight: 800; }

/* Width helpers */
.w-full  { width: 100%; }
.w-auto  { width: auto; }
.max-w-full { max-width: 100%; }

/* Primary pale background */
.primary-pale { background: #eff6ff; }
--primary-pale: #eff6ff;

/* Grid auto-fill */
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Hover lift effect */
.hover-lift { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* Rounded */
.rounded    { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

/* Border */
.border { border: 1px solid var(--border); }

/* Overflow */
.hidden { display: none; }
.overflow-hidden { overflow: hidden; }

/* Prose */
.prose h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.prose h3 { font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose p  { line-height: 1.75; margin-bottom: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.5rem; line-height: 1.7; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.5; }

/* Section label chip */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-pale, #eff6ff);
  color: var(--primary);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* Pagination */
.pagination { display: flex; gap: 4px; align-items: center; }
.page-item { display: flex; }
.page-link {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  padding: 0 10px;
}
.page-item.active .page-link,
.page-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Tool card base */
.interface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.tool-card-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.tool-card-body { }

/* Result box */
.result-box {
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 16px;
}

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.875rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}
.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }
.toast.warning { background: #92400e; }
.toast.info    { background: #1e40af; }

/* Tool hero */
.tool-hero { padding: 32px 0 24px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.tool-hero-inner { display: flex; align-items: flex-start; gap: 20px; }
.tool-icon-xl { font-size: 3rem; flex-shrink: 0; line-height: 1; }
.tool-breadcrumb { padding: 12px 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.tool-interface-section { padding: 32px 0; }
.tool-meta-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.badge-info    { background: #eff6ff; color: #1d4ed8; }
.badge-success { background: #f0fdf4; color: #15803d; }
.badge-warning { background: #fff7ed; color: #c2410c; }
.badge-danger  { background: #fef2f2; color: #b91c1c; }
.badge-primary { background: var(--primary); color: #fff; }
.badge-popular { background: #fef9c3; color: #854d0e; }
.badge-new     { background: #f0fdf4; color: #15803d; }
.badge-api     { background: #fdf4ff; color: #7e22ce; }
.badge-category{ background: #f8fafc; color: var(--text-muted); border: 1px solid var(--border); }

/* Stat cards */
.stat-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* Buttons extra */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.5;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(30,64,175,0.35); color: #fff; }
.btn-secondary{ background: var(--bg-secondary); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-outline  { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text); }
.btn-sm  { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; }

/* Card */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* Text decoration */
.text-decoration-none { text-decoration: none; }

/* Responsive media */
@media (max-width: 768px) {
  .section    { padding: 40px 0; }
  .section-lg { padding: 56px 0; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  .interface-card { padding: 20px 16px; }
}


/* ==========================================================================
   Mobile Responsiveness & Horizontal Scroll Elimination Patch
   ========================================================================== */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  position: relative !important;
  box-sizing: border-box !important;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

/* Ensure no element causes horizontal overflow */
img, video, iframe, pre, code, canvas, svg, table, textarea, input, select {
  max-width: 100% !important;
}

pre, code {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-x: auto !important;
}

.container, .container-fluid, .container-narrow, .container-wide {
  width: 100% !important;
  max-width: 1200px;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Mobile Specific Overrides */
@media (max-width: 768px) {
  html, body {
    font-size: 15px;
  }
  
  .hero-banner {
    padding: 40px 0 32px !important;
  }
  
  .hero-h1 {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
    margin-bottom: 14px !important;
  }
  
  .hero-p {
    font-size: 0.95rem !important;
    margin-bottom: 24px !important;
  }

  .hero-search-box {
    margin-bottom: 20px !important;
  }

  .hero-search-input-wrap {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 8px !important;
    border-radius: 12px !important;
  }

  .hero-search-input-wrap input {
    width: 100% !important;
    padding: 10px !important;
    font-size: 0.95rem !important;
  }

  .hero-search-btn {
    width: 100% !important;
    padding: 12px !important;
  }

  /* Grid Layouts to 1 column on Mobile */
  .sandbox-grid,
  .aeo-banner-grid,
  .contact-layout,
  .footer-top-inner,
  .mission-grid,
  .audience-breakdown,
  .tools-grid,
  .home-tools-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .sandbox-card {
    padding: 20px 16px !important;
    border-radius: 16px !important;
  }

  .explorer-nav {
    gap: 6px !important;
    margin-bottom: 20px !important;
  }

  .explorer-tab {
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
  }

  .home-tool-card {
    padding: 16px !important;
    border-radius: 12px !important;
  }

  /* Footer adjustments */
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
  }

  .footer-bottom-inner {
    flex-direction: column !important;
    text-align: center !alignment;
    gap: 10px !important;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
}
