/* ==========================================================================
   PDFSTRIDE 3.0 — Modern Open-Source Design System
   Sleek Compact Hero • Ambient Aurora Background • Vibrant Tool Cards
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Universal Theme Colors */
  --bg-app: #F8FAFC;
  --bg-surface: rgba(255, 255, 255, 0.9);
  --bg-surface-elevated: #FFFFFF;
  --bg-surface-subtle: #F1F5F9;
  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-faint: #94A3B8;

  /* Brand Accent: Signature iLovePDF Crimson Red & Coral Orange */
  --brand-primary: #E5322D;
  --brand-secondary: #F97316;
  --brand-gradient: linear-gradient(135deg, #E5322D 0%, #F97316 100%);
  --brand-glow: rgba(229, 50, 45, 0.25);

  /* Tool Specific Fallbacks */
  --tool-color: #4F46E5;
  --tool-hover: #4338CA;
  --tool-light: #EEF2FF;
  --tool-gradient: linear-gradient(135deg, #4F46E5 0%, #3B82F6 100%);
  --tool-glow: rgba(79, 70, 229, 0.28);

  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 16px 32px -4px rgba(15, 23, 42, 0.1), 0 6px 12px -2px rgba(15, 23, 42, 0.05);
  --shadow-floating: 0 20px 32px -8px rgba(15, 23, 42, 0.15), 0 8px 14px -4px rgba(15, 23, 42, 0.06);

  /* Header Glass */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(226, 232, 240, 0.8);
}

html.dark {
  --bg-app: #0B0F19;
  --bg-surface: rgba(17, 24, 39, 0.85);
  --bg-surface-elevated: #1F2937;
  --bg-surface-subtle: #192237;
  --border-subtle: #1F2937;
  --border-strong: #374151;
  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-faint: #6B7280;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 16px 32px -4px rgba(0, 0, 0, 0.6);
  --shadow-floating: 0 20px 32px -8px rgba(0, 0, 0, 0.7);

  --glass-bg: rgba(11, 15, 25, 0.85);
  --glass-border: rgba(31, 41, 55, 0.8);
}

/* ==========================================================================
   VIBRANT TOOL SIGNATURE COLOR THEMES (iLovePDF Style)
   ========================================================================== */
body[data-color="red"], .theme-red {
  --tool-color: #E5322D;
  --tool-hover: #C5221F;
  --tool-light: #FEF2F2;
  --tool-gradient: linear-gradient(135deg, #FF453A 0%, #E5322D 100%);
  --tool-glow: rgba(229, 50, 45, 0.35);
}
body[data-color="orange"], .theme-orange {
  --tool-color: #F97316;
  --tool-hover: #EA580C;
  --tool-light: #FFF7ED;
  --tool-gradient: linear-gradient(135deg, #FB923C 0%, #F97316 100%);
  --tool-glow: rgba(249, 115, 22, 0.35);
}
body[data-color="green"], .theme-green {
  --tool-color: #10B981;
  --tool-hover: #059669;
  --tool-light: #ECFDF5;
  --tool-gradient: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  --tool-glow: rgba(16, 185, 129, 0.35);
}
body[data-color="blue"], .theme-blue {
  --tool-color: #2563EB;
  --tool-hover: #1D4ED8;
  --tool-light: #EFF6FF;
  --tool-gradient: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  --tool-glow: rgba(37, 99, 235, 0.35);
}
body[data-color="purple"], .theme-purple {
  --tool-color: #8B5CF6;
  --tool-hover: #7C3AED;
  --tool-light: #F5F3FF;
  --tool-gradient: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
  --tool-glow: rgba(139, 92, 246, 0.35);
}
body[data-color="amber"], .theme-amber {
  --tool-color: #F59E0B;
  --tool-hover: #D97706;
  --tool-light: #FFFBEB;
  --tool-gradient: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  --tool-glow: rgba(245, 158, 11, 0.35);
}
body[data-color="teal"], .theme-teal {
  --tool-color: #06B6D4;
  --tool-hover: #0891B2;
  --tool-light: #ECFEFF;
  --tool-gradient: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  --tool-glow: rgba(6, 182, 212, 0.35);
}
body[data-color="fuchsia"], .theme-fuchsia {
  --tool-color: #D946EF;
  --tool-hover: #C026D3;
  --tool-light: #FDF4FF;
  --tool-gradient: linear-gradient(135deg, #F472B6 0%, #D946EF 100%);
  --tool-glow: rgba(217, 70, 239, 0.35);
}

/* Universal Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;

  /* Modern Ambient Aurora & Dot-Matrix Texture Background */
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(229, 50, 45, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 90% 15%, rgba(79, 70, 229, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.04) 0%, transparent 50%),
    radial-gradient(rgba(148, 163, 184, 0.18) 1.2px, transparent 1.2px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px;
  background-position: 0 0, 0 0, 0 0, 14px 14px;
}

html.dark body {
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.14) 0%, transparent 60%),
    radial-gradient(rgba(51, 65, 85, 0.4) 1.2px, transparent 1.2px);
}

/* ==========================================================================
   AMBIENT BACKGROUND AURORA GLOW ORBS (Never Boring!)
   ========================================================================== */
.bg-ambient-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 650px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora-orb-1 {
  position: absolute;
  top: -80px;
  left: 10%;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(59, 130, 246, 0.05) 70%, transparent 100%);
  filter: blur(80px);
}

.aurora-orb-2 {
  position: absolute;
  top: -60px;
  right: 12%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.14) 0%, rgba(249, 115, 22, 0.05) 70%, transparent 100%);
  filter: blur(85px);
}

.aurora-orb-3 {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 550px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.04) 70%, transparent 100%);
  filter: blur(90px);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   MODERN GLASS HEADER & HARMONIZED NAVIGATION
   ========================================================================== */
.modern-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.25s ease;
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 12px var(--brand-glow);
}

.header-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-pill {
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 9999px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-pill:hover {
  color: var(--text-main);
  background: var(--bg-surface-subtle);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.quick-search-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.kbd-shortcut {
  font-size: 0.7rem;
  padding: 1px 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-weight: 700;
}

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

/* ==========================================================================
   COMPACT & IMPACTFUL HERO SECTION (Tools Visible Above The Fold!)
   ========================================================================== */
.hero-wrapper {
  position: relative;
  padding: 16px 16px 8px;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
  z-index: 1;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--brand-primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 6px;
  color: var(--text-main);
  letter-spacing: -0.025em;
}

.hero-title .highlight-text {
  background: linear-gradient(135deg, #E5322D 0%, #F97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 620px;
  margin: 0 auto 12px;
}

/* Search bar on Hero (Compact & Elegant) */
.hero-search-box {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.hero-search-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 46px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  font-size: 0.95rem;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.hero-search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px var(--brand-glow);
}

.hero-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Category Filter Pills (Compact & Harmonious) */
.category-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px auto 10px;
  max-width: 820px;
}

.category-tab {
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 700;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.category-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.category-tab.active {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 14px var(--brand-glow);
}

/* ==========================================================================
   COLORFUL TOOL CARDS GRID (iLovePDF Style, Vivid & Clean)
   ========================================================================== */
.tools-grid-section {
  max-width: 1300px;
  margin: 0 auto;
  padding: 10px 24px 64px;
  width: 100%;
  z-index: 1;
  position: relative;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 22px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--tool-gradient));
  opacity: 0.35;
  transition: opacity 0.25s ease, height 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border, var(--border-strong));
  box-shadow: 0 14px 28px -4px var(--card-glow, rgba(0, 0, 0, 0.08));
}

.tool-card:hover::before {
  opacity: 1;
  height: 4px;
}

.tool-card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--icon-bg, #EEF2FF);
  color: var(--icon-color, #4F46E5);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool-card:hover .tool-card-icon-wrap {
  transform: scale(1.1);
}

.tool-card-title {
  font-size: 1.18rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-main);
}

.tool-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.tool-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-faint);
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.tool-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--icon-bg, var(--bg-surface-subtle));
  color: var(--icon-color, var(--text-muted));
  font-weight: 700;
}

/* ==========================================================================
   INTERACTIVE WORKBENCH & COLORFUL DROPZONE
   ========================================================================== */
.workbench-container {
  max-width: 1140px;
  margin: 20px auto 64px;
  padding: 0 20px;
  width: 100%;
  z-index: 1;
  position: relative;
}

.modern-dropzone {
  position: relative;
  background: var(--bg-surface);
  border: 2px dashed var(--border-strong);
  border-radius: 24px;
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.modern-dropzone:hover, .modern-dropzone.drag-over {
  border-color: var(--tool-color, #4F46E5);
  background: var(--tool-light, #EEF2FF);
  box-shadow: 0 0 0 8px var(--tool-glow, rgba(79, 70, 229, 0.2));
  transform: scale(1.006);
}

.dropzone-icon-circle {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: var(--tool-gradient, var(--brand-gradient));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 22px var(--tool-glow, var(--brand-glow));
}

.dropzone-heading {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.dropzone-subtext {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.dropzone-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 34px;
  background: var(--tool-gradient, var(--brand-gradient));
  color: #FFFFFF;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 6px 16px var(--tool-glow, var(--brand-glow));
  transition: all 0.2s ease;
}

.dropzone-select-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px var(--tool-glow, var(--brand-glow));
}

.privacy-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 5px 14px;
  background: var(--bg-surface-subtle);
  border-radius: 9999px;
  font-weight: 600;
}

/* ==========================================================================
   TOOL OPTIONS PANEL (Compression Presets, Watermark, Signature, Numbers)
   ========================================================================== */
.tool-options-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 22px;
  margin-top: 20px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}

.options-heading {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.compress-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.compress-card-option {
  position: relative;
  background: var(--bg-surface-subtle);
  border: 2px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.compress-card-option:hover {
  border-color: var(--tool-color, #10B981);
}

.compress-card-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.compress-card-option.active {
  border-color: var(--tool-color, #10B981);
  background: var(--tool-light, #ECFDF5);
  box-shadow: 0 4px 14px var(--tool-glow, rgba(16, 185, 129, 0.25));
}

.compress-opt-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.compress-opt-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.watermark-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-muted);
}

.modern-text-input {
  height: 44px;
  padding: 0 14px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.925rem;
}

.modern-text-input:focus {
  outline: none;
  border-color: var(--tool-color, #4F46E5);
}

/* ==========================================================================
   VISUAL PAGE WORKBENCH (CANVAS CARDS)
   ========================================================================== */
.pages-workbench {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow-card);
  margin-top: 20px;
  backdrop-filter: blur(12px);
}

.workbench-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.workbench-title-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-count-badge {
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--tool-light, #EEF2FF);
  color: var(--tool-color, #4F46E5);
  font-weight: 800;
  font-size: 0.85rem;
}

.workbench-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-secondary {
  padding: 8px 16px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

.page-thumb-card {
  position: relative;
  background: var(--bg-surface-subtle);
  border: 2px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}

.page-thumb-card:hover {
  border-color: var(--tool-color, #4F46E5);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.page-thumb-card.sortable-ghost {
  opacity: 0.35;
  border-color: var(--tool-color, #4F46E5);
}

.page-thumb-canvas-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.page-thumb-canvas-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.page-card-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 4px;
}

.page-num-label {
  font-size: 0.825rem;
  font-weight: 800;
  color: var(--text-muted);
}

.page-card-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.page-btn:hover {
  color: var(--tool-color, #4F46E5);
  border-color: var(--tool-color, #4F46E5);
}

.page-btn.delete-btn:hover {
  color: #EF4444;
  border-color: #EF4444;
}

/* ==========================================================================
   FLOATING ACTION & PROCESSING BAR
   ========================================================================== */
.floating-action-bar {
  position: sticky;
  bottom: 20px;
  z-index: 90;
  max-width: 860px;
  margin: 28px auto 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-floating);
  flex-wrap: wrap;
  gap: 14px;
}

.action-bar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.process-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 36px;
  background: var(--tool-gradient, var(--brand-gradient));
  color: #FFFFFF;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 4px 16px var(--tool-glow, var(--brand-glow));
  transition: all 0.2s ease;
}

.process-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--tool-glow, var(--brand-glow));
}

.process-cta-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   DOWNLOAD SUCCESS CARD
   ========================================================================== */
.download-success-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 48px 28px;
  text-align: center;
  max-width: 680px;
  margin: 36px auto;
  box-shadow: var(--shadow-floating);
  backdrop-filter: blur(12px);
}

.success-check-icon {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  background: #10B981;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.download-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 40px;
  background: var(--tool-gradient, var(--brand-gradient));
  color: #FFFFFF;
  border-radius: 14px;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 6px 20px var(--tool-glow, var(--brand-glow));
  transition: all 0.2s ease;
  margin: 20px 0 14px;
}

.download-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--tool-glow, var(--brand-glow));
}

.savings-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: 8px;
}

.clean-ad-box {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ad-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* ==========================================================================
   COMMAND PALETTE (CTRL+K SEARCH)
   ========================================================================== */
.command-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.command-palette-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.command-palette-modal {
  width: 90%;
  max-width: 600px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.command-palette-backdrop.open .command-palette-modal {
  transform: scale(1);
}

.command-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.command-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: var(--text-main);
  font-family: inherit;
}

.command-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
}

.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text-main);
  transition: background 0.15s ease;
  cursor: pointer;
}

.command-item:hover, .command-item.selected {
  background: var(--bg-surface-subtle);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.modern-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  padding: 56px 24px 28px;
  backdrop-filter: blur(12px);
  z-index: 1;
  position: relative;
}

.footer-container {
  max-width: 1300px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 12px;
  max-width: 320px;
}

.footer-col-title {
  font-size: 0.925rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.885rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-faint);
  font-size: 0.825rem;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.95rem;
  }
  .header-nav-links {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .pages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==============================================================================
   Rich SEO Sections: FAQ Accordion, Specs & Related Tools
   ============================================================================== */

.tool-faq-section {
  padding: 56px 20px;
  background: var(--bg-surface-subtle);
  border-top: 1px solid var(--border-subtle);
}

.faq-container {
  max-width: 900px;
  margin: 0 auto;
}

.faq-title {
  font-size: 2.15rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.faq-subtitle {
  color: var(--text-muted);
  text-align: center;
  font-size: 1rem;
  margin-bottom: 36px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

details.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px 24px;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

details.faq-item:hover {
  border-color: rgba(79, 70, 229, 0.3);
}

details.faq-item[open] {
  border-color: rgba(79, 70, 229, 0.4);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.06);
}

summary.faq-question {
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-heading);
  user-select: none;
}

summary.faq-question::-webkit-details-marker {
  display: none;
}

summary.faq-question::after {
  content: "+";
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--brand-primary);
  line-height: 1;
  transition: transform 0.2s ease;
}

details.faq-item[open] summary.faq-question::after {
  content: "−";
  color: var(--brand-primary);
}

.faq-answer {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

/* Tool Technical Specifications */
.tool-specs-section {
  padding: 48px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1050px;
  margin: 0 auto;
}

.spec-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spec-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.spec-card-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
}

.spec-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Related Tools & Complementary Workflows */
.related-tools-section {
  padding: 56px 20px 72px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.related-tools-container {
  max-width: 1050px;
  margin: 0 auto;
}

.related-tools-title {
  font-size: 1.85rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.related-tools-sub {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.related-tool-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 14px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.related-tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.08);
}

.related-tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.related-tool-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text-heading);
}

.related-tool-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}



/* Semantic Capabilities & Search Intent Section */
.tool-capabilities-section {
  padding: 56px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.capabilities-container {
  max-width: 1050px;
  margin: 0 auto;
}

.capabilities-header {
  text-align: center;
  margin-bottom: 36px;
}

.capabilities-title {
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.capabilities-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.capability-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.capability-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-card);
}

.capability-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.capability-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--tool-light);
  color: var(--tool-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.capability-badge {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(229, 50, 45, 0.1);
  color: var(--brand-primary);
  border: 1px solid rgba(229, 50, 45, 0.2);
}

.capability-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 10px;
}

.capability-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex-grow: 1;
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
}

.capability-tag {
  font-size: 0.75rem;
  color: var(--text-faint);
  background: var(--bg-surface);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}
