/* ==========================================================================
   PDF Page Extractor - Modern, Accessible, Ultra-Fast Stylesheet
   WCAG AAA Compliant • Mobile-First • Zero Heavy Dependencies
   ========================================================================== */

:root {
  /* Color Palette - Refined Cool & Indigo Neutrals */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-primary-dark: #1e40af;
  --color-accent: #0284c7;
  --color-accent-hover: #0369a1;
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;

  /* Neutral Spectrum */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-focus: #3b82f6;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

  /* Layout & Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --container-width: 1200px;
  --container-reading: 780px;

  /* Fonts */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-subtle: #1a2234;
  --bg-muted: #2d3748;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --border-light: #1f2937;
  --border-subtle: #374151;
  --border-focus: #60a5fa;

  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-primary-light: #1e293b;
  --color-success-bg: #064e3b;
  --color-warning-bg: #78350f;
  --color-error-bg: #7f1d1d;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   CSS Reset & Base Rules
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  background-color: var(--bg-body);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  margin-top: 2rem;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  max-width: 75ch;
}

strong {
  color: var(--text-primary);
}

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-primary);
}

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

.container-reading {
  max-width: var(--container-reading);
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(8px);
  transition: background-color var(--transition-normal);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none !important;
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  color: var(--color-primary);
}

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

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
}

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

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-muted);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
}

/* ==========================================================================
   Hero & Tool Section
   ========================================================================== */
.hero-section {
  padding: 2.5rem 0 3.5rem 0;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.hero-title {
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  margin: 0 auto 2rem auto;
  color: var(--text-secondary);
}

/* Tool Workspace Container */
.tool-workspace {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  text-align: left;
  transition: all var(--transition-normal);
}

/* Drag & Drop Zone */
.dropzone {
  position: relative;
  padding: 3rem 1.5rem;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 1.5rem;
  background-color: var(--bg-subtle);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.dropzone-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.dropzone-icon {
  width: 2rem;
  height: 2rem;
}

.dropzone-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.dropzone-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

/* Active PDF Document Card */
.document-panel {
  display: none;
  padding: 1.5rem;
  animation: fadeIn 200ms ease-out;
}

.document-panel.active {
  display: block;
}

.doc-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.doc-info {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.doc-badge-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fee2e2;
  color: #dc2626;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.75rem;
}

.doc-details h4 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
  word-break: break-all;
}

.doc-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  color: var(--color-error);
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: var(--color-error-bg);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-reset:hover {
  background: #fecaca;
}

/* Selection Controls Bar */
.selection-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.range-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.range-input-label {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
}

.range-input-wrap {
  position: relative;
}

.range-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.range-input:focus {
  border-color: var(--border-focus);
}

.range-syntax-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.quick-select-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn-pill {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-pill:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.btn-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Page Badges Grid */
.pages-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.pages-grid-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.pages-counter-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  max-height: 480px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

@media (min-width: 640px) {
  .pages-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 1.15rem;
  }
}

.pages-grid::-webkit-scrollbar {
  width: 6px;
}

.pages-grid::-webkit-scrollbar-thumb {
  background-color: var(--border-subtle);
  border-radius: 4px;
}

/* Page Thumbnail Card */
.page-badge-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  user-select: none;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  padding: 0;
  text-align: left;
}

.page-badge-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.page-badge-item.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25), var(--shadow-md);
}

/* Canvas Container */
.page-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.35;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 200ms ease;
  background: #ffffff;
}

.page-badge-item:hover .page-canvas {
  transform: scale(1.02);
}

/* Skeleton Loading Shimmer */
.page-thumb-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-muted) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  z-index: 1;
}

.page-thumb-skeleton.loaded {
  display: none;
}

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

/* Page Card Footer Info */
.page-thumb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  font-size: 0.8125rem;
}

.page-badge-item .page-num {
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.page-badge-item.selected .page-num {
  color: var(--color-primary);
  font-weight: 700;
}

/* Selection Indicator Checkbox */
.page-badge-item .check-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-fast);
  z-index: 3;
}

.page-badge-item.selected .check-indicator {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

/* Zoom Preview Trigger on Thumbnail */
.btn-thumb-zoom {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 10px;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--transition-fast);
  z-index: 3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.page-badge-item:hover .btn-thumb-zoom {
  opacity: 1;
  transform: scale(1);
}

.btn-thumb-zoom:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Zoom Modal */
.page-zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  animation: fadeIn 200ms ease;
}

.page-zoom-modal.active {
  display: flex;
}

.page-zoom-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.page-zoom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.page-zoom-body {
  padding: 1rem;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #334155;
  min-height: 300px;
}

.page-zoom-canvas {
  max-width: 100%;
  max-height: 75vh;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  background: #fff;
  border-radius: 4px;
}

/* Action Footer & Progress */
.action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--border-light);
  padding-top: 1.25rem;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all var(--transition-fast);
  min-height: 48px;
}

.btn-primary-action:hover:not(:disabled) {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-primary-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-progress-wrap {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.status-progress-wrap.active {
  display: block;
}

.progress-bar-bg {
  height: 8px;
  width: 100%;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 200ms ease;
}

/* Trust Badges Bar */
.trust-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.trust-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.trust-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--color-success);
  flex-shrink: 0;
}

.trust-card-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Content Components (Guides, Cards, FAQ, Breadcrumbs)
   ========================================================================== */
.breadcrumbs-nav {
  padding: 1rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumbs-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.breadcrumbs-list a {
  color: var(--text-secondary);
}

.breadcrumbs-separator {
  color: var(--text-muted);
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  padding: 1.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-card-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

/* Step-by-Step Guide */
.steps-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.step-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.step-num-badge {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-weight: 800;
  border-radius: var(--radius-full);
}

.step-content h3 {
  margin-top: 0;
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: left;
  color: var(--text-primary);
  background: var(--bg-surface);
  transition: background-color var(--transition-fast);
}

.faq-question:hover {
  background: var(--bg-subtle);
}

.faq-chevron {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 1.5rem 1.5rem 1.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Syntax Visualizer Table */
.syntax-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.syntax-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.syntax-table th, .syntax-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.syntax-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-primary);
}

.syntax-table tr:last-child td {
  border-bottom: none;
}

/* Related Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none !important;
  transition: all var(--transition-fast);
}

.tool-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tool-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.tool-card h3 {
  font-size: 1.125rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tool-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ==========================================================================
   Form Controls & Contact UI
   ========================================================================== */
.form-card {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--border-focus);
}

.form-error-msg {
  color: var(--color-error);
  font-size: 0.8125rem;
  margin-top: 0.35rem;
  display: none;
}

.form-group.has-error .form-error-msg {
  display: block;
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea {
  border-color: var(--color-error);
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
  width: calc(100% - 3rem);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  pointer-events: auto;
  animation: slideIn 250ms ease-out forwards;
}

.toast.toast-success {
  border-left: 4px solid var(--color-success);
}

.toast.toast-error {
  border-left: 4px solid var(--color-error);
}

.toast.toast-info {
  border-left: 4px solid var(--color-primary);
}

.toast.toast-warning {
  border-left: 4px solid var(--color-warning);
}

.toast-message {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
}

.toast-close {
  color: var(--text-muted);
  padding: 0.25rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 4rem 0 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-column h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
}

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

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseHighlight {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 4.25rem;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    display: none;
  }

  .nav-menu.open {
    display: flex;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .action-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary-action {
    width: 100%;
  }

  .doc-header-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
