/* ===================== */
/* DESIGN TOKENS & CSS VARIABLES */
/* ===================== */
:root {
  /* Color Palette - Light Mode */
  --color-primary: #007aff;      /* A cleaner, more modern blue */
  --color-primary-dark: #005bb5;
  --color-primary-light: #66b2ff;
  --color-secondary: #34495e;    /* Kept for consistency */
  --color-secondary-dark: #2c3e50;
  --color-accent: #34c759;       /* A fresh, modern green */
  --color-accent-alt: #5ac8fa;   /* A lighter, complementary blue */
  --color-warning: #ff9500;      /* A vibrant orange */
  --color-error: #ff3b30;        /* A modern red */
  --color-success: #34c759;
  
  /* Surface Colors */
  --color-surface: #ffffff;
  --color-surface-alt: #f2f2f7;  /* A slightly cooler light gray */
  --color-surface-elevated: #ffffff;
  
  /* Enhanced Light Mode Background - Professional Gradient */
  --color-background: linear-gradient(135deg, 
    #f8fafc 0%,      /* Pure, clean white-blue */
    #f1f5f9 25%,     /* Subtle cool gray */
    #ffffff 50%,     /* Pure white center */
    #fafbfc 75%,     /* Warm white */
    #f6f8fa 100%     /* Cool finish */
  );
  --color-background-alt: #ffffff;
  
  /* Gradient variants for different sections */
  --bg-gradient-subtle: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  --bg-gradient-warm: linear-gradient(135deg, #fefefe 0%, #f9fafb 50%, #f6f8fa 100%);
  --bg-gradient-cool: linear-gradient(125deg, #f8fafc 0%, #f1f5f9 50%, #ffffff 100%);
  --bg-gradient-editor: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  
  /* Background attachment for performance and responsiveness */
  --bg-attachment: fixed;
  --bg-size: 100% 100%;
  --bg-repeat: no-repeat;
  
  /* Text Colors */
  --color-text-primary: #1d1d1f; /* Near-black for high contrast */
  --color-text-secondary: #6e6e73; /* A softer gray for secondary text */
  --color-text-muted: #8a8a8e;
  --color-text-inverse: #ffffff;
  
  /* Border Colors */
  --color-border: #d1d1d6;      /* A softer border color */
  --color-border-light: rgba(0, 122, 255, 0.1);
  --color-border-focus: rgba(0, 122, 255, 0.4);
  
  /* Interactive Colors */
  --color-interactive: #007aff;
  --color-interactive-hover: #005bb5;
  --color-interactive-active: #004080;
  --color-interactive-disabled: #e5e5ea;
  
  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-family-mono: 'SF Mono', 'Menlo', 'Consolas', 'Monaco', monospace;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2.25rem; /* Slightly larger for more impact */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem; /* Increased for more white space */
  --space-3xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;  /* More rounded */
  --radius-lg: 12px; /* More rounded */
  --radius-xl: 16px;
  --radius-full: 9999px; /* Use a large value for full rounding */
  
  /* Shadows - Softer and more subtle */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 3px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.07);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.08);
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Dark Mode Variables with Better Contrast */
body.dark-mode {
  --color-primary: #0a84ff;
  --color-primary-dark: #339aff;
  --color-primary-light: #66bfff;
  --color-secondary: #545454;
  --color-secondary-dark: #333333;
  --color-accent: #30d158;
  --color-accent-alt: #64d2ff;
  --color-warning: #ff9f0a;
  --color-error: #ff453a;
  --color-success: #30d158;
  
  /* Enhanced Dark Mode Surfaces with Better Contrast */
  --color-surface: #1c1c1e;
  --color-surface-alt: #2c2c2e;
  --color-surface-elevated: #3a3a3c;
  --color-background: #000000;
  --color-background-alt: #1c1c1e;
  
  /* Improved Dark Mode Text with Better Contrast Ratios */
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(235, 235, 245, 0.6);
  --color-text-muted: rgba(235, 235, 245, 0.3);
  --color-text-inverse: #000000;
  
  /* Enhanced Dark Mode Borders */
  --color-border: #38383a;
  --color-border-light: rgba(10, 132, 255, 0.2);
  --color-border-focus: rgba(10, 132, 255, 0.5);
  
  /* Improved Dark Mode Interactive Elements */
  --color-interactive: #0a84ff;
  --color-interactive-hover: #339aff;
  --color-interactive-active: #66bfff;
  --color-interactive-disabled: #38383a;
  
  /* Apply dark mode background and text colors */
  background-color: var(--color-background);
  color: var(--color-text-primary);
  
  /* Enhanced Dark Mode Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 3px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.5);
}

/* Global & Layout */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

/* Global box-sizing fix to prevent horizontal overflow */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body { 
  height: 100%; 
  width: 100%; 
}

html { 
  scroll-behavior: smooth; 
}

body { 
  font-family: var(--font-family-base);
  background: var(--color-background);
  background-attachment: var(--bg-attachment);
  background-size: var(--bg-size);
  background-repeat: var(--bg-repeat);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  position: relative;
  overflow-x: hidden; /* Prevent horizontal scroll from gradient */
}

/* Responsive background optimizations */
@media (max-width: 768px) {
  body {
    background-attachment: scroll; /* Better performance on mobile */
    background-size: 100% auto;
  }
}

/* High-performance mode for older devices */
@media (prefers-reduced-motion: reduce) {
  body {
    background: var(--color-surface); /* Fallback to solid color */
    background-attachment: scroll;
  }
}

/* Enhanced Typography Consistency */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

h1 { 
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
}

/* Duplicate h2/h3/h4 definitions removed; see ENHANCED TYPOGRAPHY HIERARCHY section for sizes and spacing */

/* Duplicate paragraph base removed; consolidated later in ENHANCED TYPOGRAPHY HIERARCHY */

h5, h6 { 
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

/* Link consistency */
a {
  color: var(--color-interactive);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Button typography standardization */
.btn, .cta-btn, .format-btn, .nav-link {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  text-decoration: none;
  transition: all var(--transition-fast);
}

/* Enhanced Focus Management for Accessibility */
*:focus {
  outline: 2px solid var(--color-interactive);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-interactive);
  outline-offset: 2px;
}

/* Skip to main content for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--space-sm);
  background: var(--color-interactive);
  color: var(--color-text-inverse);
  padding: var(--space-sm);
  text-decoration: none;
  z-index: 10000;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
}

/* Enhanced high contrast support */
@media (prefers-contrast: high) {
  * {
    border-color: currentColor !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Enhanced theme transitions with smoother animation */
body.theme-transitioning,
body.theme-transitioning * {
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              fill 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              stroke 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Utility Classes */
.hidden-compat {
  display: none !important;
  visibility: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Smooth transitions for common elements during theme change */
.navbar, .panel, .preview, .editor, .modal-content, .btn, .dropdown-menu {
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================== */
/* ENHANCED LIGHT MODE COMPONENTS */
/* ===================== */

/* Light mode panel enhancements with subtle gradients */
body:not(.dark-mode) .panel {
  background: var(--bg-gradient-subtle);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 
              0 2px 4px -1px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(8px);
}

/* Light mode editor enhancements */
body:not(.dark-mode) .editor {
  background: var(--bg-gradient-editor);
  border: 1px solid rgba(241, 245, 249, 0.6);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Light mode preview enhancements */
body:not(.dark-mode) .preview {
  background: var(--bg-gradient-warm);
}

/* Light mode modal enhancements */
body:not(.dark-mode) .modal-content {
  background: var(--bg-gradient-cool);
  border: 1px solid rgba(241, 245, 249, 0.8);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(16px);
}

/* Light mode button enhancements */
body:not(.dark-mode) .btn {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(241, 245, 249, 0.6);
}

body:not(.dark-mode) .btn:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Light mode navbar enhancements */
body:not(.dark-mode) .navbar {
  background: rgba(255, 255, 255, 0.65); /* Semi-transparent background for glass effect */
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(229, 229, 231, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: sticky; /* Make navbar sticky */
  top: 0;
  z-index: 1020; /* Ensure it's above other content */
}

/* Ensure navbar text is visible in light mode */
body:not(.dark-mode) .navbar .navbar-brand,
body:not(.dark-mode) .navbar .nav-link,
body:not(.dark-mode) .navbar .btn {
  color: var(--color-text-primary) !important;
}

body:not(.dark-mode) .navbar .theme-switcher .fa-sun {
  color: var(--color-text-primary) !important;
}

/* Responsive navbar visibility */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }
  
  .navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  /* You may need a toggle button for mobile navigation if you have many links */
}

/* Enhance other components with liquid glass effect */
body:not(.dark-mode) .panel {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid rgba(229, 229, 231, 0.6);
}

body:not(.dark-mode) .modal-content {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(229, 229, 231, 0.8);
}

/* Add liquid animation on scroll */
@keyframes liquid-scroll {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

body:not(.dark-mode) {
  background-size: 200% 200%;
  animation: liquid-scroll 30s ease-in-out infinite alternate;
}

/* ===================== */
/* RESPONSIVE GRADIENT OPTIMIZATIONS */
/* ===================== */

/* High-DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body:not(.dark-mode) {
    background-size: 100% 100%;
    will-change: transform; /* Optimize for smooth scrolling */
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  body:not(.dark-mode) {
    background-attachment: scroll; /* Better performance */
    background-image: linear-gradient(180deg, 
      #f8fafc 0%, 
      #ffffff 50%, 
      #fafbfc 100%
    ); /* Simpler gradient for mobile */
  }
  
  /* Reduce backdrop blur on mobile for performance */
  body:not(.dark-mode) .panel,
  body:not(.dark-mode) .modal-content {
    backdrop-filter: blur(4px);
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  body:not(.dark-mode) {
    background-size: 100% 120%; /* Slight stretch for better coverage */
  }
}

/* Large screen enhancements */
@media (min-width: 1400px) {
  body:not(.dark-mode) {
    background-image: linear-gradient(135deg, 
      #f8fafc 0%,
      #f1f5f9 20%,
      #ffffff 40%,
      #fafbfc 60%,
      #f6f8fa 80%,
      #f3f4f6 100%
    ); /* More detailed gradient for large screens */
  }
}

/* Dark mode preservation - ensure no gradient interference */
body.dark-mode {
  background: var(--color-background-dark, #1e1e1e) !important;
  background-attachment: scroll !important;
}

/* Print mode - use solid background */
@media print {
  body {
    background: #ffffff !important;
    background-image: none !important;
  }
}

/* Enhanced scrollbar styling with theme support */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface-alt);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-sm);
  transition: background var(--transition-base);
}

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

/* Preview pane specific scrollbar - more visible */
.preview::-webkit-scrollbar {
  width: 12px;
}

.preview::-webkit-scrollbar-track {
  background: var(--color-background-alt);
  border-radius: var(--radius-md);
}

.preview::-webkit-scrollbar-thumb {
  background: var(--color-text-secondary);
  border-radius: var(--radius-md);
}

.preview::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-primary);
}

/* ===================== */
/* ENHANCED TOOLTIPS & ACCESSIBILITY */
/* ===================== */

/* Tooltip Base Styling */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 1000;
}

.tooltip:hover::before,
.tooltip:focus::before,
.tooltip:hover::after,
.tooltip:focus::after {
  opacity: 1;
  visibility: visible;
}

/* Dark mode tooltips */
body.dark-mode .tooltip::before {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .tooltip::after {
  border-top-color: rgba(255, 255, 255, 0.95);
}

/* Enhanced button accessibility and hover states */
/* ===================== */

/* Modal utility classes */
.modal-visible {
  display: flex !important;
}

.modal-hidden {
  display: none !important;
}

.modal-content-stats {
  max-width: 400px;
}

/* Removed earlier minimal stats-grid and stat-item stub in favor of detailed Stats Modal section further below. */

/* Format button hover states for CSP compliance */
.format-btn-hover {
  background: rgba(25, 118, 210, 0.1) !important;
}

.format-btn-no-hover {
  background: none !important;
}

/* Button state classes */
.btn-highlighted {
  background: var(--color-interactive);
  color: var(--color-text-inverse);
  border-color: var(--color-interactive);
}

.btn-normal {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

/* Template selector state classes */
.template-highlighted {
  background: var(--color-interactive) !important;
  color: var(--color-text-inverse) !important;
}

.template-normal {
  background: var(--color-surface) !important;
  color: var(--color-text-primary) !important;
}

/* Panel resizing classes */
.resizing-active {
  cursor: col-resize !important;
}

.panel-resizing .panel {
  pointer-events: none;
  user-select: none;
}

.modal-content-emoji {
  max-width: 500px;
}

.emoji-grid-container {
  max-height: 300px;
  overflow-y: auto;
  padding: var(--space-md) 0;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: var(--space-sm);
}

.emoji-btn {
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.emoji-btn:hover {
  background: var(--color-surface-alt);
}

.emoji-btn:focus {
  outline: 2px solid var(--color-interactive);
  outline-offset: 2px;
}

/* Template selector scoped to toolbar to avoid duplicates */
.toolbar .template-selector {
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  margin-right: var(--space-sm);
  min-width: 150px;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toolbar .template-selector:hover {
  border-color: var(--color-interactive);
}

.toolbar .template-selector:focus {
  outline: 2px solid var(--color-interactive);
  outline-offset: 2px;
  border-color: var(--color-interactive);
}

.notification-template {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  background: var(--color-success);
  color: var(--color-text-inverse);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  animation: slideInRight 0.3s ease;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.modal-content-image {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.image-preview-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.image-info {
  margin-top: var(--space-md);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.image-actions {
  margin-top: var(--space-md);
}

.btn-remove {
  background: var(--color-error);
  color: var(--color-text-inverse);
  border: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: background var(--transition-fast);
}

.btn-remove:hover {
  background: #d32f2f;
}

.btn-remove:focus {
  outline: 2px solid var(--color-interactive);
  outline-offset: 2px;
}

.navbar-menu-animate {
  transform: translateY(0) !important;
}

.autosave-indicator {
  position: fixed;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--color-success);
  color: var(--color-text-inverse);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.autosave-indicator-visible {
  opacity: 1;
}

/* Dark mode image preview */
body.dark-mode .image-info {
  color: var(--color-text-secondary);
}

.notification-template-exit {
  animation: slideOutRight 0.3s ease;
}

/* Dark mode emoji button */
body.dark-mode .emoji-btn:hover {
  background: var(--color-surface-elevated);
}

/* ===================== */
/* ENHANCED BUTTON SYSTEM WITH CONSISTENCY FIXES */
/* ===================== */

/* Base button styles with design tokens */
.btn, .help-action-btn, .qa-btn, .format-btn {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  text-decoration: none;
  user-select: none;
  min-height: 40px; /* Consistent minimum touch target */
}

/* Enhanced focus styles for accessibility */
.btn:focus, .help-action-btn:focus, .qa-btn:focus, .format-btn:focus {
  outline: 2px solid var(--color-interactive);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--color-border-focus);
}

/* Improved hover states with better visual feedback */
.btn:hover, .qa-btn:hover, .format-btn:hover, .help-action-btn:hover {
  background: var(--color-surface-elevated);
  border-color: var(--color-interactive);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Active state */
.btn:active, .qa-btn:active, .format-btn:active, .help-action-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Disabled state */
.btn:disabled, .qa-btn:disabled, .format-btn:disabled, .help-action-btn:disabled {
  background: var(--color-interactive-disabled);
  color: var(--color-text-muted);
  border-color: var(--color-interactive-disabled);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* Primary button variant */
.btn-primary, .help-action-btn {
  background: var(--color-interactive);
  color: var(--color-text-inverse);
  border-color: var(--color-interactive);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover, .help-action-btn:hover {
  background: var(--color-interactive-hover);
  border-color: var(--color-interactive-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--color-text-inverse);
  text-decoration: none;
}

/* Secondary button variant */
.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-interactive);
}

/* Specific action button themes */
.help-action-btn.guide {
  background: var(--color-accent-alt);
  border-color: var(--color-accent-alt);
}

.help-action-btn.guide:hover {
  background: #2980b9;
  border-color: #2980b9;
}

.help-action-btn.features {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.help-action-btn.features:hover {
  background: #229954;
  border-color: #229954;
}

.help-action-btn.tutorial {
  background: var(--color-error);
  border-color: var(--color-error);
}

.help-action-btn.tutorial:hover {
  background: #c0392b;
  border-color: #c0392b;
}

/* Dark mode button enhancements */
body.dark-mode .btn, 
body.dark-mode .qa-btn, 
body.dark-mode .format-btn {
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

body.dark-mode .btn:hover,
body.dark-mode .qa-btn:hover,
body.dark-mode .format-btn:hover {
  background: var(--color-interactive);
  color: var(--color-text-inverse);
  border-color: var(--color-interactive);
}

body.dark-mode .btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

body.dark-mode .btn-secondary:hover {
  background: var(--color-surface-elevated);
  border-color: var(--color-interactive);
}

/* ===================== */
/* ENHANCED HERO SECTION WITH IMPROVED UX */
/* ===================== */

.hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-text-inverse);
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dark mode hero with better contrast */
body.dark-mode .hero-section {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: var(--color-text-primary);
}

/* Hero background pattern for better visual appeal */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
  pointer-events: none;
}

body.dark-mode .hero-section::before {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.2;
}

.intro-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-lg);
  color: rgba(255, 255, 255, 0.95);
  position: relative;
  z-index: 1;
}

.hero-description {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  margin-bottom: var(--space-2xl);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.9);
}

/* Enhanced CTA Section */
.hero-cta {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
  position: relative;
  z-index: 1;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cta-btn.primary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary);
  box-shadow: var(--shadow-lg);
}

.cta-btn.primary:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.cta-btn.primary:focus {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.cta-btn.secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.5);
}

.cta-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.cta-btn.secondary:focus {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Dark mode CTA adjustments */
body.dark-mode .hero-subtitle,
body.dark-mode .hero-description {
  color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .hero-title,
body.dark-mode .hero-subtitle,
body.dark-mode .hero-description {
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Trust Indicators */
.trust-indicators {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-top: var(--space-xl);
  position: relative;
  z-index: 1;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.trust-icon {
  font-size: var(--font-size-lg);
}

/* Enhanced Feature Cards */
.feature-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
  position: relative;
  z-index: 1;
}

.highlight-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.highlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.highlight-card:hover::before {
  left: 100%;
}

.highlight-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.highlight-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  display: block;
}

.highlight-card h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-md);
  color: rgba(255, 255, 255, 0.95);
}

.highlight-card p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

/* Dark mode feature cards are defined in the ENHANCED CARD SYSTEM section */
/* ===================== */
/* ENHANCED TYPOGRAPHY HIERARCHY */
/* ===================== */

/* Page titles and main headings */
.page-title, h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin-bottom: var(--space-xl);
  color: var(--color-text-primary);
  text-align: center;
}

/* Section headings */
h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
}

/* Subsection headings */
h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--color-text-primary);
}

/* Card and component titles */
h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
}

/* Consistent paragraph spacing */
p {
  line-height: 1.6;
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
}

/* Icon headings for feature cards */
.icon-heading {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.icon-heading .icon {
  font-size: 1.5em;
  color: var(--color-interactive);
}

/* ===================== */
/* ENHANCED CARD SYSTEM WITH DARK MODE FIXES */
/* ===================== */

.highlight-card, .help-card, .why-choose-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
}

.highlight-card:hover, .help-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border-focus);
}

/* Dark mode card fixes */
body.dark-mode .highlight-card,
body.dark-mode .help-card,
body.dark-mode .why-choose-item {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
}

body.dark-mode .highlight-card:hover,
body.dark-mode .help-card:hover {
  box-shadow: var(--shadow-xl);
  border-color: var(--color-border-focus);
}

/* Hero section cards with better transparency */
.hero-section .highlight-card {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
}

body.dark-mode .hero-section .highlight-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Feature category cards */
.feature-category-card, .category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  text-align: center;
  cursor: pointer;
}

.feature-category-card:hover, .category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-interactive);
}

.feature-category-card .icon, .category-card .icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
  transition: transform var(--transition-base);
}

.feature-category-card:hover .icon, .category-card:hover .icon {
  transform: scale(1.1);
}

/* Dark mode feature cards */
body.dark-mode .feature-category-card,
body.dark-mode .category-card {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
}

body.dark-mode .feature-category-card:hover,
body.dark-mode .category-card:hover {
  box-shadow: var(--shadow-xl);
  border-color: var(--color-interactive);
}

/* ===================== */
/* CONSISTENT LAYOUT & SPACING */
/* ===================== */

/* Page content containers */
.page-content, .page-content-padded {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* Section spacing */
.content-section {
  margin-bottom: var(--space-3xl);
  padding: var(--space-xl) 0;
}

.content-section:first-child {
  padding-top: var(--space-lg);
}

/* Grid layouts for feature cards */
.feature-grid, .category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  margin: var(--space-xl) 0;
}

/* Consistent button groups */
.button-group {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
  margin: var(--space-lg) 0;
}

/* List improvements */
ul, ol {
  margin: var(--space-md) 0;
  padding-left: var(--space-xl);
}

li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

/* Table improvements */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th, td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-surface-alt);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

/* Dark mode table styling */
body.dark-mode table {
  border: 1px solid var(--color-border);
}

body.dark-mode th {
  background: var(--color-surface-elevated);
}

body.dark-mode td {
  border-bottom-color: var(--color-border);
}

/* ===================== */
/* STICKY TABLE OF CONTENTS */
/* ===================== */

/* Sticky TOC for tutorial pages */
.sticky-toc {
  position: fixed;
  top: 80px; /* Below navbar */
  right: 20px;
  width: 250px;
  max-height: calc(100vh - 120px);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  z-index: 999;
  transition: all var(--transition-base);
}

.sticky-toc h3 {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-sm);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: var(--space-xs);
}

.toc-link {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
  line-height: 1.4;
}

.toc-link:hover {
  background: var(--color-surface-alt);
  color: var(--color-interactive);
  transform: translateX(4px);
}

.toc-link.active {
  background: var(--color-interactive);
  color: white;
  font-weight: var(--font-weight-medium);
}

/* Nested TOC items */
.toc-item.nested {
  margin-left: var(--space-md);
}

.toc-item.nested .toc-link {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* TOC toggle button for mobile */
.toc-toggle {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--color-interactive);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  display: none; /* Hidden by default, shown on mobile */
}

.toc-toggle:hover {
  background: var(--color-interactive-hover);
  transform: scale(1.1);
}

/* Dark mode TOC styling */
body.dark-mode .sticky-toc {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xl);
}

body.dark-mode .toc-link:hover {
  background: var(--color-surface-elevated);
}

/* Mobile responsiveness */
@media (max-width: 1024px) {
  .sticky-toc {
    display: none;
    position: fixed;
    top: 80px;
    right: 20px;
    left: 20px;
    width: auto;
  }
  
  .sticky-toc.visible {
    display: block;
  }
  
  .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Hide TOC on very small screens */
@media (max-width: 768px) {
  .sticky-toc {
    left: 10px;
    right: 10px;
  }
}

/* ===================== */
/* ENHANCED CODE BLOCKS & SYNTAX HIGHLIGHTING */
/* ===================== */

/* Code block improvements */
pre, .code-block {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  overflow-x: auto;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  color: var(--color-text-primary);
  position: relative;
}

/* Inline code improvements */
code:not(pre code) {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.2em 0.4em;
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  color: var(--color-text-primary);
}

/* Syntax highlighting improvements */
.hljs {
  background: var(--color-surface-alt) !important;
  color: var(--color-text-primary) !important;
  padding: var(--space-lg) !important;
  border-radius: var(--radius-lg) !important;
}

/* Dark mode code block styling */
body.dark-mode pre,
body.dark-mode .code-block {
  background: #1a1a1a;
  border-color: #404040;
  color: #e8e8e8;
}

body.dark-mode code:not(pre code) {
  background: #2a2a2a;
  border-color: #404040;
  color: #e8e8e8;
}

body.dark-mode .hljs {
  background: #1a1a1a !important;
  color: #e8e8e8 !important;
}

/* Copy button for code blocks */
.code-block-container {
  position: relative;
}

.copy-code-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--color-interactive);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
}

.code-block-container:hover .copy-code-btn {
  opacity: 1;
}

.copy-code-btn:hover {
  background: var(--color-interactive-hover);
}

/* ===================== */
/* LIST ALIGNMENT AND ICON FIXES */
/* ===================== */

.why-choose-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.why-choose-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: var(--space-md);
}

.why-choose-check {
  /* removed duplicate color/font-size; keep final intended values */
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-success);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
}

.why-choose-text {
  flex: 1;
  line-height: 1.5;
}

/* Dark mode list fixes */
body.dark-mode .why-choose-check {
  background: var(--color-success);
  color: var(--color-text-inverse);
}

/* ===================== */
/* ENHANCED QUICK ACCESS PANEL WITH CONSISTENCY FIXES */
/* ===================== */

.quick-access-toolbar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  box-shadow: var(--shadow-sm);
}

.quick-access-container {
  max-width: 1200px;
  margin: 0 auto;
}

.quick-access-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
  text-align: center;
}

.quick-access-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: flex-start;
  justify-content: space-between;
}

.qa-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 150px;
  flex: 1;
}

.qa-group-label {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.qa-buttons, .qa-inputs, .qa-controls {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.qa-btn {
  padding: var(--space-sm);
  min-width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
}

.qa-input-compact {
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  flex: 1;
  min-width: 100px;
  transition: all var(--transition-fast);
}

.qa-input-compact:focus {
  outline: 2px solid var(--color-interactive);
  outline-offset: 2px;
  border-color: var(--color-interactive);
}

.qa-template-compact {
  width: 100%;
}

/* Export button special styling */
.qa-export {
  background: var(--color-success);
  color: var(--color-text-inverse);
  border-color: var(--color-success);
}

.qa-export:hover:not(:disabled) {
  background: #229954;
  border-color: #229954;
}

.qa-export:disabled {
  background: var(--color-interactive-disabled);
  color: var(--color-text-muted);
  border-color: var(--color-interactive-disabled);
  cursor: not-allowed;
  transform: none;
}

/* Dark mode quick access */
body.dark-mode .quick-access-toolbar {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
}

body.dark-mode .qa-input-compact {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

body.dark-mode .qa-input-compact:focus {
  border-color: var(--color-interactive);
}

/* Enhanced Responsive quick access */
@media (max-width: 1024px) {
  .quick-access-bar {
    gap: var(--space-md);
  }
  
  .qa-group {
    min-width: 140px;
  }
}

@media (max-width: 768px) {
  .quick-access-toolbar {
    padding: var(--space-md);
    margin: var(--space-lg) 0;
  }
  
  .quick-access-bar {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .qa-group {
    min-width: 100%;
  }
  
  .qa-buttons, .qa-inputs {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  
  .qa-btn {
    flex: 1;
    min-width: 44px; /* Minimum touch target size */
    height: 44px;
    font-size: var(--font-size-base);
  }
  
  .qa-input-compact {
    min-width: 120px;
    font-size: var(--font-size-base);
    padding: var(--space-md);
  }
}

@media (max-width: 480px) {
  .quick-access-toolbar {
    padding: var(--space-sm);
    margin: var(--space-md) 0;
  }
  
  .qa-buttons {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .qa-inputs {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .qa-btn, .qa-input-compact {
    width: 100%;
    min-width: unset;
  }
  
  .qa-group-label {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
  }
}

/* ===================== */
/* ENHANCED FORMATTING TOOLBAR WITH RESPONSIVE DESIGN */
/* ===================== */

.formatting-toolbar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.format-btn {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  min-width: auto;
  height: 32px;
  white-space: nowrap;
}

.format-dropdown {
  position: relative;
}

.format-dropdown-menu { /* Batch 5: hidden by default */
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 150px;
  max-height: 300px;
  overflow-y: auto;
  padding: var(--space-xs);
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  transform: translateY(4px);
}

.format-dropdown.active .format-dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.format-dropdown-item {
  width: 100%;
  padding: var(--space-sm);
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  transition: background var(--transition-fast);
}

.format-dropdown-item:hover {
  background: var(--color-surface-alt);
}

.format-dropdown-item:focus {
  outline: 2px solid var(--color-interactive);
  outline-offset: 1px;
}

/* Dark mode toolbar */
body.dark-mode .formatting-toolbar {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
}

body.dark-mode .format-dropdown-menu {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
}

body.dark-mode .format-dropdown-item {
  color: var(--color-text-primary);
}

body.dark-mode .format-dropdown-item:hover {
  background: var(--color-surface-alt);
}

/* Enhanced Responsive toolbar */
@media (max-width: 768px) {
  .formatting-toolbar {
    padding: var(--space-sm);
    gap: var(--space-xs);
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  .formatting-toolbar::-webkit-scrollbar {
    height: 4px;
  }
  
  .formatting-toolbar::-webkit-scrollbar-track {
    background: var(--color-surface-alt);
    border-radius: 2px;
  }
  
  .formatting-toolbar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
  }
  
  .format-btn {
    padding: var(--space-sm);
    min-width: 44px; /* Better touch targets */
    height: 44px;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
  }
  
  .format-dropdown-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 320px;
    max-height: 60vh;
  }
}

@media (max-width: 480px) {
  .formatting-toolbar {
    padding: var(--space-xs);
    margin-bottom: var(--space-xs);
  }
  
  .format-btn {
    padding: var(--space-xs);
    min-width: 40px;
    height: 40px;
    font-size: var(--font-size-xs);
  }
  
  .format-dropdown-menu {
    width: 95vw;
    max-width: 280px;
  }
}

.search-modal-visible {
  display: block !important;
}

.search-modal-hidden {
  display: none !important;
}

.draggable-cursor {
  cursor: move !important;
}

.modal-fixed {
  position: fixed !important;
}

.modal-dragging {
  position: fixed !important;
  transform: none !important;
}

/* Panel resizer states */
.resizer-active {
  transform: scaleX(1.3) !important;
  box-shadow: 0 0 20px rgba(25, 118, 210, 0.3) !important;
}

.resizer-normal {
  transform: none !important;
  box-shadow: none !important;
}

.body-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

.body-normal {
  cursor: auto !important;
  user-select: auto !important;
}

/* Panel flex sizing with custom properties */
.panel[style*="--panel-flex"] {
  flex: var(--panel-flex) !important;
}

.resize-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  z-index: 9999 !important;
  cursor: col-resize !important;
}

/* Dark mode utility overrides */
body.dark-mode .stat-item {
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
}

body.dark-mode .format-btn-hover {
  background: rgba(100, 181, 246, 0.15) !important;
}

/* ================================= */
/* ENHANCED NAVBAR - MODERN & ACCESSIBLE */
/* ================================= */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
  background: rgba(28, 37, 49, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  min-height: 72px;
  gap: 1.5rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo {
  font-size: 1.6rem;
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary); /* Changed to primary text color */
  letter-spacing: -1px;
  transition: color var(--transition-base);
}

body.dark-mode .logo {
  color: #ffffff; /* Keep white in dark mode */
}

.logo:hover {
  color: var(--color-primary-light);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.nav-link {
  color: var(--color-text-inverse);
  text-decoration: none;
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  position: relative;
  transition: color var(--transition-base), background-color var(--transition-base);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 5px;
  left: 50%;
  background-color: var(--color-primary-light);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link:hover::after,
.nav-link:focus::after,
.nav-link.active::after {
  width: 60%;
}

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

.navbar-btn {
  font-size: var(--font-size-sm);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  transition: all var(--transition-base);
}

.btn-login {
  background-color: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-login:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: white;
}

.btn-signup {
  background-color: var(--color-primary);
  color: white;
  border: 1px solid var(--color-primary);
}

.btn-signup:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-line {
  width: 28px;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

/* Mobile & Tablet Styles */
@media (max-width: 768px) {
  .navbar-container {
    justify-content: center;
    position: relative;
    padding: 0.5rem 1.5rem;
  }

  .navbar-brand {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
  }

  .navbar-toggle {
    display: flex;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
  }

  .navbar-menu {
    position: fixed;
    top: 72px; /* Height of the navbar */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(28, 37, 49, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  }

  .navbar-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .navbar-nav {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .nav-link {
    font-size: 1.5rem;
    color: white;
  }

  .navbar-actions {
    flex-direction: column;
    gap: 1.5rem;
  }

  .navbar-btn {
    width: 200px;
    text-align: center;
    padding: 1rem;
    font-size: 1.1rem;
  }

  /* Hamburger animation */
  .navbar-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
  }
  .navbar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  .navbar-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
}

.mobile-menu-backdrop {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.mobile-menu-backdrop.active {
  display: block;
}

/* ===================== */
/* FOOTER STYLES - CONSOLIDATED & ENHANCED */
/* ===================== */
.footer {
  position: sticky;
  inset-block-end: 0;
  z-index: 100;
  width: 100%;
  /* CSS Variables for consistency */
  --footer-bg: linear-gradient(135deg, #2c3e50, #34495e);
  --footer-bg-dark: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  --footer-text: #ffffff;
  --footer-accent: #64b5f6;
  --footer-accent-hover: #90caf9;
  --footer-border-dark: #404040;
  --footer-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  --footer-shadow-dark: 0 -1px 4px rgba(0,0,0,0.3);
  
  /* Base styles */
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 0.75rem 0;
  margin-top: auto;
  box-shadow: var(--footer-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  
  /* Smooth transitions */
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation: footerSlideUp 0.6s ease-out;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: clamp(0.75rem, 3vw, 1.5rem);
  flex-wrap: wrap;
  min-height: 60px;
  transition: padding 0.3s ease;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-left p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 500;
  transition: color 0.3s ease;
  opacity: 0.95;
}

.license {
  font-size: 0.8rem;
  opacity: 0.8;
}

.github-link {
  color: var(--footer-accent);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.github-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -1px;
  left: 0;
  background-color: var(--footer-accent-hover);
  transition: width 0.3s ease;
}

.github-link:hover {
  color: var(--footer-accent-hover);
  transform: translateY(-1px);
}

.github-link:hover::after {
  width: 100%;
}

.footer-right {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.footer-btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--footer-text);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: fit-content;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  
  /* Enhanced transitions for dynamic showing/hiding */
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  /* Initial state for smooth animations */
  transform-origin: center;
  will-change: opacity, transform;
}

/* Enhanced hover effects for visible buttons */
.footer-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Loading state for buttons */
.footer-btn.loading {
  pointer-events: none;
  opacity: 0.7;
  transform: scale(0.95);
}

/* Hidden state animations */
.footer-btn.hiding {
  opacity: 0;
  transform: translateY(-10px) scale(0.9);
  pointer-events: none;
}

.footer-btn.showing {
  animation: footerButtonShow 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Keyframes for smooth button animations */
@keyframes footerButtonShow {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes footerButtonHide {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
}

/* Responsive button behavior */
@media (max-width: 768px) {
  .footer-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    gap: 0.25rem;
  }
  
  .footer-btn:hover {
    transform: translateY(-1px) scale(1.01);
  }
}

/* Ensure proper layout when buttons are hidden */
.footer-right {
  min-height: 2.5rem; /* Prevent layout shift when buttons hide/show */
  align-items: center;
}

/* Context-aware button states */
.footer-btn[data-context="stats-only"] {
  /* Stats button specific styles */
  background: rgba(52, 199, 89, 0.15);
  border-color: rgba(52, 199, 89, 0.3);
}

.footer-btn[data-context="editor-only"] {
  /* Editor button specific styles */
  background: rgba(255, 149, 0, 0.15);
  border-color: rgba(255, 149, 0, 0.3);
}

.footer-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.25),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.footer-btn:hover,
.footer-btn:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.footer-btn:hover::before,
.footer-btn:focus-visible::before {
  opacity: 1;
}

.footer-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Dark mode styles */
body.dark-mode .footer {
  background: var(--footer-bg-dark);
  border-top-color: var(--footer-border-dark);
  box-shadow: var(--footer-shadow-dark);
}

body.dark-mode .license {
  color: #bbb;
}

body.dark-mode .github-link {
  color: var(--footer-accent);
}

body.dark-mode .github-link:hover {
  color: var(--footer-accent-hover);
}

/* Responsive design */
@media (max-width: 768px) {
  .footer {
    position: static;
    padding: 1rem 0;
  }
  
  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .footer-left {
    order: 2;
  }
  
  .footer-right {
    order: 1;
    justify-content: center;
  }
  
  .footer-left p {
    font-size: 0.85rem;
  }
  
  .footer-btn {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .footer-right {
    flex-direction: column;
    width: 100%;
  }
  
  .footer-btn {
    width: 100%;
    justify-content: center;
    max-width: 200px;
  }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  .footer-btn:hover::before {
    opacity: 0;
  }
  
  .footer-btn:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.15);
  }
}

/* Animations */
@keyframes footerSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Contextual footer behavior */
.footer[data-page-context] {
  border-top: 2px solid rgba(100, 181, 246, 0.3);
}

/* Smooth transitions for contextual footer buttons */
.footer .footer-btn {
  transition: all 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* Editor button styles */
.footer-btn[data-context="editor-only"]:not(.active) {
  transition: all 0.3s ease;
}

.footer-btn[data-context="editor-only"]:not(.active):hover {
  background: rgba(255, 193, 7, 0.2);
  border-color: rgba(255, 193, 7, 0.4);
  color: #fff;
}

/* Graceful hiding of buttons when not relevant */
.footer .footer-btn[style*="display: none"] {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

/* Stats button should only be visible on index page */
.footer-btn[data-context="stats-only"] {
  display: inline-flex;
}

/* Loading state for editor button */
.footer-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
/* ===================== */

/* ===================== */
/* RESPONSIVE NAVBAR */
/* ===================== */
/* Consolidated mobile styles moved to end of file */

/* ===================== */
/* MAIN LAYOUT UPDATES */
/* ===================== */
#app { 
  display: flex; 
  flex-wrap: nowrap; /* Prevent wrapping on large screens */
  flex: 1;
  min-height: calc(100vh - 120px); /* Fixed minimum height accounting for navbar and footer */
  height: auto; /* Allow natural height expansion */
  max-width: 100%; /* Use full available width */
  margin: 0 auto; /* Center the app */
  padding: 5px 0.25rem; /* Reduced padding to prevent overflow */
  overflow-x: hidden; /* Prevent horizontal scrolling */
  position: relative; /* For resizer positioning */
  box-sizing: border-box; /* Include padding in width calculation */
}

.panel { 
  flex: 1 1 50%; 
  display: flex; 
  flex-direction: column; 
  padding: 1.5rem; /* Increased padding for better spacing */
  overflow: hidden; 
  background: linear-gradient(135deg, #ffffff, #fafbfc); 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Enhanced transition */
  box-shadow: 0 6px 16px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08); /* Enhanced shadow as requested */
  border-radius: 12px; /* Increased border radius for modern look */
  margin: 5px 0.25rem; /* Added responsive top/bottom margin as requested */
  border: 1px solid rgba(25, 118, 210, 0.08);
}

/* Removed duplicate Editor/Preview panel re-definitions.
   Kept the first contiguous block above; additional #editor-panel/#preview-panel blocks later removed. */

/* Panel Resizer - Enhanced with better colors and transitions */
.panel-resizer {
  width: 10px;
  background: linear-gradient(180deg, rgba(25, 118, 210, 0.1), rgba(25, 118, 210, 0.05));
  cursor: col-resize;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
  margin: 0 2px;
}

.panel-resizer:hover {
  background: linear-gradient(180deg, rgba(25, 118, 210, 0.2), rgba(25, 118, 210, 0.1));
  transform: scaleX(1.2);
  box-shadow: 0 0 12px rgba(25, 118, 210, 0.15);
}

.panel-resizer::before {
  content: "|||";
  font-size: 12px;
  color: rgba(25, 118, 210, 0.6);
  font-weight: bold;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.panel-resizer:hover::before {
  color: rgba(25, 118, 210, 0.9);
  text-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
  transform: scale(1.1);
}

/* Active resizing state with enhanced visual feedback */
.panel-resizer.resizing {
  background: linear-gradient(180deg, rgba(25, 118, 210, 0.3), rgba(25, 118, 210, 0.15));
  transform: scaleX(1.3);
  box-shadow: 0 0 20px rgba(25, 118, 210, 0.25);
}

.panel-resizer.resizing::before {
  color: rgba(25, 118, 210, 1);
  transform: scale(1.2);
  text-shadow: 0 2px 6px rgba(25, 118, 210, 0.4);
}

/* Smooth transitions for panels during resize */
.panel.resizing {
  transition: none !important; /* Disable transitions during active resize for performance */
}

.panel:not(.resizing) {
  transition: flex 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Removed duplicate Editor/Preview panel and formatting-toolbar re-definitions.
   Kept canonical definitions in the ENHANCED FORMATTING TOOLBAR and panel sections above. */
/* ===================== */
/* Enhanced Toolbar Organization */
/* ===================== */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toolbar Header for Master Collapse */
.toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e1e5e9;
  margin-bottom: 0.5rem;
}

.toolbar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toolbar-master-toggle {
  background: none;
  border: none;
  color: #1976d2;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.toolbar-master-toggle:hover {
  background: rgba(25, 118, 210, 0.1);
  transform: scale(1.1);
}

.toolbar-master-toggle.collapsed {
  transform: rotate(180deg);
}

/* Collapsed toolbar state */
.toolbar.collapsed .toolbar-sections {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.toolbar.collapsed {
  padding: 0.75rem 1rem;
}

.toolbar-sections {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 1000px;
  opacity: 1;
  overflow: visible;
}

.toolbar-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.primary-actions {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #1976d2, #1565c0);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

.primary-actions .btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.primary-actions .btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Removed duplicate unscoped .section-label; use toolbar-scoped version instead */
/* .section-label { ... } replaced by .toolbar .section-label earlier */

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

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

.input-field.compact {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: 150px;
  font-size: 0.875rem;
  padding: 0.4rem 0.6rem;
}

/* Section-specific styling with consistent padding */
.file-section {
  border-left: 4px solid #4caf50;
  background: rgba(76, 175, 80, 0.05);
  margin: 0.25rem 0;
}

.metadata-section {
  border-left: 4px solid #ff9800;
  background: rgba(255, 152, 0, 0.05);
  margin: 0.25rem 0;
}

.tools-section {
  border-left: 4px solid #9c27b0;
  background: rgba(156, 39, 176, 0.05);
  margin: 0.25rem 0;
}

/* Dark mode support for new toolbar */
body.dark-mode .toolbar {
  background: #2a2a2a;
  border-color: #444;
}

body.dark-mode .toolbar-header {
  border-bottom-color: #444;
}

body.dark-mode .toolbar-title {
  color: #e0e0e0;
}

body.dark-mode .toolbar-master-toggle {
  color: #64b5f6;
}

body.dark-mode .toolbar-master-toggle:hover {
  background: rgba(100, 181, 246, 0.1);
}

body.dark-mode .primary-actions {
  background: linear-gradient(135deg, #1565c0, #0d47a1);
}

body.dark-mode .section-label {
  color: #bbb;
}

body.dark-mode .file-section {
  background: rgba(76, 175, 80, 0.15);
  border-left-color: #66bb6a;
}

body.dark-mode .metadata-section {
  background: rgba(255, 152, 0, 0.15);
  border-left-color: #ffb74d;
}

body.dark-mode .tools-section {
  background: rgba(156, 39, 176, 0.15);
  border-left-color: #ba68c8;
}

/* Responsive design for organized toolbar */
@media (max-width: 1024px) {
  .toolbar {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .primary-actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }
  
  .section-buttons {
    justify-content: center;
  }
  
  .section-inputs {
    justify-content: center;
  }
  
  .input-field.compact {
    min-width: 90px;
    max-width: 120px;
  }
}

/* Collapsible Tools Section */
.tools-toggle {
  background: none;
  border: none;
  color: #9c27b0;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  margin-left: auto;
}

.tools-toggle:hover {
  background: rgba(156, 39, 176, 0.1);
  transform: scale(1.1);
}

.tools-toggle.collapsed {
  transform: rotate(-90deg);
}

/* Tools section label inside toolbar (scoped to avoid duplicates) */
.toolbar .section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: #666;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

#tools-buttons {
  transition: all 0.4s ease;
  overflow: hidden;
  opacity: 1;
  max-height: 200px;
}

#tools-buttons.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding: 0;
}

/* Enhanced Button Animations */
.btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: width 0.6s, height 0.6s;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn > * {
  position: relative;
  z-index: 1;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

/* Enhanced Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  animation: modalFadeIn 0.3s ease;
  /* Ensure proper centering */
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

@keyframes modalFadeIn {
  from { 
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to { 
    opacity: 1;
    backdrop-filter: blur(5px);
  }
}

.modal-content {
  background-color: #fefefe;
  position: relative;
  padding: 1.5rem; /* Reduced from 2rem */
  border: none;
  border-radius: 12px; /* Reduced from 16px for more compact look */
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25); /* Reduced shadow */
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Faster animation */
  max-width: 85vw; /* Reduced from 90vw */
  max-height: 85vh; /* Reduced from 90vh */
  overflow-y: auto;
  margin: 5vh auto; /* Better centering */
}

/* Improved close button */
.close {
  color: #aaa;
  float: right;
  font-size: 24px; /* Reduced from default */
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  background: rgba(0,0,0,0.05);
}

.close:hover,
.close:focus {
  color: #000;
  background: rgba(0,0,0,0.1);
  text-decoration: none;
  transform: scale(1.1);
}

/* Modal header improvements */
.modal-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 1rem;
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-size: 1.3rem; /* Reduced size */
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Modal body improvements */
.modal-body {
  padding: 0.5rem 0;
}

.modal-body p {
  margin: 0.5rem 0;
  line-height: 1.5;
  color: #666;
  font-size: 0.95rem; /* Slightly smaller */
}

/* Center the modal properly */
.modal-centered {
  margin: auto;
  transform: none;
}

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

/* Confirmation Modal Styling */
.confirmation-modal {
  max-width: 450px;
  width: 90%;
  text-align: center;
}

/* Scope modal element overrides to confirmation modal to avoid duplicating base rules */
.confirmation-modal .modal-header { margin-bottom: 1.5rem; }
.confirmation-modal .modal-header h3 { margin: 0; color: #333; font-size: 1.25rem; }
.confirmation-modal .modal-body { margin-bottom: 2rem; }
.confirmation-modal .modal-body p { margin: 0; color: #666; font-size: 1rem; line-height: 1.5; }

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Scope button variants to confirmation modal to avoid duplicates */
.confirmation-modal .btn-secondary {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.confirmation-modal .btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.confirmation-modal .btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.confirmation-modal .btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Dark Mode Support for New Elements */
body.dark-mode .modal-content {
  background-color: #2a2a2a;
  color: #fff;
}

body.dark-mode .modal-header h3 {
  color: #fff;
}

body.dark-mode .modal-body p {
  color: #ccc;
}

body.dark-mode .tools-toggle {
  color: #ba68c8;
}

body.dark-mode .tools-toggle:hover {
  background: rgba(186, 104, 200, 0.1);
}

/* Improved Responsive Design */
/* Buttons & Inputs */
.input-field {
  flex: 1 1 150px;
  min-width: 120px;
  padding: 0.5rem;
  margin-right: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.3s, background 0.3s;
}
.input-field:focus { border-color: #1976d2; }
/* removed duplicate .btn/.format-btn/.format-dropdown definitions here to avoid conflicts */

/* Export Dropdown */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1000;
  min-width: 120px;
}

.export-dropdown:hover .export-menu {
  display: block;
}

.export-option {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: white;
  color: #333;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.export-option:hover {
  background: #f8f9fa;
}

/* Template Selector */
.template-selector {
  transition: border-color 0.3s, background 0.3s;
}

/* Spinner Animation */
.spinner {
  width: 24px;
  height: 24px;
  margin-left: 0.5rem;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Preview Panel */
#preview-panel {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.3s;
}
#preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: #f7f9fa;
  border-bottom: 1px solid #ddd;
  transition: background 0.3s, color 0.3s;
}
#preview-header h2 {
  margin: 0;
  font-size: 1.25rem;
}
#preview-header .btn {
  margin: 0;
}

/* Preview Pane - Explicit scrolling container */
#preview-pane {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  max-height: calc(100vh - 250px); /* Allow for header and other UI elements */
}

/* Custom scrollbar for preview pane */
#preview-pane::-webkit-scrollbar {
  width: 8px;
}

#preview-pane::-webkit-scrollbar-track {
  background: #f0f4f8;
  border-radius: 4px;
}

#preview-pane::-webkit-scrollbar-thumb {
  background: #c1c7cd;
  border-radius: 4px;
}

#preview-pane::-webkit-scrollbar-thumb:hover {
  background: #a8b2b9;
}

.preview {
  flex: 1;
  overflow-y: visible; /* Let the parent container handle scrolling */
  padding: 1rem;
  border-top: none;
  background: #fafafa;
  transition: background 0.3s, color 0.3s;
  min-height: 100%; /* Ensure it fills the container */
}

/* Preview Content Styling with improved tables */
.preview h1 { color: #1976d2; margin-top: 0; }
.preview h2 { color: #1565c0; }
.preview p { line-height: 1.6; margin: 0.75em 0; }
.preview blockquote { border-left: 4px solid #90a4ae; padding-left: 1rem; color: #546e7a; font-style: italic; }
.preview pre { background: #263238; color: #eceff1; padding: 0.75rem; border-radius: 4px; overflow-x: auto; }
.preview code { background: #eceff1; padding: 0.2em 0.4em; border-radius: 3px; }

/* Enhanced list styling with proper indentation */
.preview ul, .preview ol {
  margin: 1em 0;
  padding-left: 0;
}

.preview li {
  margin: 0.5em 0;
  margin-left: 2rem; /* Base indentation for all list items */
}

/* Nested lists with progressive indentation */
.preview ul ul, .preview ol ol, .preview ul ol, .preview ol ul {
  margin: 0.25em 0;
  margin-left: 1.5rem; /* Additional indentation for nested lists */
}

/* Third level nesting */
.preview ul ul ul, .preview ol ol ol, 
.preview ul ol ul, .preview ol ul ol,
.preview ul ul ol, .preview ol ol ul {
  margin-left: 1.5rem; /* Further indentation for deeply nested lists */
}

/* Make sure nested list items have appropriate spacing */
.preview li li {
  margin-left: 0; /* Reset since parent ul/ol already provides indentation */
}

/* Enhanced table styling */
.preview table,
.preview .markdown-table { 
  width: 100%; 
  border-collapse: collapse; 
  margin: 1em 0; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 6px;
  overflow: hidden;
}

.preview th, 
.preview td { 
  border: 1px solid #b0bec5; 
  padding: 0.75em 1em; 
  text-align: left;
  vertical-align: top;
}

.preview th {
  background: linear-gradient(135deg, #1976d2, #1565c0);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.preview tr:nth-child(even) {
  background: #f8f9fa;
}

.preview tr:hover {
  background: #e3f2fd;
  transition: background-color 0.2s ease;
}

/* Enhanced Dark Theme with WCAG AA Compliance and Accessibility */
body.dark-mode {
  background: #121212; /* Improved contrast for better accessibility */
  color: #f0f0f0; /* Higher contrast white for better readability */
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced focus states for dark mode */
body.dark-mode *:focus {
  outline: 2px solid #4fc3f7;
  outline-offset: 2px;
}

body.dark-mode *:focus-visible {
  outline: 2px solid #4fc3f7;
  outline-offset: 2px;
}

/* Removed repeated general body.dark-mode/body transition block (already defined at top). */

.panel, .navbar, .footer, .modal-content, .formatting-toolbar {
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.editor, .preview, .btn, .format-btn, .navbar-input, .dropdown-menu {
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode for page content sections with improved contrast */
body.dark-mode .page-content {
  background: #121212; /* Consistent with body background */
  color: #f0f0f0; /* High contrast text */
}

body.dark-mode .page-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
  color: white;
}

body.dark-mode .content-section {
  background: #2d2d2d !important;
  color: #e8e8e8;
}

body.dark-mode .content-section:nth-child(even) {
  background: #252525 !important;
}

body.dark-mode .content-section h2,
body.dark-mode .content-section h3,
body.dark-mode .content-section h4 {
  color: #ffffff;
}

body.dark-mode .step-card,
body.dark-mode .highlight-card {
  background: #3a3a3a !important;
  border-color: #4a4a4a !important;
  color: #e8e8e8;
}

body.dark-mode .step-number {
  background: #1976d2 !important;
  color: white !important;
}

body.dark-mode .cta-section {
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%) !important;
  color: white !important;
}

/* Dark mode for buttons and links */
body.dark-mode a {
  color: #64b5f6;
}

body.dark-mode a:hover {
  color: #90caf9;
}

/* Dark mode for lists and content */
body.dark-mode ul, 
body.dark-mode ol {
  color: #e8e8e8;
}

body.dark-mode li {
  color: #e8e8e8;
}

/* Enhanced theme button feedback */
button[id="theme-btn"] {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

button[id="theme-btn"]:active {
  transform: scale(0.95);
}

button[id="theme-btn"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

button[id="theme-btn"]:active::after {
  width: 200%;
  height: 200%;
}

/* Theme transitioning state for enhanced effects */
body.theme-transitioning * {
  transition-duration: 0.4s !important;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Enhanced notification system for theme feedback */
.theme-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1001;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Dark Mode Navbar */
body.dark-mode .navbar {
  background: linear-gradient(135deg, #0d47a1, #1565c0);
}

body.dark-mode .navbar-input {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .navbar-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* Dark mode support for enhanced date input */
body.dark-mode .navbar-input[type="date"] {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .navbar-input[type="date"]::-webkit-calendar-picker-indicator {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat center;
  background-size: 14px 14px;
  opacity: 0.8;
}

body.dark-mode .navbar-input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2364b5f6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat center;
  background-size: 14px 14px;
}

body.dark-mode .navbar-input[type="date"]:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.2);
}

body.dark-mode .dropdown-menu {
  background: #2d2d2d;
  border-color: #404040;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

body.dark-mode .dropdown-item {
  color: #e8e8e8;
  border-bottom-color: #404040;
}

body.dark-mode .dropdown-item:hover {
  background: #3a3a3a;
  color: #64b5f6;
}

/* Dark mode responsive navbar */
/* Deduplicated: Using variable-based dark mode rules defined earlier for panel, toolbar, formatting-toolbar, buttons, and format dropdown. Removed hard-coded hex-based duplicates to avoid conflicts and ensure consistency. */

body.dark-mode .input-field {
  background: #3a3a3a;
  color: #e8e8e8;
  border-color: #555;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .input-field:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
  outline: none;
}

body.dark-mode .template-selector {
  background: #3a3a3a;
  color: #e8e8e8;
  border-color: #555;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .template-selector:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
  outline: none;
}

body.dark-mode .template-selector option {
  background: #3a3a3a;
  color: #e8e8e8;
  border: none;
}

body.dark-mode .editor {
  background: #2d2d2d;
  color: #e8e8e8;
  border-color: #404040;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .editor:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
  outline: none;
}

body.dark-mode .preview {
  background: #2d2d2d;
  color: #e8e8e8;
  border-color: #404040;
}

/* Dark Mode Support for Enhanced Panels and Resizer */
body.dark-mode .panel {
  background: linear-gradient(135deg, #2d2d2d, #262626);
  border-color: rgba(100, 181, 246, 0.15);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35), 0 4px 8px rgba(0,0,0,0.25); /* Enhanced dark mode shadow */
}

body.dark-mode #editor-panel {
  background: linear-gradient(135deg, #2d2d2d, #2a2a2a);
  border-color: rgba(100, 181, 246, 0.2);
}

body.dark-mode #editor-panel:hover {
  box-shadow: 0 10px 28px rgba(0,0,0,0.45), 0 6px 12px rgba(0,0,0,0.25); /* Enhanced dark mode shadow */
  border-color: rgba(100, 181, 246, 0.3);
}

body.dark-mode #preview-panel {
  background: linear-gradient(135deg, #2d2d2d, #252525);
  border-color: rgba(100, 181, 246, 0.15);
}

body.dark-mode #preview-panel:hover {
  box-shadow: 0 10px 28px rgba(0,0,0,0.45), 0 6px 12px rgba(0,0,0,0.25); /* Enhanced dark mode shadow */
  border-color: rgba(100, 181, 246, 0.25);
}

body.dark-mode .panel-resizer {
  background: linear-gradient(180deg, rgba(100, 181, 246, 0.15), rgba(100, 181, 246, 0.08));
}

body.dark-mode .panel-resizer:hover {
  background: linear-gradient(180deg, rgba(100, 181, 246, 0.25), rgba(100, 181, 246, 0.15));
  box-shadow: 0 0 12px rgba(100, 181, 246, 0.2);
}

body.dark-mode .panel-resizer::before {
  color: rgba(100, 181, 246, 0.7);
}

body.dark-mode .panel-resizer:hover::before {
  color: rgba(100, 181, 246, 1);
  text-shadow: 0 2px 4px rgba(100, 181, 246, 0.4);
}

body.dark-mode .panel-resizer.resizing {
  background: linear-gradient(180deg, rgba(100, 181, 246, 0.35), rgba(100, 181, 246, 0.2));
  box-shadow: 0 0 20px rgba(100, 181, 246, 0.3);
}

body.dark-mode .panel-resizer.resizing::before {
  color: rgba(100, 181, 246, 1);
  text-shadow: 0 2px 6px rgba(100, 181, 246, 0.5);
}

/* Dark mode support for tablet-specific resizer enhancements */
@media (min-width: 769px) and (max-width: 1024px) {
  body.dark-mode .panel-resizer {
    background: linear-gradient(180deg, rgba(100, 181, 246, 0.2), rgba(100, 181, 246, 0.1));
  }
  
  body.dark-mode .panel-resizer:hover, 
  body.dark-mode .panel-resizer:active {
    background: linear-gradient(180deg, rgba(100, 181, 246, 0.35), rgba(100, 181, 246, 0.2));
    box-shadow: 0 0 15px rgba(100, 181, 246, 0.25);
  }
  
  body.dark-mode .panel-resizer::before {
    color: rgba(100, 181, 246, 0.8);
  }
  
  body.dark-mode .panel-resizer:hover::before, 
  body.dark-mode .panel-resizer:active::before {
    color: rgba(100, 181, 246, 1);
    text-shadow: 0 2px 6px rgba(100, 181, 246, 0.4);
  }
}

body.dark-mode .darkable {
  background: linear-gradient(135deg, #2d2d2d, #262626);
  color: #e8e8e8;
  transition: all 0.3s ease;
}

body.dark-mode .darkable h2 {
  color: #e8e8e8;
}

body.dark-mode #preview-panel {
  background: #2d2d2d;
}

body.dark-mode #preview-header {
  background: #262626;
  border-color: #404040;
  color: #e8e8e8;
}

body.dark-mode .spinner {
  border-top-color: #1976d2;
}

body.dark-mode .export-menu {
  background: #2d2d2d;
  border: 1px solid #404040;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
}

body.dark-mode .export-option {
  background: #2d2d2d;
  color: #e8e8e8;
  border-bottom: 1px solid #404040;
  transition: background-color 0.2s ease;
}

body.dark-mode .export-option:hover {
  background: #3a3a3a;
}

/* Dark mode content styling */
body.dark-mode code {
  background: #3a3a3a;
  color: #e8e8e8;
  border: 1px solid #555;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

body.dark-mode pre {
  background: #262626;
  border: 1px solid #404040;
  border-radius: 4px;
  padding: 1em;
}

body.dark-mode pre code {
  background: transparent;
  border: none;
  padding: 0;
}

body.dark-mode blockquote {
  border-left: 4px solid #1976d2;
  background: #3a3a3a;
  padding: 1em;
  margin: 1em 0;
  border-radius: 0 4px 4px 0;
}

body.dark-mode table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  border: 1px solid #404040;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark-mode th,
body.dark-mode td {
  border: 1px solid #404040;
  padding: 0.75em 1em;
  text-align: left;
}

body.dark-mode th {
  background: linear-gradient(135deg, #1976d2, #1565c0);
  color: #ffffff;
  font-weight: 600;
}

body.dark-mode tr:nth-child(even) {
  background: #363636;
}

body.dark-mode tr:hover {
  background: #404040;
}

body.dark-mode .markdown-table {
  border: 1px solid #404040;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark-mode a {
  color: #64b5f6;
}

body.dark-mode a:hover {
  color: #90caf9;
}

/* Enhanced Responsive Design */
/* Enhanced mobile responsive design */
/* Tablets: optimized layout */
/* Tablet view improvements - optimized for touch and better spacing */
@media (min-width: 769px) and (max-width: 1024px) {
  .navbar-container {
    padding: 0.3rem 1.2rem; /* Optimized for tablet, keeping consistency */
    gap: 1rem; /* Balanced gap for tablet */
  }
  
  /* Footer positioning for tablet - non-sticky */
  .footer {
    position: static;
    margin-top: auto;
  }
  
  #app { 
    flex-direction: row; 
    min-height: calc(100vh - 120px); /* Consistent height with navbar and footer */
    height: auto; /* Allow natural height expansion */
    padding: 5px 0.5rem; /* Maintain responsive spacing for tablet */
    gap: 0.5rem; /* Reduced gap for more content space */
  }
  
  .panel { 
    margin: 0; /* Remove margin, use gap instead */
    padding: 1.5rem; /* Increased padding for better touch experience */
    border-radius: 12px; /* Larger border radius for modern look */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* Enhanced shadow */
  }

  /* Apply 55-45% split for tablet screens */
  #editor-panel {
    flex: 1 1 55%; /* 55% editor width for tablets */
    max-width: 60%;
  }
  
  #preview-panel {
    flex: 1 1 45%; /* 45% preview width for tablets */
    max-width: 45%;
    min-width: 280px; /* Adjust minimum width for tablets */
  }
  
  /* Enhanced panel resizer for tablet touch interactions */
  .panel-resizer {
    width: 16px; /* Wider resizer for better touch targets */
    background: linear-gradient(180deg, rgba(25, 118, 210, 0.15), rgba(25, 118, 210, 0.08));
    cursor: col-resize;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px; /* Larger border radius for touch */
    margin: 0 4px; /* More margin for better separation */
    /* Improve touch target */
    touch-action: pan-x;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  
  .panel-resizer:hover, .panel-resizer:active {
    background: linear-gradient(180deg, rgba(25, 118, 210, 0.25), rgba(25, 118, 210, 0.15));
    transform: scaleX(1.2);
    box-shadow: 0 0 12px rgba(25, 118, 210, 0.2);
  }
  
  .panel-resizer::before {
    content: "⋮⋮⋮";
    font-size: 14px;
    color: rgba(25, 118, 210, 0.7);
    font-weight: bold;
    line-height: 1;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
  
  .panel-resizer:hover::before, .panel-resizer:active::before {
    color: rgba(25, 118, 210, 1);
    text-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
    transform: scale(1.1);
  }
  
  .formatting-toolbar {
    gap: 0.5rem; /* Better spacing between buttons */
    padding: 1rem; /* Increased padding */
    border-radius: 10px; /* Consistent border radius */
  }
  
  .format-btn {
    padding: 0.35rem 0.55rem; /* Smaller but still touch-friendly */
    font-size: 0.75rem; /* Consistent with desktop */
    min-height: 40px; /* Reduced from 44px but still accessible */
    border-radius: 6px; /* Rounded buttons */
    transition: all 0.2s ease; /* Smooth hover effects */
  }
  
  .format-btn:hover {
    transform: translateY(-1px); /* Subtle hover effect */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }
  
  .editor {
    font-size: 1rem; /* Improved readability */
    padding: 1.25rem; /* Better padding */
    border-radius: 10px; /* Consistent with other elements */
    line-height: 1.7; /* Better line spacing for readability */
    margin-bottom: 18px; /* Enhanced bottom margin for tablets */
    padding-bottom: 2rem; /* Comfortable bottom padding for touch editing */
  }
  
  .btn, .input-field {
    font-size: 0.9rem; /* Slightly larger for better readability */
    padding: 0.5rem 0.75rem; /* Better touch targets */
    min-height: 44px; /* Minimum touch target size */
  }
  
  .navbar-input {
    min-width: 120px; /* Increased minimum width */
    font-size: 0.9rem; /* Improved readability */
    padding: 0.5rem 0.75rem; /* Better touch targets */
  }
  
  /* Improve dropdown menus for tablet */
  .dropdown-toggle, .export-dropdown button {
    min-height: 44px; /* Touch-friendly size */
    padding: 0.5rem 1rem;
  }
  
  .dropdown-menu, .export-menu {
    border-radius: 10px; /* Consistent styling */
    padding: 0.5rem 0; /* Better spacing */
  }
  
  .dropdown-item, .export-option {
    padding: 0.75rem 1rem; /* Larger touch targets */
    font-size: 0.9rem;
  }
}

/* Desktop and larger: dynamic panel layout */
@media (min-width: 1025px) {
  .navbar-container {
    padding: 0.25rem 1.5rem; /* Optimized desktop padding, keeping compact */
    gap: 1rem; /* Balanced gap for desktop */
  }
  
  #app { 
    flex-direction: row; 
    min-height: calc(100vh - 140px); /* Account for navbar and footer on desktop */
    height: auto; /* Allow natural height expansion */
    padding: 5px 0.5rem; /* Maintain responsive spacing for desktop */
    gap: 0.5rem; /* Reduced gap for more content space */
    max-width: 100%; /* Use full width available */
    margin: 0; /* Remove auto centering for full width */
  }
  
  .panel { 
    margin: 0; /* Remove margin, use gap */
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  }
  
  /* Editor panel optimized for tablet/desktop - 55% split */
  #editor-panel {
    flex: 1 1 55%; /* 55% editor width as per requirements */
    max-width: 60%; /* Allow some flexibility for complex documents */
  }
  
  /* Preview panel optimized for reading - 45% split */
  #preview-panel {
    flex: 1 1 45%; /* 45% preview width as per requirements */
    max-width: 45%; /* Maintain proportional width */
    min-width: 300px; /* Ensure minimum readable width */
  }
  
  .formatting-toolbar {
    gap: 0.4rem; /* Slightly larger gap for tablet */
    padding: 0.8rem;
    border-radius: 8px;
  }
  
  .editor {
    font-size: 1rem;
    line-height: 1.6;
    min-height: 400px;
    border-radius: 8px;
  }
}

/* Ultra-wide screens: optimized layout with better space utilization */
@media (min-width: 1400px) {
  .navbar-container {
    max-width: 100%; /* Use full width */
    padding: 1rem 2rem; /* Reduced padding for more content space */
    gap: 2rem;
  }
  
  #app {
    max-width: 100%; /* Use full screen width */
    padding: 5px 1rem; /* Maintain responsive spacing with more side padding */
    gap: 0.75rem; /* Optimized gap for ultra-wide */
    margin: 0; /* Remove centering for full width utilization */
  }
  
  /* Dynamic panel sizing for ultra-wide screens - maintain 55-45% ratio */
  #editor-panel {
    flex: 1 1 55%; /* Maintain 55% on ultra-wide as well */
    max-width: 60%; /* Comfortable typing area */
    min-width: 600px; /* Minimum comfortable width */
  }
  
  #preview-panel {
    flex: 1 1 45%; /* Maintain 45% on ultra-wide */
    max-width: 45%; /* Optimized preview width for ultra-wide */
    min-width: 400px; /* Minimum readable width */
  }
  
  .panel {
    margin: 0; /* Use gap instead */
    padding: 2rem;
    border-radius: 16px; /* Larger radius for modern look */
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  }
  
  .formatting-toolbar {
    padding: 1.25rem;
    gap: 0.75rem;
    border-radius: 12px;
  }
  
  .format-btn {
    padding: 0.45rem 0.65rem; /* Compact but comfortable for desktop */
    font-size: 0.8rem; /* Slightly larger for better readability on larger screens */
  }
  
  .editor {
    font-size: 1.1rem;
    line-height: 1.7;
    padding: 1.5rem;
    border-radius: 12px;
  }
  
  .navbar-input {
    min-width: 140px;
    padding: 0.6rem 0.9rem;
  }
  
  /* Preview content styling for ultra-wide */
  #preview-pane {
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: none; /* Allow full width usage */
  }
}

/* Help Modal Enhancements */
#help-modal .modal-content {
  max-width: 900px;
  width: 95%;
  padding: 1.5rem;
}

.help-section {
  margin-bottom: 2rem;
}

.help-section h3 {
  color: #1976d2;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f5f5f5;
  border-radius: 6px;
  border-left: 3px solid #1976d2;
  transition: all 0.2s ease;
}

.shortcut-item:hover {
  background: #e8f4fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shortcut-item kbd {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  font-family: monospace;
  margin: 0 0.1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  white-space: nowrap;
}

.shortcut-item span {
  color: #555;
  font-size: 0.9rem;
  text-align: right;
  flex: 1;
  margin-left: 0.5rem;
}

.markdown-reference {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}

.ref-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem;
  background: #f8f9fa;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.ref-item:hover {
  background: #e9ecef;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.ref-item code {
  background: #e9ecef;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #d63384;
  font-weight: 500;
}

.ref-item span {
  color: #666;
  font-size: 0.85rem;
  text-align: right;
  flex: 1;
  margin-left: 0.5rem;
}

.tips-list {
  list-style: none;
  padding: 0;
}

.tips-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
  line-height: 1.5;
}

.tips-list li:last-child {
  border-bottom: none;
}

.tips-list strong {
  color: #1976d2;
}

/* Dark mode help modal */
body.dark-mode .modal-content {
  background: #2d2d2d;
  color: #e8e8e8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

body.dark-mode .close {
  color: #ccc;
}

body.dark-mode .close:hover,
body.dark-mode .close:focus {
  color: #fff;
}

body.dark-mode #help-modal .modal-content {
  background: #2d2d2d;
  color: #e8e8e8;
}

body.dark-mode .help-section h3 {
  color: #64b5f6;
}

body.dark-mode .shortcut-item {
  background: #3a3a3a;
  border-left-color: #64b5f6;
}

body.dark-mode .shortcut-item:hover {
  background: #4a4a4a;
}

body.dark-mode .shortcut-item kbd {
  background: #4a4a4a;
  border-color: #666;
  color: #e8e8e8;
}

body.dark-mode .shortcut-item span {
  color: #ccc;
}

body.dark-mode .ref-item {
  background: #3a3a3a;
}

body.dark-mode .ref-item:hover {
  background: #4a4a4a;
}

body.dark-mode .ref-item code {
  background: #4a4a4a;
  color: #f8a2c2;
}

body.dark-mode .ref-item span {
  color: #ccc;
}

body.dark-mode .tips-list li {
  border-bottom-color: #404040;
}

body.dark-mode .tips-list strong {
  color: #64b5f6;
}

/* Statistics Modal Styles */
#stats-modal .modal-content {
  max-width: 950px;
  width: 95%;
  padding: 1.5rem;
}

.stats-container {
  margin-top: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  text-align: center;
  padding: 1.25rem 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  cursor: default;
}

.stat-card:hover {
  border-color: #1976d2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: bold;
  color: #1976d2;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  line-height: 1.2;
}

.detailed-stats h3,
.readability-score h3 {
  color: #1976d2;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.stats-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #1976d2;
  transition: all 0.2s ease;
}

.detail-item:hover {
  background: #e8f4fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-label {
  font-weight: 500;
  color: #333;
  flex: 1;
}

.detail-value {
  font-weight: bold;
  color: #1976d2;
  margin-left: 1rem;
  white-space: nowrap;
}

.readability-score {
  background: #f0f7ff;
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid #b3d9ff;
}

.readability-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.readability-item:last-child {
  margin-bottom: 0;
}

.readability-label {
  font-weight: 500;
  color: #333;
  flex: 1;
}

.readability-value {
  font-weight: bold;
  color: #0d47a1;
  padding: 0.35rem 0.75rem;
  background: #e3f2fd;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Dark mode stats */
body.dark-mode #stats-modal .modal-content {
  background: #2d2d2d;
  color: #e8e8e8;
}

body.dark-mode .stat-card {
  background: #3a3a3a;
  border-color: #555;
}

body.dark-mode .stat-card:hover {
  border-color: #64b5f6;
  box-shadow: 0 4px 12px rgba(100, 181, 246, 0.2);
}

body.dark-mode .stat-number {
  color: #64b5f6;
}

body.dark-mode .stat-label {
  color: #ccc;
}

body.dark-mode .detailed-stats h3,
body.dark-mode .readability-score h3 {
  color: #64b5f6;
}

body.dark-mode .detail-item {
  background: #3a3a3a;
  border-left-color: #64b5f6;
}

body.dark-mode .detail-item:hover {
  background: #4a4a4a;
}

body.dark-mode .detail-label {
  color: #e8e8e8;
}

body.dark-mode .detail-value {
  color: #64b5f6;
}

body.dark-mode .readability-score {
  background: #2a2a2a;
  border-color: #404040;
}

body.dark-mode .readability-label {
  color: #e8e8e8;
}

body.dark-mode .readability-value {
  color: #64b5f6;
  background: #3a3a3a;
  border: 1px solid #555;
}

/* Image Support and Positioning */
.preview img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  margin: 15px 0;
  transition: all 0.3s ease;
}

.preview img:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform: translateY(-2px);
  cursor: pointer;
}

.preview img.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.preview img.right {
  float: right;
  margin-left: 20px;
  margin-bottom: 15px;
  max-width: 50%;
}

.preview img.left {
  float: left;
  margin-right: 20px;
  margin-bottom: 15px;
  max-width: 50%;
}

.preview img.float-left {
  float: left;
  margin: 0 20px 15px 0;
  max-width: 40%;
}

.preview img.float-right {
  float: right;
  margin: 0 0 15px 20px;
  max-width: 40%;
}

.preview .image-container {
  clear: both;
  margin: 25px 0;
  text-align: center;
}

.preview .image-caption {
  font-style: italic;
  text-align: center;
  color: #666;
  font-size: 0.9em;
  margin-top: 8px;
  padding: 0 10px;
}

/* Image preview modal */
#image-preview-modal .modal-content {
  max-width: 95vw;
  max-height: 95vh;
  text-align: center;
  padding: 1rem;
}

#preview-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#preview-caption {
  margin-top: 15px;
  font-style: italic;
  color: #666;
  font-size: 1rem;
}

/* Dark mode image styles */
body.dark-mode .preview img {
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

body.dark-mode .preview img:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

body.dark-mode .preview .image-caption {
  color: #ccc;
}

body.dark-mode #preview-caption {
  color: #ccc;
}

/* Enhanced formatting toolbar for image upload */
.format-btn#upload-image-btn {
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  border: none;
  font-weight: 500;
}

.format-btn#upload-image-btn:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

body.dark-mode .format-btn#upload-image-btn {
  background: linear-gradient(135deg, #4caf50, #45a049);
}

body.dark-mode .format-btn#upload-image-btn:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

/* Tutorial and image help styles */
.image-help {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #4caf50;
  margin: 1rem 0;
}

.image-help h4 {
  color: #2e7d32;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.image-help ol, .image-help ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.image-help li {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.image-help code {
  background: #e8f5e8;
  color: #2e7d32;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9rem;
}

body.dark-mode .image-help {
  background: #2a2a2a;
  border-left-color: #66bb6a;
}

body.dark-mode .image-help h4 {
  color: #66bb6a;
}

body.dark-mode .image-help code {
  background: #3a3a3a;
  color: #66bb6a;
}

/* Auto-save indicator */
.content-warning {
  animation: slideInTop 0.3s ease;
  z-index: 100;
}

@keyframes slideInTop {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Loading states */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: white;
  margin-left: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
}

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

/* Focus improvements */
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #1976d2;
  outline-offset: 2px;
}

body.dark-mode button:focus,
body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
  outline-color: #64b5f6;
}

/* Improved contrast for better readability */
.high-contrast {
  filter: contrast(1.2);
}

/* ===================== */
/* Notification System */
/* ===================== */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.notification {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #1976d2;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease-in-out;
  overflow: hidden;
}

.notification-show {
  opacity: 1;
  transform: translateX(0);
}

.notification-hide {
  opacity: 0;
  transform: translateX(100%);
}

.notification-content {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
}

.notification-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.notification-message {
  flex: 1;
  color: #333;
  font-size: 14px;
  line-height: 1.4;
}

.notification-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.notification-close:hover {
  background-color: #f0f0f0;
  color: #333;
}

/* Notification types */
.notification-success {
  border-left-color: #4caf50;
}

.notification-error {
  border-left-color: #f44336;
}

.notification-warning {
  border-left-color: #ff9800;
}

.notification-info {
  border-left-color: #2196f3;
}

/* Dark mode support for notifications */
body.dark-mode .notification {
  background: #333;
  border-left-color: #64b5f6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .notification-message {
  color: #fff;
}

body.dark-mode .notification-close {
  color: #ccc;
}

body.dark-mode .notification-close:hover {
  background-color: #444;
  color: #fff;
}

body.dark-mode .notification-success {
  border-left-color: #81c784;
}

body.dark-mode .notification-error {
  border-left-color: #e57373;
}

body.dark-mode .notification-warning {
  border-left-color: #ffb74d;
}

body.dark-mode .notification-info {
  border-left-color: #64b5f6;
}

/* Enhanced Help Modal Styles */
.help-tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
  gap: 5px;
}

.help-tab {
  background: none;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
  font-size: 14px;
}

.help-tab:hover {
  background: #f5f5f5;
  color: #1976d2;
}

.help-tab.active {
  background: #1976d2;
  color: white;
  font-weight: 600;
}

.help-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.help-tab-content.active {
  display: block;
}

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

/* Shortcut Categories */
.shortcut-category {
  margin-bottom: 25px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #1976d2;
}

.shortcut-category h4 {
  margin: 0 0 15px 0;
  color: #1976d2;
  font-size: 16px;
  font-weight: 600;
}

.shortcuts-grid {
  display: grid;
  gap: 20px;
}

/* Markdown Categories */
.markdown-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.markdown-category {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #4caf50;
}

.markdown-category h4 {
  margin: 0 0 15px 0;
  color: #4caf50;
  font-size: 16px;
  font-weight: 600;
}

/* Feature Sections */
.feature-section {
  margin-bottom: 25px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #ff9800;
}

.feature-section h4 {
  margin: 0 0 15px 0;
  color: #ff9800;
  font-size: 16px;
  font-weight: 600;
}

.features-list {
  margin: 0;
  padding-left: 20px;
}

.features-list li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* FAQ Sections */
.faq-section {
  margin-bottom: 25px;
}

.faq-section h4 {
  margin: 0 0 15px 0;
  color: #e91e63;
  font-size: 16px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 2px solid #e91e63;
}

.faq-item {
  margin-bottom: 20px;
  padding: 15px;
  background: #fff3e0;
  border-radius: 8px;
  border-left: 4px solid #e91e63;
}

.faq-item h5 {
  margin: 0 0 10px 0;
  color: #d32f2f;
  font-size: 14px;
  font-weight: 600;
}

.faq-item p {
  margin: 0;
  color: #666;
  line-height: 1.6;
  font-size: 14px;
}

/* Improved Reference Items */
.ref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.ref-item:hover {
  background: #f0f7ff;
  border-color: #1976d2;
  transform: translateX(5px);
}

.ref-item code {
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #d32f2f;
  border: 1px solid #e0e0e0;
  min-width: 150px;
  text-align: left;
}

.ref-item span {
  color: #666;
  font-size: 13px;
  font-weight: 500;
}

/* Dark Mode Support for Help Modal */
body.dark-mode .help-tab {
  color: #ccc;
}

body.dark-mode .help-tab:hover {
  background: #444;
  color: #64b5f6;
}

body.dark-mode .help-tab.active {
  background: #1976d2;
  color: white;
}

body.dark-mode .shortcut-category,
body.dark-mode .markdown-category,
body.dark-mode .feature-section {
  background: #2d2d30;
}

body.dark-mode .faq-item {
  background: #2d2d30;
  color: #ccc;
}

body.dark-mode .faq-item p {
  color: #ccc;
}

body.dark-mode .ref-item {
  background: #2d2d30;
  border-color: #444;
}

body.dark-mode .ref-item:hover {
  background: #333;
  border-color: #64b5f6;
}

body.dark-mode .ref-item code {
  background: #444;
  color: #ff6b6b;
  border-color: #555;
}

body.dark-mode .ref-item span {
  color: #ccc;
}

/* Removed duplicate .navbar-toggle definitions; kept earlier navbar section. */

@media (max-width: 768px) {
  /* Navbar Styles */
  .navbar-toggle {
    display: flex;
  }
  
  .navbar-container {
    padding: 0.5rem 1rem;
    min-height: 60px; /* Increased from 56px for better touch targets */
    gap: 0.75rem;
  }
  
  .logo {
    font-size: 1.2rem; /* Slightly larger for better visibility */
  }
  
  .navbar-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem 1rem;
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
  }
  
  .navbar-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: 100vh;
  }
  
  /* Improved mobile navigation styles */
  .navbar-nav {
    flex-direction: column;
    gap: 0.75rem; /* Increased gap for better touch targets */
    width: 100%;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 1rem; /* Increased padding for better touch targets */
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem; /* Increased font size for better readability */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
  }

  .nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: none; /* Disable transform on mobile for better touch experience */
  }
  
  .navbar-item {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
  }
  
  .navbar-item:last-child {
    margin-bottom: 0;
  }
  
  .navbar-btn,
  .navbar-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
  }
  
  .dropdown {
    width: 100%;
  }
  
  .dropdown-toggle {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
  }
  
  .dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    max-height: 0;
    transition: all 0.3s ease;
  }
  
  .dropdown:hover .dropdown-menu,
  .dropdown.active .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    max-height: 300px;
  }
  
  .export-dropdown {
    width: 100%;
    position: relative;
  }
  
  .export-menu {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 180px;
    z-index: 1000;
  }
  
  .export-dropdown:hover .export-menu,
  .export-dropdown.active .export-menu {
    opacity: 1;
    visibility: visible;
    max-height: 300px;
  }
  
  .navbar-input {
    width: 100%;
    max-width: 300px;
  }

  /* Main Layout Styles */
  #app { 
    flex-direction: column !important;
    height: auto;
    min-height: calc(100vh - 120px); /* Adjusted for larger navbar */
    padding: 1rem 0.25rem; /* Further reduced padding to prevent overflow */
    margin: 0;
    max-width: 100%;
    overflow-x: hidden;
    gap: 1rem; /* Increased gap for better visual separation */
    box-sizing: border-box; /* Include padding in width calculation */
  }

  /* Enhanced page content styles for help pages */
  .page-content {
    padding-top: 80px !important; /* Ensure content doesn't hide behind navbar */
  }

  .page-header {
    padding: 2rem 1rem !important; /* Reduced padding for mobile */
    text-align: center;
  }

  .page-header h1 {
    font-size: 2rem !important; /* Smaller but readable heading */
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
  }

  .page-header p {
    font-size: 1rem !important; /* Better readability */
    line-height: 1.5 !important;
  }

  .content-section {
    padding: 2rem 1rem !important; /* Consistent mobile padding */
  }

  .content-section h2 {
    font-size: 1.8rem !important;
    text-align: center;
    margin-bottom: 2rem !important;
  }

  /* Improve grid layouts on mobile */
  .steps-grid, .feature-highlights, .benefits-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .step-card, .highlight-card {
    padding: 1.5rem !important;
    margin-bottom: 1rem;
  }

  .step-number {
    width: 40px !important;
    height: 40px !important;
    font-size: 1rem !important;
  }

  /* Better typography for mobile */
  .content-section h3 {
    font-size: 1.4rem !important;
    margin-bottom: 1rem !important;
  }

  .content-section h4 {
    font-size: 1.2rem !important;
    margin-bottom: 0.75rem !important;
  }

  .content-section p, .content-section li {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
  }

  /* Call-to-action sections */
  .cta-section {
    padding: 2rem 1rem !important;
  }

  .cta-section h2 {
    font-size: 2rem !important;
  }

  .cta-section p {
    font-size: 1rem !important;
  }
  
  .panel { 
    flex: none !important;
    width: 100% !important;
    height: auto;
    min-height: 280px;
    margin: 0;
    padding: 1rem;
    border-radius: 10px;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  .panel-resizer {
    display: none !important;
  }
  
  #editor-panel {
    order: 1;
    min-height: 400px;
    padding: 1rem;
    gap: 0.75rem;
  }
  
  #preview-panel {
    order: 2;
    min-height: 350px;
    max-height: 60vh;
    overflow-y: auto;
  }
  
  /* Toolbar Styles */
  .toolbar {
    gap: 0.5rem;
    padding: 0.75rem;
  }
  
  .toolbar-header {
    padding: 0.25rem 0;
    margin-bottom: 0.25rem;
  }
  
  .toolbar-title {
    font-size: 0.8rem;
  }
  
  .toolbar-master-toggle {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  
  .toolbar-sections .toolbar-section:not(.primary-actions) {
    display: none;
  }
  
  .toolbar.expanded .toolbar-sections .toolbar-section {
    display: flex;
  }
  
  .primary-actions {
    position: relative;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .primary-actions::after {
    content: '👆 Tap toolbar title to see more tools';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    white-space: nowrap;
    z-index: 10;
  }
  
  .toolbar.expanded .primary-actions::after {
    content: '👆 Tap toolbar title to hide tools';
  }
  
  .toolbar.collapsed .primary-actions::after {
    display: none;
  }
  
  /* Formatting Toolbar */
  .formatting-toolbar {
    flex-wrap: wrap;
    gap: 0.3rem; /* Compact spacing for mobile */
    padding: 0.6rem; /* Reduced padding */
    border-radius: 6px;
    bottom: auto;
  }
  
  .format-btn {
    font-size: 0.7rem; /* Smaller but readable */
    padding: 0.3rem 0.45rem; /* Very compact */
    min-width: auto;
    border-radius: 4px;
  }
  
  /* Buttons and Inputs */
  .btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
  
  .input-field {
    font-size: 0.875rem;
    padding: 0.5rem;
    margin: 0.125rem;
    flex: 1 1 auto;
    min-width: 120px;
    border-radius: 6px;
  }
  
  /* Editor */
  .editor {
    font-size: 0.9rem;
    min-height: 300px;
    height: auto;
    max-height: 50vh;
    padding: 1rem;
    line-height: 1.6;
    border-radius: 8px;
    resize: none;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-bottom: 2.5rem;
  }
  
  /* Modal Styles */
  .modal-content {
    margin: 5% auto;
    padding: 1rem;
    width: 95%;
    max-height: 85vh;
    border-radius: 6px;
  }
  
  .confirmation-modal {
    max-width: none;
    width: 100%;
    margin: 1rem;
  }
  
  .modal-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .btn-secondary,
  .btn-danger {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
  }
  
  .close {
    top: 0.5rem;
    right: 1rem;
    font-size: 1.5rem;
  }

  /* Help Modal */
  #help-modal .modal-content {
    padding: 1rem;
  }

  .help-section {
    margin-bottom: 1.5rem;
  }

  .help-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .help-tabs {
    flex-wrap: wrap;
    gap: 2px;
  }
  
  .help-tab {
    padding: 8px 12px;
    font-size: 12px;
    flex: 1;
    min-width: calc(50% - 1px);
  }
  
  .markdown-categories {
    grid-template-columns: 1fr;
  }

  .shortcuts-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .shortcut-item {
    padding: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .shortcut-item span {
    text-align: left;
    margin-left: 0;
    font-size: 0.85rem;
  }

  .shortcut-item kbd {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }

  .markdown-reference {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .ref-item {
    padding: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .ref-item span {
    text-align: left;
    margin-left: 0;
    font-size: 0.8rem;
  }

  .ref-item code {
    font-size: 0.8rem;
    min-width: auto;
    width: 100%;
  }

  .tips-list li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
  }

  /* Stats Modal */
  #stats-modal .modal-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .stat-card {
    padding: 1rem 0.5rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .stats-details {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .detail-item {
    padding: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .detail-value {
    margin-left: 0;
  }

  .readability-score {
    padding: 1rem;
  }

  .readability-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  /* Notifications */
  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
}

/* ===================== */
/* QUICK ACCESS SECTION */
/* ===================== */
/* QUICK ACCESS TOOLBAR STYLES */
/* ===================== */
.quick-access-toolbar {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(0,0,0,0.1);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.quick-access-container {
  max-width: 1400px;
  margin: 0 auto;
}

.quick-access-title {
  text-align: center;
  font-size: 1.5rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  font-weight: 600;
}

.quick-access-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.qa-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  position: relative; /* Ensure proper positioning for dropdown menus */
}

.qa-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  text-align: center;
}

.qa-buttons {
  display: flex;
  gap: 0.5rem;
}

.qa-inputs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.qa-controls {
  display: flex;
  gap: 0.5rem;
}

.qa-btn {
  background: #3498db;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.qa-btn:hover {
  background: #2980b9;
  transform: translateY(-1px);
}

.qa-btn:active {
  transform: translateY(0);
}

.qa-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
}

.qa-btn.qa-export {
  background: #27ae60;
}

.qa-btn.qa-export:hover {
  background: #229954;
}

.qa-input-compact {
  padding: 0.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: border-color 0.3s ease;
  background: #fafafa;
  width: 100px;
}

.qa-input-compact:focus {
  outline: none;
  border-color: #3498db;
  background: white;
}

.qa-template-compact select {
  padding: 0.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.3s ease;
  min-width: 120px;
}

.qa-template-compact select:focus {
  outline: none;
  border-color: #3498db;
  background: white;
}

/* Enhanced Floating Theme Button */
.floating-theme-btn {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.floating-theme-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.floating-theme-btn:active {
  transform: translateY(0) scale(0.95);
}

.theme-icon {
  transition: transform 0.3s ease;
}

.floating-theme-btn:hover .theme-icon {
  transform: rotate(180deg);
}

/* Dark mode styling for floating button */
body.dark-mode .floating-theme-btn {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

body.dark-mode .floating-theme-btn:hover {
  box-shadow: 0 6px 16px rgba(255, 193, 7, 0.5);
}

/* Dark mode support for quick access */
body.dark-mode .quick-access-toolbar {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

body.dark-mode .quick-access-bar {
  background: #34495e;
}

body.dark-mode .quick-access-title {
  color: #ecf0f1;
}

body.dark-mode .qa-group-label {
  color: #bdc3c7;
}

body.dark-mode .qa-input-compact {
  background: #2c3e50;
  border-color: #4a5568;
  color: #ecf0f1;
}

body.dark-mode .qa-input-compact:focus {
  background: #34495e;
  border-color: #3498db;
}

body.dark-mode .qa-template-compact select {
  background: #2c3e50;
  border-color: #4a5568;
  color: #ecf0f1;
}

body.dark-mode .qa-template-compact select:focus {
  background: #34495e;
  border-color: #3498db;
}

body.dark-mode .qa-input,
body.dark-mode .qa-template-container select {
  background: #2c3e50;
  border-color: #4a5a6a;
  color: #ecf0f1;
}

body.dark-mode .qa-input:focus,
body.dark-mode .qa-template-container select:focus {
  border-color: #3498db;
  background: #34495e;
}

/* Quick Access Export Menu */
.qa-export-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  margin-top: 0.25rem;
}

.qa-export-option {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 0.95rem;
  color: #2c3e50;
}

.qa-export-option:hover {
  background: #f8f9fa;
}

.qa-export-option:first-child {
  border-radius: 6px 6px 0 0;
}

.qa-export-option:last-child {
  border-radius: 0 0 6px 6px;
}

/* Position the export button container relatively for the menu */
.quick-access-card:has(.qa-export) {
  position: relative;
}

/* Dark mode for export menu */
body.dark-mode .qa-export-menu {
  background: #34495e;
  border-color: #4a5a6a;
}

body.dark-mode .qa-export-option {
  color: #ecf0f1;
}

body.dark-mode .qa-export-option:hover {
  background: #2c3e50;
}

/* Responsive Design for Quick Access Toolbar */
@media (max-width: 768px) {
  .quick-access-toolbar {
    padding: 1rem;
  }
  
  .quick-access-title {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
  }
  
  .quick-access-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .qa-group {
    min-width: unset;
    width: 100%;
  }
  
  .qa-inputs {
    justify-content: center;
  }
  
  .qa-input-compact {
    width: 90px;
  }
  
  .qa-template-compact select {
    min-width: 100px;
  }
  
  
  /* Enhanced Floating Theme Button Mobile Positioning */
  .floating-theme-btn {
    width: 52px;
    height: 52px;
    left: 15px;
    bottom: 15px;
    font-size: 1.3rem;
  }

  /* Mobile-specific improvements for quick access */
  .quick-access-toolbar {
    padding: 1rem 0.5rem;
  }
  
  .quick-access-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  
  .quick-access-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .qa-group {
    min-width: unset;
    width: 100%;
  }
  
  .qa-inputs {
    justify-content: center;
  }
  
  .qa-input-compact {
    width: 90px;
    font-size: 0.9rem;
  }
  
  .qa-template-compact select {
    min-width: 100px;
    font-size: 0.9rem;
  }

  /* Enhanced mobile notification positioning */
  .notification-container {
    top: 80px; /* Account for taller mobile navbar */
    right: 10px;
    left: 10px;
    max-width: none;
  }

  /* ENHANCED Dark Mode Mobile Navbar Fixes */
  body.dark-mode .navbar {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  body.dark-mode .navbar-menu {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  }
  
  body.dark-mode .nav-link {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
  }

  body.dark-mode .nav-link:hover,
  body.dark-mode .nav-link.active {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #64b5f6 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  body.dark-mode .navbar-brand {
    color: #ffffff !important;
  }
  
  body.dark-mode .navbar-toggle {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }
  
  body.dark-mode .navbar-toggle .hamburger-line {
    background: #ffffff !important;
  }
  
  body.dark-mode .navbar-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
  }
  
  body.dark-mode .dropdown-menu {
    background: rgba(26, 26, 26, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
  }
  
  body.dark-mode .dropdown-item {
    color: #e8e8e8 !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
  }
  
  body.dark-mode .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #64b5f6 !important;
  }
}

/* Enhanced notification styles with better error handling support */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
  max-width: 400px;
}

.notification {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 12px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  border-left: 4px solid;
  max-width: 100%;
  word-wrap: break-word;
}

.notification.notification-show {
  opacity: 1;
  transform: translateX(0);
}

.notification.notification-hide {
  opacity: 0;
  transform: translateX(100%);
  margin-bottom: 0;
  max-height: 0;
  overflow: hidden;
}

.notification-content {
  padding: 16px;
}

.notification-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.notification-header:only-child {
  margin-bottom: 0;
}

.notification-icon {
  font-size: 18px;
  margin-right: 12px;
  flex-shrink: 0;
  line-height: 1;
}

.notification-title {
  font-weight: 600;
  font-size: 15px;
  margin-right: 12px;
  flex-grow: 1;
  line-height: 1.3;
}

.notification-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.notification-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

.notification-body {
  margin-left: 30px;
}

.notification-message {
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  display: block;
  margin-bottom: 12px;
}

.notification-message:only-child {
  margin-bottom: 0;
}

.notification-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.notification-action-btn {
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notification-action-btn:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

/* Enhanced notification types */
.notification-success .notification-action-btn {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
}

.notification-success .notification-action-btn:hover {
  background: rgba(16, 185, 129, 0.2);
}

.notification-error .notification-action-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #7f1d1d;
}

.notification-error .notification-action-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.notification-warning .notification-action-btn {
  background: rgba(245, 158, 11, 0.1);
  color: #78350f;
}

.notification-warning .notification-action-btn:hover {
  background: rgba(245, 158, 11, 0.2);
}

.notification-info .notification-action-btn {
  background: rgba(59, 130, 246, 0.1);
  color: #1e3a8a;
}

.notification-info .notification-action-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

/* Error report modal styles */
.error-report-modal .modal-content {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.error-details {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 12px;
  margin: 12px 0;
}

.error-details h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #495057;
}

.error-details pre {
  background: #2d3748;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
}

.user-feedback {
  margin: 12px 0;
}

.user-feedback h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #495057;
}

.user-feedback textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: inherit;
  resize: vertical;
}

/* Safe mode styles */
body.safe-mode {
  filter: grayscale(0.3);
}

body.safe-mode::before {
  content: '🛡️ Safe Mode - Limited Functionality';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fbbf24;
  color: #78350f;
  padding: 8px;
  text-align: center;
  font-weight: bold;
  z-index: 9999;
  font-size: 14px;
}

body.safe-mode .navbar {
  margin-top: 40px;
}

.panel.disabled {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.panel.disabled::after {
  content: 'Temporarily disabled due to errors';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(239, 68, 68, 0.1);
  color: #7f1d1d;
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-weight: 500;
}

/* Content-rich sections for better AdSense approval */
.intro-section {
  position: relative;
  overflow: hidden;
}

.intro-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.5;
  pointer-events: none;
}

.intro-container {
  position: relative;
  z-index: 2;
}

.content-section {
  position: relative;
}

.content-section h2 {
  position: relative;
}

.content-section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #3498db, #27ae60);
  border-radius: 2px;
}

.step-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

.step-number {
  animation: pulse 2s infinite;
}

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

.benefits-grid {
  align-items: center;
}

.features-visual {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Ad placement areas for better AdSense integration */
.ad-container {
  margin: 2rem auto;
  text-align: center;
  min-height: 250px;
  width: 100%;
  max-width: 100%;
  display: block;
  overflow: hidden;
}

.ad-horizontal {
  max-width: 728px;
  width: 100%;
  height: 90px;
  min-height: 90px;
  margin: 1rem auto;
}

.ad-horizontal .adsbygoogle {
  width: 100%;
  height: 90px;
  min-width: 320px;
}

.ad-rectangle {
  max-width: 336px;
  width: 336px;
  height: 280px;
  min-height: 280px;
  margin: 1rem;
}

.ad-rectangle .adsbygoogle {
  width: 336px;
  height: 280px;
  min-width: 336px;
}

.ad-square {
  max-width: 250px;
  width: 250px;
  height: 250px;
  min-height: 250px;
}

.ad-square .adsbygoogle {
  width: 250px;
  height: 250px;
  min-width: 250px;
}

/* Responsive design for content sections */
@media (max-width: 768px) {
  .intro-section {
    padding: 2rem 1rem !important;
  }
  
  .intro-section h1 {
    font-size: 2rem !important;
  }
  
  .feature-highlights {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .steps-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  .benefits-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  
  .content-section {
    padding: 2rem 1rem !important;
  }
  
  .step-card,
  .highlight-card {
    padding: 1rem !important;
  }
  
  .features-visual {
    margin-top: 2rem;
  }
  
  .features-visual > div {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
    text-align: center !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .intro-section {
    background: #000 !important;
    color: #fff !important;
  }
  
  .step-card,
  .highlight-card {
    border: 2px solid #000 !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .step-number {
    animation: none;
  }
  
  .features-visual {
    animation: none;
  }
  
  .step-card {
    transition: none;
  }
}

/* ===================== */
/* NEW CSS CLASSES FOR DARK MODE SUPPORT */
/* ===================== */

/* Help Getting Started Section */
.help-getting-started-section {
  padding: 3rem 2rem;
  background: #f8f9fa;
  text-align: center;
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-getting-started-container {
  max-width: 800px;
  margin: 0 auto;
}

.help-getting-started-title {
  text-align: center;
  margin-bottom: 2rem;
  color: #2c3e50;
  font-size: 2.2rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-getting-started-description {
  color: #666;
  line-height: 1.8;
  margin-bottom: 3rem;
  font-size: 1.1rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.help-card {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.help-card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.help-card-title {
  margin-bottom: 1rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-card-description {
  color: #666;
  line-height: 1.6;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.help-action-btn {
  display: inline-block;
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.help-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
  text-decoration: none;
  color: white;
}

.help-action-btn.guide {
  background: #3498db;
}

.help-action-btn.features {
  background: #27ae60;
}

.help-action-btn.tutorial {
  background: #e74c3c;
}

/* Why Choose MarkdownForge Section */
.why-choose-section {
  padding: 3rem 2rem;
  background: white;
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.why-choose-container {
  max-width: 1200px;
  margin: 0 auto;
}

.why-choose-title {
  text-align: center;
  margin-bottom: 3rem;
  color: #2c3e50;
  font-size: 2.2rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.why-choose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}



.why-choose-content-title {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.why-choose-list {
  list-style: none;
  padding: 0;
}

.why-choose-item {
  margin-bottom: 1rem;
  display: flex;
  align-items: start;
}

.why-choose-check {
  color: #27ae60;
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.why-choose-text {
  color: #666;
  line-height: 1.6;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.why-choose-visual {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  padding: 2rem;
  border-radius: 15px;
  color: white;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.why-choose-visual-title {
  margin-bottom: 1.5rem;
}

.why-choose-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  text-align: left;
}

/* Advanced Features Page Styles */
.features-categories-section {
  padding: 4rem 2rem;
  background: white;
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.features-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem; /* Add padding for mobile spacing */
  box-sizing: border-box; /* Ensure padding is included in width calculations */
}

.features-title {
  text-align: center;
  margin-bottom: 3rem;
  color: #2c3e50;
  font-size: 2.5rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.feature-category-card {
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.feature-category-card.analytics {
  background: #e8f5e8;
  border-left: 5px solid #27ae60;
}

.feature-category-card.templates {
  background: #e8f4fd;
  border-left: 5px solid #3498db;
}

.feature-category-card.tools {
  background: #fff3e0;
  border-left: 5px solid #ff9800;
}

.feature-category-card.export {
  background: #f3e5f5;
  border-left: 5px solid #9b59b6;
}

.feature-category-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-category-title {
  margin-bottom: 1rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-category-title.analytics {
  color: #27ae60;
}

.feature-category-title.templates {
  color: #3498db;
}

.feature-category-title.tools {
  color: #ff9800;
}

.feature-category-title.export {
  color: #9b59b6;
}

.feature-category-description {
  color: #666;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Feature Detail Sections */
.feature-detail-section {
  padding: 4rem 2rem;
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-detail-section.alt {
  background: #f8f9fa;
}

.feature-detail-section.white {
  background: white;
}

.feature-detail-grid {
  display: grid;
  gap: 2rem; /* Reduced from 4rem to prevent overflow */
  align-items: center;
  box-sizing: border-box;
}

.feature-detail-grid.two-col {
  grid-template-columns: 1fr 2fr;
}

/* Mobile responsive fixes for feature detail grid */
@media (max-width: 575px) {
  .feature-detail-grid {
    gap: 1rem; /* Even smaller gap on mobile */
  }
  
  .feature-detail-grid.two-col {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.feature-detail-grid.three-col {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.feature-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-section-header.analytics {
  color: #27ae60;
}

.feature-section-header.templates {
  color: #3498db;
}

.feature-section-header.tools {
  color: #ff9800;
}

.feature-section-header.export {
  color: #9b59b6;
}

.feature-section-icon {
  font-size: 3rem;
}

.feature-description {
  color: #666;
  line-height: 1.8;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-highlight-box {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-highlight-title {
  margin-bottom: 1rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-highlight-title.analytics {
  color: #27ae60;
}

.feature-highlight-title.templates {
  color: #3498db;
}

.feature-highlight-title.tools {
  color: #ff9800;
}

.feature-highlight-title.export {
  color: #9b59b6;
}

.feature-list {
  color: #666;
  line-height: 1.6;
  margin-left: 1rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.analytics-dashboard {
  background: white;
  padding: 3rem;
  border-radius: 15px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.analytics-dashboard-title {
  color: #2c3e50;
  margin-bottom: 2rem;
  text-align: center;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.analytics-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-metric {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.analytics-metric-value {
  font-size: 2rem;
  font-weight: bold;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.analytics-metric-value.analytics {
  color: #27ae60;
}

.analytics-metric-value.templates {
  color: #3498db;
}

.analytics-metric-value.tools {
  color: #e74c3c;
}

.analytics-metric-value.export {
  color: #ff9800;
}

.analytics-metric-label {
  color: #666;
  font-size: 0.9rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.readability-box {
  background: #e8f5e8;
  padding: 1.5rem;
  border-radius: 10px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.readability-title {
  color: #27ae60;
  margin-bottom: 0.5rem;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.readability-description {
  color: #666;
  margin: 0;
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Styles */
body.dark-mode .help-getting-started-section {
  background: #2d2d2d;
  color: #e8e8e8;
}

body.dark-mode .help-getting-started-title {
  color: #ffffff;
}

body.dark-mode .help-getting-started-description {
  color: #cccccc;
}

body.dark-mode .help-card {
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  color: #e8e8e8;
}

body.dark-mode .help-card-title {
  color: #ffffff;
}

body.dark-mode .help-card-description {
  color: #cccccc;
}

body.dark-mode .why-choose-section {
  background: #252525;
  color: #e8e8e8;
}

body.dark-mode .why-choose-title {
  color: #ffffff;
}

body.dark-mode .why-choose-content-title {
  color: #ffffff;
}

body.dark-mode .why-choose-text {
  color: #cccccc;
}

body.dark-mode .why-choose-visual {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Advanced Features Dark Mode */
body.dark-mode .features-categories-section {
  background: #252525;
  color: #e8e8e8;
}

body.dark-mode .features-title {
  color: #ffffff;
}

body.dark-mode .feature-category-card.analytics {
  background: #1a3a1a;
  border-left-color: #4caf50;
}

body.dark-mode .feature-category-card.templates {
  background: #1a2a3a;
  border-left-color: #64b5f6;
}

body.dark-mode .feature-category-card.tools {
  background: #3a2a1a;
  border-left-color: #ffb74d;
}

body.dark-mode .feature-category-card.export {
  background: #2a1a3a;
  border-left-color: #ba68c8;
}

body.dark-mode .feature-category-description {
  color: #cccccc;
}

body.dark-mode .feature-detail-section.alt {
  background: #2d2d2d;
  color: #e8e8e8;
}

body.dark-mode .feature-detail-section.white {
  background: #252525;
  color: #e8e8e8;
}

body.dark-mode .feature-description {
  color: #cccccc;
}

body.dark-mode .feature-highlight-box {
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  color: #e8e8e8;
}

body.dark-mode .feature-list {
  color: #cccccc;
}

body.dark-mode .analytics-dashboard {
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  color: #e8e8e8;
}

body.dark-mode .analytics-dashboard-title {
  color: #ffffff;
}

body.dark-mode .analytics-metric {
  background: #2d2d2d;
  border: 1px solid #4a4a4a;
}

body.dark-mode .analytics-metric-label {
  color: #cccccc;
}

body.dark-mode .readability-box {
  background: #1a3a1a;
}

body.dark-mode .readability-description {
  color: #cccccc;
}

/* Responsive Design */
@media (max-width: 768px) {
  .help-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .help-action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .help-action-btn {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }
  
  .why-choose-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .why-choose-features-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
  }
  
  .help-getting-started-section,
  .why-choose-section {
    padding: 2rem 1rem;
  }
  
  .help-getting-started-title,
  .why-choose-title {
    font-size: 1.8rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .feature-detail-grid.two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .analytics-metrics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .features-categories-section,
  .feature-detail-section {
    padding: 2rem 1rem;
  }
  
  .features-title,
  .feature-section-header {
    font-size: 1.8rem;
  }
}

/* Responsive and Dark Mode Compatible Classes for Inline Style Replacement */

/* Hero/Intro Section Styling - replaces inline gradient backgrounds */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 0;
}

body.dark-mode .hero-section {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

/* Page Header Section - similar to hero but for sub-pages */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

body.dark-mode .page-header {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

/* Responsive containers - replaces fixed max-width inline styles */
.responsive-container {
  max-width: 90%;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .responsive-container {
    max-width: 1200px;
  }
}

/* Responsive intro container - for intro sections */
.intro-container {
  max-width: 90%;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .intro-container {
    max-width: 1200px;
  }
}

/* Hero title styling - replaces inline font-size and text-shadow */
.hero-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 3rem;
  }
}

/* Hero description - responsive text with proper line limits */
.hero-description {
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .hero-description {
    font-size: 1.2rem;
    max-width: 800px;
  }
}

@media (min-width: 1024px) {
  .hero-description {
    font-size: 1.3rem;
  }
}

/* Feature highlights grid - replaces inline grid styles */
.feature-highlights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .feature-highlights {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
  }
}

/* Highlight cards - replaces inline backdrop styling */
.highlight-card {
  background: rgba(255,255,255,0.1);
  padding: 1.5rem;
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

body.dark-mode .highlight-card {
  background: rgba(0,0,0,0.3);
}

/* Highlight card headers */
.highlight-card h3 {
  margin-bottom: 1rem;
}

/* Page content with responsive top padding */
.page-content-padded {
  padding-top: 60px;
}

@media (min-width: 768px) {
  .page-content-padded {
    padding-top: 80px;
  }
}

/* Navbar brand link - removes text decoration and inherits color */
.navbar-brand-link {
  text-decoration: none;
  color: inherit;
}

/* Content sections with responsive white background */
.content-section {
  padding: 2rem 1rem;
  background: white;
}

body.dark-mode .content-section {
  background: #1a1a1a;
}

@media (min-width: 768px) {
  .content-section {
    padding: 4rem 2rem;
  }
}

/* Section headers with responsive font sizes */
.section-header {
  color: #3498db;
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

body.dark-mode .section-header {
  color: #64b5f6;
}

/* Orange variant for section headers */
.section-header.orange {
  color: #ff9800;
}

body.dark-mode .section-header.orange {
  color: #fbbf24;
}

@media (min-width: 768px) {
  .section-header {
    font-size: 2.5rem;
    margin-bottom: 3rem;
  }
}

/* Section header icons */
.section-icon {
  font-size: 2.5rem;
}

@media (min-width: 768px) {
  .section-icon {
    font-size: 3rem;
  }
}

/* Responsive grid layouts */
.responsive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  box-sizing: border-box; /* Ensure proper box model */
}

@media (min-width: 768px) {
  .responsive-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Reduced from 350px to prevent overflow */
    gap: 2rem; /* Reduced gap */
  }
}

/* Feature cards with dark mode support */
.feature-card {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  border-left: 5px solid #3498db;
}

body.dark-mode .feature-card {
  background: #2d2d2d;
  border-left-color: #64b5f6;
}

@media (min-width: 768px) {
  .feature-card {
    padding: 3rem;
  }
}

/* Feature card headers */
.feature-card-header {
  color: #3498db;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

body.dark-mode .feature-card-header {
  color: #64b5f6;
}

@media (min-width: 768px) {
  .feature-card-header {
    margin-bottom: 2rem;
    font-size: 1.5rem;
  }
}

/* Feature card content sections */
.feature-content {
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .feature-content {
    margin-bottom: 2rem;
  }
}

/* Feature card subheaders */
.feature-subheader {
  color: #2c3e50;
  margin-bottom: 1rem;
}

body.dark-mode .feature-subheader {
  color: #e2e8f0;
}

/* Feature lists */
.feature-list {
  color: #666;
  line-height: 1.8;
  margin-left: 1rem;
}

body.dark-mode .feature-list {
  color: #a0a0a0;
}

/* Feature highlights boxes */
.feature-highlight-box {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
}

body.dark-mode .feature-highlight-box {
  background: #1a1a1a;
}

/* Feature highlight labels */
.feature-highlight-label {
  color: #3498db;
  font-weight: bold;
}

body.dark-mode .feature-highlight-label {
  color: #64b5f6;
}

/* Feature highlight content lists */
.feature-highlight-list {
  color: #666;
  line-height: 1.6;
  margin-left: 1rem;
  margin-top: 0.5rem;
}

body.dark-mode .feature-highlight-list {
  color: #a0a0a0;
}

/* Green variant for cards */
.feature-card.green {
  border-left-color: #27ae60;
}

body.dark-mode .feature-card.green {
  border-left-color: #4ade80;
}

.feature-card-header.green {
  color: #27ae60;
}

body.dark-mode .feature-card-header.green {
  color: #4ade80;
}

/* Green variant for feature highlight labels */
.feature-highlight-label.green {
  color: #27ae60;
}

body.dark-mode .feature-highlight-label.green {
  color: #4ade80;
}

/* Red variant for cards */
.feature-card.red {
  border-left-color: #e74c3c;
}

body.dark-mode .feature-card.red {
  border-left-color: #f87171;
}

.feature-card-header.red {
  color: #e74c3c;
}

body.dark-mode .feature-card-header.red {
  color: #f87171;
}

.feature-highlight-label.red {
  color: #e74c3c;
}

body.dark-mode .feature-highlight-label.red {
  color: #f87171;
}

/* Purple variant for cards */
.feature-card.purple {
  border-left-color: #9b59b6;
}

body.dark-mode .feature-card.purple {
  border-left-color: #a855f7;
}

.feature-card-header.purple {
  color: #9b59b6;
}

body.dark-mode .feature-card-header.purple {
  color: #a855f7;
}

.feature-highlight-label.purple {
  color: #9b59b6;
}

body.dark-mode .feature-highlight-label.purple {
  color: #a855f7;
}

/* Orange variant for cards */
.feature-card.orange {
  border-left-color: #e67e22;
}

body.dark-mode .feature-card.orange {
  border-left-color: #fb923c;
}

.feature-card-header.orange {
  color: #e67e22;
}

body.dark-mode .feature-card-header.orange {
  color: #fb923c;
}

.feature-highlight-label.orange {
  color: #e67e22;
}

body.dark-mode .feature-highlight-label.orange {
  color: #fb923c;
}

/* Alternative background section styling */
.content-section-alt {
  padding: 2rem 1rem;
  background: #f8f9fa;
}

body.dark-mode .content-section-alt {
  background: #0f1419;
}

@media (min-width: 768px) {
  .content-section-alt {
    padding: 4rem 2rem;
  }
}

/* Feature demo box styling */
.feature-demo-box {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
}

body.dark-mode .feature-demo-box {
  background: #2d2d2d;
}

/* Demo grid layouts */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  color: #666;
  font-size: 0.9rem;
}

body.dark-mode .demo-grid {
  color: #a0a0a0;
}

/* Special highlight boxes with colored backgrounds */
.special-highlight-box {
  padding: 1.5rem;
  border-radius: 8px;
}

.special-highlight-box.orange {
  background: #fff3e0;
}

body.dark-mode .special-highlight-box.orange {
  background: rgba(251, 191, 36, 0.1);
}

.special-highlight-box.blue {
  background: #e3f2fd;
}

body.dark-mode .special-highlight-box.blue {
  background: rgba(100, 181, 246, 0.1);
}

.special-highlight-box.green {
  background: #e8f5e8;
}

body.dark-mode .special-highlight-box.green {
  background: rgba(74, 222, 128, 0.1);
}

/* Additional spacing utilities */
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-2 { margin-top: 2rem; }

/* Text styling utilities */
.text-center { text-align: center; }
.text-large { font-size: 1.2rem; line-height: 1.8; }
.text-medium { font-size: 1.1rem; line-height: 1.6; }

body.dark-mode .text-large,
body.dark-mode .text-medium {
  color: inherit;
}

/* Flexbox utilities */
.flex { display: flex; }
.flex-center { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 1rem; 
}

/* Grid utilities for different column configurations */
.grid-auto-fit-250 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.grid-auto-fit-300 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.grid-auto-fit-400 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 3rem;
}

@media (max-width: 768px) {
  .grid-auto-fit-250,
  .grid-auto-fit-300,
  .grid-auto-fit-400 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Additional background variants */
.bg-light {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 10px;
}

body.dark-mode .bg-light {
  background: #2d2d2d;
}

.bg-white {
  background: white;
  padding: 2rem;
  border-radius: 10px;
}

body.dark-mode .bg-white {
  background: #1a1a1a;
}

/* Color utility classes */
.text-blue { color: #3498db; }
.text-green { color: #27ae60; }
.text-red { color: #e74c3c; }

body.dark-mode .text-blue { color: #64b5f6; }
body.dark-mode .text-green { color: #4ade80; }
body.dark-mode .text-red { color: #f87171; }

/* Additional color utilities */
.text-orange { color: #ff9800; }
.text-dark { color: #2c3e50; }
.text-gray { color: #666; }

body.dark-mode .text-orange { color: #fbbf24; }
body.dark-mode .text-dark { color: #e2e8f0; }
body.dark-mode .text-gray { color: #a0a0a0; }

/* Extended spacing utilities */
.mb-15 { margin-bottom: 1.5rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-1 { margin-top: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-15 { padding: 1.5rem; }
.p-3 { padding: 3rem; }

/* Font size utilities */
.text-sm { font-size: 0.9rem; }
.text-xl { font-size: 1.5rem; }
.text-2xl { font-size: 2rem; }
.text-3xl { font-size: 2.5rem; }

/* Line height utilities */
.leading-normal { line-height: 1.6; }
.leading-relaxed { line-height: 1.8; }

/* Border radius utilities */
.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 10px; }
.rounded-xl { border-radius: 15px; }

/* Shadow utilities */
.shadow { box-shadow: 0 6px 12px rgba(0,0,0,0.1); }

body.dark-mode .shadow { box-shadow: 0 6px 12px rgba(0,0,0,0.3); }

/* Display utilities */
.block { display: block; }
.grid { display: grid; }

/* ===================== */
/* DARK MODE FIXES */
/* ===================== */

/* Cheat Sheet Panel Dark Mode */
body.dark-mode .cheat-sheet-panel {
  background: #2d2d2d !important;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3) !important;
}

/* Footer Back to Editor Link Dark Mode */
body.dark-mode .footer-right a {
  color: #64b5f6 !important;
}

body.dark-mode .footer-right a:hover {
  color: #90caf9 !important;
}

/* Navbar Dark Mode Improvements */
body.dark-mode .navbar {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d) !important;
}

/* Tutorial Page Cheat Sheet Tables */
body.dark-mode .cheat-sheet-panel table {
  color: #e8e8e8;
}

body.dark-mode .cheat-sheet-panel h3 {
  color: #64b5f6 !important;
}

body.dark-mode .cheat-sheet-panel td {
  color: #cccccc !important;
}

/* Advanced Features Page Card Improvements */
body.dark-mode .feature-category-card h3 {
  color: #ffffff !important;
}

body.dark-mode .feature-category-card p {
  color: #cccccc !important;
}

/* Tutorial Page "What You'll Learn" Cards */
body.dark-mode .tutorial-toc-section {
  background: #2d2d2d !important;
}

body.dark-mode .tutorial-card {
  background: #3a3a3a !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
}

body.dark-mode .tutorial-card h3 {
  color: #64b5f6 !important;
}

/* ===================== */
/* COMPONENT STYLES - REPLACING INLINE STYLES */
/* ===================== */

/* Step Cards - Universal styling for all step components */
.step-card {
  background: var(--color-surface);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--color-accent-alt);
  margin-bottom: var(--space-xl);
  transition: all var(--transition-base);
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.step-card.step-card--success {
  border-left-color: var(--color-success);
}

.step-card.step-card--accent {
  border-left-color: var(--color-accent);
}

/* Step Numbers - Circular numbered badges */
.step-number {
  background: var(--color-accent-alt);
  color: var(--color-text-inverse);
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-lg);
  flex-shrink: 0;
}

.step-number--success {
  background: var(--color-success);
}

.step-number--accent {
  background: var(--color-accent);
}

/* Process Steps - Main content blocks */
.process-step {
  margin-bottom: var(--space-3xl);
  padding: var(--space-3xl);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border-light);
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
  color: var(--color-secondary);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

.section-header.section-header--lg {
  font-size: 2.5rem;
}

/* Process Step Headers */
.process-step-header {
  color: var(--color-accent-alt);
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: var(--font-weight-bold);
}

.process-step-header .step-number {
  width: 40px;
  height: 40px;
  font-size: var(--font-size-lg);
  margin-bottom: 0;
}

/* Content Cards */
.content-card {
  background: var(--color-surface);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-lg);
}

.content-card--elevated {
  box-shadow: var(--shadow-lg);
}

/* Typography Helpers */
.text-primary {
  color: var(--color-text-primary);
}

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

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

.text-center {
  text-align: center;
}

.text-lg {
  font-size: var(--font-size-lg);
  line-height: 1.6;
}

.text-gray {
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.text-gray--light {
  line-height: 1.6;
  margin-left: var(--space-md);
}

/* Quick Tips & Info Boxes */
.quick-tips-box {
  background: var(--color-surface-alt);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-primary);
  margin: var(--space-lg) 0;
}

.tip-indicator {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.tip-indicator--pro {
  color: var(--color-success);
}

.tip-indicator--warning {
  color: var(--color-warning);
}

.tip-indicator--important {
  color: var(--color-error);
}

/* Feature Category Cards */
.feature-category-card {
  background: var(--color-surface);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: all var(--transition-base);
  border: 1px solid var(--color-border-light);
}

.feature-category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-border-focus);
}

.feature-category-card .icon {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
  display: block;
}

.feature-category-card h3 {
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-semibold);
}

.feature-category-card p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* Analytics Dashboard Cards */
.analytics-card {
  background: var(--color-surface);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  min-width: 120px;
  border: 1px solid var(--color-border-light);
}

.analytics-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.analytics-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

/* Tutorial Cards */
.tutorial-card {
  background: var(--color-surface);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 1px solid var(--color-border-light);
}

.tutorial-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.tutorial-card .icon {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
  display: block;
}

.tutorial-card h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-semibold);
}

/* Layout Helpers */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  box-sizing: border-box; /* Include padding in width calculation */
}

/* Mobile-first approach for grid layouts */
@media (max-width: 575px) {
  .grid-2-cols {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

.grid-3-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.grid-4-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* Responsive Grid Adjustments */
@media (max-width: 768px) {
  .grid-2-cols,
  .grid-3-cols,
  .grid-4-cols {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .step-card {
    padding: var(--space-lg);
  }
  
  .process-step {
    padding: var(--space-lg);
  }
  
  .section-header,
  .section-header.section-header--lg {
    font-size: var(--font-size-2xl);
  }
}

/* Button Standardization */
.btn-standard {
  background: var(--color-interactive);
  color: var(--color-text-inverse);
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all var(--transition-base);
  cursor: pointer;
}

.btn-standard:hover {
  background: var(--color-interactive-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-standard:active {
  transform: translateY(0);
  background: var(--color-interactive-active);
}

.btn-standard:focus {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* Code Block Styling */
.code-block {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  overflow-x: auto;
  margin: var(--space-md) 0;
}

/* Table Styling */
.table-standard {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-standard th {
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.table-standard td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-primary);
}

.table-standard tbody tr:hover {
  background: var(--color-surface-alt);
}

/* Remove all !important dark mode overrides - now handled by CSS variables */

/* Additional utility classes for remaining functionality */
.font-bold {
  font-weight: var(--font-weight-bold);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-lg {
  gap: var(--space-lg);
}

/* Enhanced button hover states for consistency */
.btn-standard,
.navbar-btn {
  transition: all var(--transition-base);
}

.btn-standard:hover,
.navbar-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Ensure proper focus states on all interactive elements */
button, 
.btn-standard,
.nav-link,
.navbar-btn,
.footer-btn,
input[type="text"],
textarea,
select {
  transition: all var(--transition-base);
}

button:focus,
.btn-standard:focus,
.nav-link:focus,
.navbar-btn:focus,
.footer-btn:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* Ensure icons are consistent sizes */
.icon-sm {
  font-size: var(--font-size-lg);
}

.icon-md {
  font-size: var(--font-size-xl);
}

.icon-lg {
  font-size: var(--font-size-2xl);
}

.icon-xl {
  font-size: var(--font-size-3xl);
}

/* ===================== */
/* CLASSES FOR INLINE STYLE REPLACEMENT */
/* ===================== */

/* Advanced Features Page - Export Section */
.export-section {
  padding: var(--space-3xl) var(--space-xl);
  background: var(--color-surface);
}

.export-section-header {
  color: var(--color-accent-alt);
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-3xl);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.export-format-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.export-format-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  display: block;
}

.export-format-title {
  color: var(--color-accent-alt);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

.export-format-highlight {
  color: var(--color-accent-alt);
  font-weight: var(--font-weight-semibold);
}

/* Keyboard Shortcuts Grid */
.shortcuts-grid {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.shortcut-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.shortcut-row:last-child {
  margin-bottom: 0;
}

/* CTA Section Layout */
.cta-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}



.cta-button {
  display: inline-block;
  background: var(--color-surface);
  color: var(--color-primary);
  padding: var(--space-md) var(--space-xl);
  border-radius: 50px;
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* Footer Link Styling */
.footer-link {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-base);
}

.footer-link:hover {
  text-decoration: underline;
}

/* Dark Mode Overrides for Export Section */
body.dark-mode .export-section {
  background: var(--color-surface-elevated);
}

body.dark-mode .export-section-header {
  color: var(--color-primary-light);
}

body.dark-mode .export-format-title {
  color: var(--color-primary-light);
}

body.dark-mode .export-format-highlight {
  color: var(--color-primary-light);
}

body.dark-mode .cta-button {
  background: var(--color-surface-elevated);
  color: var(--color-primary-light);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .export-section {
    padding: var(--space-xl) var(--space-md);
  }
  
  .export-section-header {
    font-size: var(--font-size-2xl);
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .export-format-icon {
    font-size: 3rem;
  }
  
  .export-format-title {
    font-size: var(--font-size-lg);
  }
  
  .cta-title {
    font-size: var(--font-size-2xl);
  }
  
  .cta-description {
    font-size: var(--font-size-base);
  }
}

/* ===================== */
/* HOW-TO GUIDE PAGE STYLES */
/* ===================== */

/* Step cards titles and headers */
.step-title {
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-xl);
  color: var(--color-text-primary);
}

/* Process step headers with color variations */
.process-step-header-green {
  color: var(--color-success);
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: var(--font-weight-bold);
}

.process-step-header-red {
  color: var(--color-error);
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: var(--font-weight-bold);
}

/* Subheaders with color variations */
.subheader-green {
  color: var(--color-success);
  margin-bottom: var(--space-md);
}

.subheader-orange {
  color: var(--color-warning);
  margin-bottom: var(--space-md);
}

.subheader-red {
  color: var(--color-error);
  margin-bottom: var(--space-lg);
}

.subheader-purple {
  color: var(--color-accent-alt);
  margin-bottom: var(--space-lg);
}

/* Ordered list with custom styling */
.ordered-list-styled {
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-left: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* CTA button variant for how-to guide */
.cta-button-pink {
  display: inline-block;
  background: var(--color-surface);
  color: #f5576c;
  padding: var(--space-md) var(--space-xl);
  border-radius: 50px;
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

.cta-button-pink:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* Dark mode adjustments for how-to guide */
body.dark-mode .process-step-header-green {
  color: var(--color-success);
}

body.dark-mode .process-step-header-red {
  color: #f87171;
}

body.dark-mode .subheader-green {
  color: var(--color-success);
}

body.dark-mode .subheader-orange {
  color: #fbbf24;
}

body.dark-mode .subheader-red {
  color: #f87171;
}

body.dark-mode .subheader-purple {
  color: var(--color-primary-light);
}

body.dark-mode .cta-button-pink {
  background: var(--color-surface-elevated);
  color: #f87171;
}

/* Responsive adjustments for how-to guide */
@media (max-width: 768px) {
  .process-step-header-green,
  .process-step-header-red {
    font-size: var(--font-size-xl);
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .step-title {
    font-size: var(--font-size-lg);
  }
}

/* ===================== */
/* MARKDOWN TUTORIAL PAGE STYLES */
/* ===================== */

/* Tutorial TOC section */
.tutorial-toc-section {
  padding: var(--space-3xl) var(--space-xl);
  background: var(--color-surface-alt);
}

/* Tutorial card icons */
.tutorial-icon {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
  display: block;
}

/* Section headers with color variants for tutorial */
.tutorial-section-header {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-3xl);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.tutorial-section-header.blue {
  color: var(--color-accent-alt);
}

.tutorial-section-header.green {
  color: var(--color-success);
}

.tutorial-section-header.red {
  color: var(--color-error);
}

.tutorial-section-header.purple {
  color: var(--color-accent-alt);
}

/* Typography demonstrations */
.demo-header-1 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-sm);
  color: var(--color-secondary);
}

.demo-header-5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
  color: var(--color-secondary);
}

.demo-header-6 {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-sm);
  color: var(--color-secondary);
}

/* Demo blockquote */
.demo-blockquote {
  border-left: 4px solid var(--color-accent-alt);
  margin: var(--space-md) 0;
  padding-left: var(--space-md);
  color: var(--color-text-secondary);
}

/* List demonstrations */
.demo-list-label {
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-bold);
}

.demo-nested-list {
  margin-left: var(--space-md);
  margin-bottom: var(--space-lg);
}

.demo-nested-sub {
  margin-left: var(--space-md);
  margin-top: var(--space-sm);
}

/* Link demonstrations */
.demo-link {
  color: var(--color-accent-alt);
  text-decoration: none;
}

.demo-link:hover {
  text-decoration: underline;
}

/* Table demonstrations */
.demo-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-xl);
  font-family: var(--font-family-base);
}

.demo-table th,
.demo-table td {
  border: 1px solid var(--color-border);
  padding: 0.75rem;
}

.demo-table th {
  background: var(--color-surface-alt);
  font-weight: var(--font-weight-semibold);
  text-align: left;
}

.demo-table-center {
  text-align: center;
}

.demo-table-right {
  text-align: right;
}

/* Code syntax highlighting demo */
.syntax-keyword {
  color: #d73a49;
}

.syntax-function {
  color: #6f42c1;
}

.syntax-console {
  color: #005cc5;
}

.syntax-string {
  color: #032f62;
}

.syntax-return {
  color: #d73a49;
}

.syntax-boolean {
  color: #005cc5;
}

/* Cheat sheet panel */
.cheat-sheet-panel {
  background: var(--color-surface);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

/* Cheat sheet tables */
.cheat-table {
  width: 100%;
  font-family: var(--font-family-mono);
  font-size: 0.9rem;
}

.cheat-table td {
  padding: var(--space-sm);
  vertical-align: top;
}

.cheat-table td:first-child {
  color: var(--color-text-secondary);
  font-family: var(--font-family-mono);
}

/* Subheaders with color variants for tutorial */
.tutorial-subheader-green {
  color: var(--color-success);
  margin-bottom: var(--space-lg);
}

.tutorial-subheader-red {
  color: var(--color-error);
  margin-bottom: var(--space-lg);
}

.tutorial-subheader-purple {
  color: var(--color-accent-alt);
  margin-bottom: var(--space-lg);
}

/* CTA button variant for tutorial */
.cta-button-blue {
  display: inline-block;
  background: var(--color-surface);
  color: #667eea;
  padding: var(--space-md) var(--space-xl);
  border-radius: 50px;
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

.cta-button-blue:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* Dark mode adjustments for tutorial */
body.dark-mode .tutorial-toc-section {
  background: var(--color-surface-elevated);
}

body.dark-mode .tutorial-section-header.blue {
  color: var(--color-primary-light);
}

body.dark-mode .tutorial-section-header.green {
  color: var(--color-success);
}

body.dark-mode .tutorial-section-header.red {
  color: #f87171;
}

body.dark-mode .tutorial-section-header.purple {
  color: var(--color-primary-light);
}

body.dark-mode .demo-header-1,
body.dark-mode .demo-header-5,
body.dark-mode .demo-header-6 {
  color: var(--color-text-primary);
}

body.dark-mode .demo-blockquote {
  border-left-color: var(--color-primary-light);
  color: var(--color-text-secondary);
}

body.dark-mode .demo-link {
  color: var(--color-primary-light);
}

body.dark-mode .cheat-sheet-panel {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
}

body.dark-mode .demo-table th {
  background: var(--color-surface-alt);
}

body.dark-mode .demo-table th,
body.dark-mode .demo-table td {
  border-color: var(--color-border);
}

body.dark-mode .tutorial-subheader-green {
  color: var(--color-success);
}

body.dark-mode .tutorial-subheader-red {
  color: #f87171;
}

body.dark-mode .tutorial-subheader-purple {
  color: var(--color-primary-light);
}

body.dark-mode .cta-button-blue {
  background: var(--color-surface-elevated);
  color: var(--color-primary-light);
}

/* Responsive adjustments for tutorial */
@media (max-width: 768px) {
  .tutorial-toc-section {
    padding: var(--space-xl) var(--space-md);
  }
  
  .tutorial-section-header {
    font-size: var(--font-size-2xl);
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .tutorial-icon {
    font-size: var(--font-size-xl);
  }
  
  .demo-table {
    font-size: 0.8rem;
  }
  
  .demo-table th,
  .demo-table td {
    padding: 0.5rem;
  }
  
  .cheat-table {
    font-size: 0.8rem;
  }
}

/* ===================== */
/* ENHANCED RESPONSIVE DESIGN SYSTEM */
/* ===================== */

/* New responsive breakpoints - more comprehensive */
:root {
  --breakpoint-xs: 320px;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;
}

/* Responsive spacing scale */
@media (max-width: 575px) {
  :root {
    --space-xs: 0.125rem;
    --space-sm: 0.25rem;
    --space-md: 0.5rem;
    --space-lg: 0.75rem;
    --space-xl: 1rem;
    --space-2xl: 1.5rem;
    --space-3xl: 2rem;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  :root {
    --space-xs: 0.25rem;
    --space-sm: 0.375rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.25rem;
    --space-2xl: 1.75rem;
    --space-3xl: 2.25rem;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  :root {
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 2.5rem;
    --space-3xl: 3rem;
  }
}

/* Enhanced responsive containers */
.responsive-container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  max-width: 100%;
}

@media (min-width: 576px) {
  .responsive-container {
    max-width: 540px;
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

@media (min-width: 768px) {
  .responsive-container {
    max-width: 720px;
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }
}

@media (min-width: 992px) {
  .responsive-container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .responsive-container {
    max-width: 1140px;
  }
}

@media (min-width: 1400px) {
  .responsive-container {
    max-width: 1320px;
  }
}

/* Enhanced grid system with proper spacing and mobile overflow fixes */
.responsive-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
  box-sizing: border-box;
  max-width: 100%;
}

@media (min-width: 576px) {
  .responsive-grid {
    gap: var(--space-xl);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Reduced from 240px */
  }
}

@media (min-width: 768px) {
  .responsive-grid {
    gap: var(--space-2xl);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* Reduced from 280px */
  }
}

@media (min-width: 992px) {
  .responsive-grid {
    gap: var(--space-3xl);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Reduced from 300px */
  }
}

/* Enhanced navbar responsiveness */
@media (max-width: 575px) {
  .navbar-container {
    padding: var(--space-xs) var(--space-sm);
    min-height: 44px;
    gap: var(--space-xs);
  }
  
  .logo {
    font-size: 1rem;
  }
  
  .nav-link {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .navbar-container {
    padding: var(--space-sm) var(--space-md);
    min-height: 46px;
  }
  
  .logo {
    font-size: 1.1rem;
  }
}

/* Enhanced footer responsiveness */
@media (max-width: 575px) {
  .footer-container {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
    padding: var(--space-sm);
  }
  
  .footer-left p {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  
  .footer-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.7rem;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .footer-container {
    padding: var(--space-sm) var(--space-md);
  }
  
  .footer-left p {
    font-size: 0.75rem;
  }
  
  .footer-btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8rem;
  }
}

/* Enhanced mobile responsive design improvements for horizontal scroll issues */
@media (max-width: 575px) {
  /* Fix horizontal overflow on mobile by ensuring all containers fit */
  .features-container,
  .responsive-container,
  .feature-detail-grid,
  .responsive-grid,
  .grid-2-cols {
    max-width: 100%;
    box-sizing: border-box;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
  
  /* Specific fix for problematic grid layouts */
  .responsive-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .grid-2-cols {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  /* Ensure feature cards don't overflow */
  .feature-card,
  .content-card {
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
  }
  
  /* Fix for analytics dashboard - ENHANCED */
  .analytics-dashboard {
    max-width: 100%;
    overflow-x: hidden;
    padding: var(--space-sm);
  }
  
  .analytics-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .analytics-metric {
    min-width: 0; /* Allow flex items to shrink below content size */
    padding: var(--space-sm);
    text-align: center;
  }
  
  .analytics-metric-value {
    font-size: var(--font-size-lg);
    word-break: break-word;
  }
  
  .analytics-metric-label {
    font-size: var(--font-size-xs);
    word-break: break-word;
  }
  
  /* Fix for document analytics section layout */
  .feature-detail-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    max-width: 100%;
  }
  
  .feature-detail-grid.two-col {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  /* IMPROVED Fix for tables causing horizontal overflow */
  .demo-table,
  .table-standard,
  .cheat-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    background: var(--color-surface);
  }
  
  /* Convert tables to card layout on mobile */
  .demo-table thead,
  .demo-table tbody,
  .demo-table th,
  .demo-table td,
  .demo-table tr,
  .table-standard thead,
  .table-standard tbody,
  .table-standard th,
  .table-standard td,
  .table-standard tr,
  .cheat-table thead,
  .cheat-table tbody,
  .cheat-table th,
  .cheat-table td,
  .cheat-table tr {
    display: block;
  }
  
  .demo-table thead tr,
  .table-standard thead tr,
  .cheat-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .demo-table tr,
  .table-standard tr,
  .cheat-table tr {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    position: relative;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }
  
  .demo-table td,
  .table-standard td,
  .cheat-table td {
    border: none;
    border-bottom: 1px solid var(--color-border-light);
    position: relative;
    padding-left: 35% !important;
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
    padding-right: var(--space-sm);
    white-space: normal;
    text-align: left;
    line-height: 1.4;
  }
  
  .demo-table td:last-child,
  .table-standard td:last-child,
  .cheat-table td:last-child {
    border-bottom: none;
  }
  
  .demo-table td:before,
  .table-standard td:before,
  .cheat-table td:before {
    content: attr(data-label);
    position: absolute;
    left: var(--space-sm);
    top: var(--space-sm);
    width: 30%;
    padding-right: var(--space-sm);
    white-space: normal;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    font-size: 0.85rem;
    line-height: 1.3;
  }
  
  /* Fix for cheat sheet tables causing horizontal overflow */
  .cheat-sheet-panel {
    padding: var(--space-md);
    max-width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
  }
  
  /* IMPROVED Fix for code blocks to prevent horizontal overflow */
  .code-block,
  pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    font-family: var(--font-family-mono);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: var(--space-md) 0;
  }
  
  /* Special handling for grid layouts with code blocks */
  .grid-2-cols .code-block,
  .grid-2-cols pre {
    font-size: 0.75rem;
    padding: var(--space-sm);
    overflow-x: auto;
    overflow-y: hidden;
    max-width: calc(100vw - 2rem);
  }
  
  /* Ensure content cards don't cause overflow */
  .content-card {
    max-width: 100%;
    overflow-x: hidden;
    padding: var(--space-md);
  }
  
  .grid-2-cols {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .grid-2-cols > * {
    max-width: 100%;
    overflow-x: hidden;
  }
  
  /* Force all main content elements to respect viewport width */
  .page-content,
  .page-content-padded,
  .content-section,
  .content-section-alt {
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }
}

/* Enhanced panel layout responsiveness */
@media (max-width: 575px) {
  #app {
    flex-direction: column;
    padding: var(--space-xs);
    min-height: calc(100vh - 100px);
  }
  
  .panel {
    padding: var(--space-sm);
    margin: var(--space-xs) 0;
    border-radius: var(--radius-md);
  }
  
  #panel-resizer {
    display: none;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  #app {
    flex-direction: column;
    padding: var(--space-sm);
  }
  
  .panel {
    padding: var(--space-md);
    margin: var(--space-sm) 0;
  }
  
  #panel-resizer {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  #app {
    padding: var(--space-sm) var(--space-xs);
  }
  
  .panel {
    padding: var(--space-lg);
    margin: var(--space-xs) var(--space-xs);
  }
}

/* Enhanced content sections responsiveness */
@media (max-width: 575px) {
  .content-section,
  .content-section-alt {
    padding: var(--space-lg) var(--space-sm);
  }
  
  .section-header {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-lg);
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .section-icon {
    font-size: var(--font-size-xl);
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .content-section,
  .content-section-alt {
    padding: var(--space-xl) var(--space-md);
  }
  
  .section-header {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-xl);
  }
  
  .section-icon {
    font-size: var(--font-size-2xl);
  }
}

/* Enhanced cards responsiveness */
@media (max-width: 575px) {
  .feature-card,
  .content-card,
  .step-card {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }
  
  .feature-card-header,
  .step-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-sm);
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .feature-card,
  .content-card,
  .step-card {
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
  }
}

/* Enhanced button responsiveness */
@media (max-width: 575px) {
  .btn,
  .help-action-btn,
  .cta-button,
  .cta-button-pink,
  .cta-button-blue {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    display: block;
    text-align: center;
  }
  
  .qa-btn {
    padding: var(--space-xs);
    min-width: 32px;
    height: 32px;
    font-size: var(--font-size-sm);
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .btn,
  .help-action-btn,
  .cta-button,
  .cta-button-pink,
  .cta-button-blue {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-base);
  }
}

/* Enhanced quick access toolbar responsiveness */
@media (max-width: 575px) {
  .quick-access-toolbar {
    padding: var(--space-md);
    margin: var(--space-md) 0;
  }
  
  .quick-access-bar {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .qa-group {
    min-width: 100%;
  }
  
  .qa-inputs,
  .qa-controls,
  .qa-buttons {
    flex-wrap: wrap;
    gap: var(--space-xs);
  }
  
  .qa-input-compact {
    min-width: 100%;
    margin-bottom: var(--space-xs);
  }
}

/* Enhanced formatting toolbar responsiveness */
@media (max-width: 575px) {
  .formatting-toolbar {
    padding: var(--space-xs);
    gap: var(--space-xs);
    flex-wrap: wrap;
    justify-content: space-around;
  }
  
  .format-btn {
    padding: var(--space-xs);
    min-width: 28px;
    height: 28px;
    font-size: var(--font-size-xs);
  }
  
  .format-dropdown-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 250px;
    z-index: 10000;
  }
}

/* Enhanced modal responsiveness */
@media (max-width: 575px) {
  .modal-content {
    width: 95vw;
    max-width: 95vw;
    margin: var(--space-sm);
    padding: var(--space-md);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .analytics-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .modal-content {
    width: 90vw;
    max-width: 500px;
  }
  
  .analytics-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

/* Print optimizations */
@media print {
  /* Hide navigation and UI elements */
  .navbar,
  .theme-toggle,
  .floating-actions,
  .notification-system,
  .toolbar,
  .formatting-toolbar,
  footer,
  .footer {
    display: none !important;
  }
  
  /* Reset page layout */
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.5;
  }
  
  /* Only show preview content */
  .main-container,
  .editor-container {
    display: none !important;
  }
  
  .preview-container,
  #preview-pane {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: white !important;
  }
  
  /* Remove empty containers that cause blank pages */
  .empty,
  .hidden,
  [style*="display: none"],
  [style*="visibility: hidden"] {
    display: none !important;
  }
  
  /* Ensure content flows properly */
  .responsive-container {
    max-width: none;
    padding: 0;
  }
  
  .content-section,
  .content-section-alt {
    padding: 1rem 0;
    page-break-inside: avoid;
  }
  
  .panel {
    padding: 0;
    margin: 0;
    box-shadow: none;
    border: none;
  }
  
  /* Improve page breaks */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  p, ul, ol, dl {
    page-break-inside: avoid;
  }
  
  /* Print header styling */
  .print-document-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #333;
    page-break-after: avoid;
  }
  
  .print-document-title {
    font-size: 24pt;
    font-weight: bold;
    margin-bottom: 0.5rem;
  }
  
  .print-document-meta {
    font-size: 12pt;
    color: #666;
  }
  
  /* Code blocks in print */
  pre, code {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
    padding: 0.5rem !important;
    page-break-inside: avoid;
  }
  
  /* Tables in print */
  table {
    page-break-inside: avoid;
    border-collapse: collapse;
    width: 100%;
  }
  
  th, td {
    border: 1px solid #ddd;
    padding: 0.5rem;
  }
}

/* ===================== */
/* ENHANCED CTA SECTION WITH COMPREHENSIVE DESIGN */
/* ===================== */

.cta-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-text-inverse);
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  margin: var(--space-2xl) 0;
  position: relative;
  overflow: visible;
  min-height: auto;
}

/* Dark mode CTA with better contrast */
body.dark-mode .cta-section {
  background: linear-gradient(135deg, #37474f 0%, #263238 100%);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.cta-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}



/* Feature Grid */
.cta-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin: var(--space-2xl) 0;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.cta-feature {
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.cta-feature:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.cta-feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
}

.cta-feature-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  color: var(--color-text-inverse);
}

.cta-feature-desc {
  font-size: var(--font-size-base);
  opacity: 0.9;
  line-height: 1.5;
}

/* Social Proof Section */
.cta-social-proof {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin: var(--space-2xl) 0;
  flex-wrap: wrap;
}

.cta-stat {
  text-align: center;
  padding: var(--space-md);
}

.cta-stat-number {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-inverse);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cta-stat-label {
  display: block;
  font-size: var(--font-size-sm);
  opacity: 0.8;
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* CTA Title and Description */
.cta-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-lg);
  color: var(--color-text-inverse);
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cta-description {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2xl);
  color: var(--color-text-inverse);
  opacity: 0.95;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* CTA Actions */
.cta-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin: var(--space-2xl) 0;
  flex-wrap: wrap;
}

/* Value Proposition */
.cta-value-prop {
  margin-top: var(--space-2xl);
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-value-prop p {
  margin: 0;
  font-size: var(--font-size-base);
  line-height: 1.6;
  opacity: 0.95;
}

/* CTA background pattern */
.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="ctaGrid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23ctaGrid)"/></svg>');
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

body.dark-mode .cta-section::before {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="ctaGrid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23ctaGrid)"/></svg>');
  opacity: 0.2;
}

/* Responsive CTA */
@media (max-width: 768px) {
  .cta-section {
    padding: var(--space-2xl) var(--space-md);
  }
  
  .cta-title {
    font-size: var(--font-size-2xl);
  }
  
  .cta-description {
    font-size: var(--font-size-base);
  }
  
  .cta-features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .cta-feature {
    padding: var(--space-lg);
  }
  
  .cta-social-proof {
    gap: var(--space-lg);
  }
  
  .cta-actions {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .cta-btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
}


body.dark-mode .cta-title {
  color: var(--color-text-inverse);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}


body.dark-mode .cta-description {
  color: rgba(255, 255, 255, 0.9);
}


.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-2xl);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.cta-btn.primary {
  background: var(--color-text-inverse);
  color: var(--color-primary);
  border: 2px solid var(--color-text-inverse);
}

.cta-btn.primary:hover {
  background: transparent;
  color: var(--color-text-inverse);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.cta-btn.secondary {
  background: transparent;
  color: var(--color-text-inverse);
  border: 2px solid var(--color-text-inverse);
}

.cta-btn.secondary:hover {
  background: var(--color-text-inverse);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Dark mode CTA buttons */
body.dark-mode .cta-btn.primary {
  background: #ffffff;
  color: #263238;
  border-color: #ffffff;
}

body.dark-mode .cta-btn.primary:hover {
  background: transparent;
  color: #ffffff;
  border-color: #ffffff;
}

body.dark-mode .cta-btn.secondary {
  background: transparent;
  color: #ffffff;
  border-color: #ffffff;
}

body.dark-mode .cta-btn.secondary:hover {
  background: #ffffff;
  color: #263238;
}

/* CTA background pattern */
.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="ctaGrid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23ctaGrid)"/></svg>');
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

body.dark-mode .cta-section::before {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="ctaGrid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23ctaGrid)"/></svg>');
  opacity: 0.2;
}

/* Responsive CTA */
@media (max-width: 768px) {
  .cta-section {
    padding: var(--space-2xl) var(--space-md);
  }
  
  .cta-title {
    font-size: var(--font-size-2xl);
  }
  
  .cta-actions {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .cta-btn {
    width: 100%;
    justify-content: center;
    padding: var(--space-md) var(--space-lg);
  }
}

/* ===================== */
/* ACCESSIBILITY ENHANCEMENTS */
/* ===================== */

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

/* Enhanced focus management */
*:focus-visible {
  outline: 3px solid var(--color-interactive);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000000;
    --color-text-primary: #000000;
    --color-background: #ffffff;
  }
  
  body.dark-mode {
    --color-border: #ffffff;
    --color-text-primary: #ffffff;
    --color-background: #000000;
  }
  
  .cta-btn,
  .btn,
  .format-btn {
    border-width: 2px !important;
    font-weight: var(--font-weight-bold) !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .highlight-card::before,
  .cta-section::before,
  .hero-section::before {
    display: none !important;
  }
}

/* Enhanced responsive typography for accessibility */
@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: clamp(1.125rem, 4vw, 1.5rem);
  }
  
  .hero-description {
    font-size: clamp(0.875rem, 3vw, 1.125rem);
  }
  
  .trust-indicators {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .trust-item {
    justify-content: center;
  }
}

/* ===================== */
/* OPTIMIZED CSS PERFORMANCE IMPROVEMENTS */
/* ===================== */

/* Use transform3d to enable hardware acceleration for smooth animations */
.btn, .qa-btn, .format-btn, .help-action-btn,
.floating-theme-btn, .panel-resizer {
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* Optimize transitions by combining properties */
.btn, .qa-btn, .format-btn, .help-action-btn {
  transition: transform var(--transition-fast), 
              background-color var(--transition-fast), 
              border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}

/* Use contain property for better layout performance */
.panel {
  contain: layout style;
}

.modal-content {
  contain: layout;
}

/* Optimize scrolling performance */
.formatting-toolbar {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

/* Reduce paint complexity with simpler selectors */
.qa-btn:not(:disabled):hover,
.format-btn:not(:disabled):hover,
.btn:not(:disabled):hover {
  transform: translate3d(0, -1px, 0);
}

.qa-btn:not(:disabled):active,
.format-btn:not(:disabled):active,
.btn:not(:disabled):active {
  transform: translate3d(0, 0, 0);
}

/* ===================== */
/* FINAL POLISH AND CONSISTENCY */
/* ===================== */

/* Ensure consistent border radius across all interactive elements */
.btn, .qa-btn, .format-btn, .help-action-btn, 
.qa-input-compact, .navbar-input {
  border-radius: var(--radius-md);
}

/* Consistent shadow for elevated elements */
.panel:hover, .modal-content, .formatting-toolbar {
  box-shadow: var(--shadow-lg);
}

/* Optimized dark mode transitions */
body.dark-mode .panel {
  background: linear-gradient(135deg, var(--color-surface), var(--color-surface-alt));
  border-color: var(--color-border);
}

body.dark-mode .formatting-toolbar {
  background: linear-gradient(135deg, var(--color-surface-elevated), var(--color-surface));
  border-color: var(--color-border);
}

/* Tablet responsiveness */
@media (max-width: 1024px) {
  #app {
    padding: var(--space-xs) var(--space-xs);
    min-height: calc(100vh - 100px);
  }
  
  .panel {
    padding: var(--space-lg);
    margin: var(--space-xs);
  }
  
  .editor {
    font-size: 0.95rem;
    padding: var(--space-md);
  }
}

/* Mobile responsiveness - stacked layout */
@media (max-width: 768px) {
  #app {
    flex-direction: column;
    padding: var(--space-xs);
    gap: var(--space-md);
  }
  
  .panel {
    flex: 1 1 auto;
    padding: var(--space-md);
    margin: 0;
    border-radius: var(--radius-md);
  }
  
  #editor-panel,
  #preview-panel {
    flex: none;
    margin: 0;
    width: 100%;
  }
  
  .panel-resizer {
    display: none; /* Hide resizer on mobile */
  }
  
  .editor {
    min-height: 300px;
    font-size: var(--font-size-base);
    padding: var(--space-md);
  }
  
  #preview-pane {
    min-height: 200px;
    padding: var(--space-md);
  }
  
  #preview-header {
    padding: var(--space-sm) var(--space-md);
  }
  
  #preview-header h2 {
    font-size: var(--font-size-lg);
  }
}

/* Small mobile optimizations */
@media (max-width: 480px) {
  #app {
    padding: var(--space-xs) 0;
  }
  
  .panel {
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
  }
  
  .editor {
    min-height: 250px;
    font-size: 0.9rem;
    padding: var(--space-sm);
  }
  
  #preview-pane {
    min-height: 150px;
    padding: var(--space-sm);
  }
}

/* ===================== */
/* NEW PAGE COMPONENTS STYLES */
/* ===================== */

/* Terms & Conditions Page */
.terms-section {
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.terms-section:last-child {
  border-bottom: none;
}

.terms-content {
  max-width: 800px;
  line-height: 1.7;
}

.terms-content ul {
  margin: var(--space-md) 0;
  padding-left: var(--space-xl);
}

.terms-content li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

/* Privacy Policy Page */
.privacy-section {
  margin-bottom: var(--space-2xl);
  padding: var(--space-lg) 0;
}

.privacy-highlights {
  margin-bottom: var(--space-3xl);
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.highlight-item {
  text-align: center;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.highlight-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-interactive);
}

.highlight-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  display: block;
  color: var(--color-interactive);
}

.privacy-content {
  max-width: 900px;
  line-height: 1.7;
}

.privacy-list {
  margin: var(--space-md) 0;
  padding-left: var(--space-xl);
}

.privacy-list li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

.protection-measures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.protection-item {
  padding: var(--space-lg);
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.protection-item h4 {
  margin-bottom: var(--space-sm);
  color: var(--color-interactive);
}

/* About Us Page */
.mission-content {
  max-width: 1000px;
  margin: 0 auto;
}

.mission-points {
  margin-top: var(--space-2xl);
}

.mission-point {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
  padding: var(--space-lg);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-base);
}

.mission-point:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-interactive);
}

.mission-icon {
  font-size: 2.5rem;
  min-width: 60px;
  text-align: center;
}

.mission-text h3 {
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
}

.mission-text p {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.story-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.story-content p {
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.stats-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.stat-item {
  text-align: center;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  display: block;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-interactive);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.features-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.feature-showcase-item {
  text-align: center;
  padding: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.feature-showcase-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-interactive);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  display: block;
  color: var(--color-interactive);
}

.team-content {
  max-width: 800px;
  margin: 0 auto;
}

.creator-profile {
  padding: var(--space-2xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  text-align: center;
}

.creator-info h3 {
  margin-bottom: var(--space-xs);
  color: var(--color-text-primary);
}

.creator-title {
  color: var(--color-interactive);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-lg);
}

.tech-stack {
  max-width: 1000px;
  margin: 0 auto;
}

.tech-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.tech-category {
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}

.tech-category h3 {
  margin-bottom: var(--space-md);
  color: var(--color-interactive);
}

.tech-category ul {
  list-style-type: disc;
  padding-left: var(--space-lg);
}

.tech-category li {
  margin-bottom: var(--space-sm);
  line-height: 1.5;
}

/* Contact Us Page */
.contact-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.contact-option {
  text-align: center;
  padding: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.contact-option:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-interactive);
}

.contact-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  display: block;
  color: var(--color-interactive);
}

.contact-link {
  display: inline-block;
  margin-top: var(--space-md);
  color: var(--color-interactive);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}

.contact-link:hover {
  color: var(--color-interactive-hover);
  text-decoration: underline;
}

.quick-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.help-category {
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}

.help-category h3 {
  margin-bottom: var(--space-md);
  color: var(--color-interactive);
}

.help-links {
  list-style: none;
  padding: 0;
}

.help-link {
  display: block;
  padding: var(--space-sm) 0;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-light);
  transition: color var(--transition-fast);
}

.help-link:hover {
  color: var(--color-interactive);
}

.help-link:last-child {
  border-bottom: none;
}

/* Contact Form */
.contact-form-container {
  max-width: 800px;
  margin: 0 auto;
}

.contact-form-intro {
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.contact-info {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.contact-info-item {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.contact-form {
  background: var(--color-surface);
  padding: var(--space-2xl);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-interactive);
  box-shadow: 0 0 0 3px var(--color-border-focus);
}

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

.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
}

input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--color-interactive);
  border-color: var(--color-interactive);
}

input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.form-actions {
  text-align: center;
  margin-top: var(--space-xl);
}

.form-submit-btn {
  background: var(--color-interactive);
  color: var(--color-text-inverse);
  border: none;
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
}

.form-submit-btn:hover {
  background: var(--color-interactive-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.form-submit-btn:disabled {
  background: var(--color-interactive-disabled);
  cursor: not-allowed;
  transform: none;
}

.form-note {
  margin-top: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* FAQ Section */
.faq-container {
  max-width: 900px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: var(--space-lg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.faq-item:hover {
  border-color: var(--color-interactive);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  padding: var(--space-lg);
  margin: 0;
  background: var(--color-surface);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

.faq-question:hover {
  background: var(--color-surface-alt);
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-xl);
  font-weight: bold;
  color: var(--color-interactive);
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-question::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq-answer {
  padding: 0 var(--space-lg) var(--space-lg);
  background: var(--color-surface-alt);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base), padding var(--transition-base);
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: var(--space-lg);
}

/* Sitemap Page */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.sitemap-category {
  padding: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.sitemap-category:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-interactive);
}

.sitemap-category-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
}

.sitemap-icon {
  font-size: var(--font-size-xl);
  color: var(--color-interactive);
}

.sitemap-links {
  list-style: none;
  padding: 0;
}

.sitemap-link {
  display: block;
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.sitemap-link:hover {
  background: var(--color-interactive);
  color: var(--color-text-inverse);
  transform: translateX(4px);
}

.link-title {
  display: block;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

.link-description {
  display: block;
  font-size: var(--font-size-sm);
  opacity: 0.8;
  line-height: 1.4;
}

.sitemap-link.external::after {
  content: ' ↗';
  font-size: var(--font-size-sm);
  opacity: 0.7;
}

.site-stats {
  max-width: 1000px;
  margin: 0 auto;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.site-features {
  margin-top: var(--space-2xl);
}

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
}

.feature-icon {
  font-size: var(--font-size-lg);
  color: var(--color-interactive);
}

.navigation-tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.tip-category {
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}

.tip-category h3 {
  margin-bottom: var(--space-md);
  color: var(--color-interactive);
}

.tip-list {
  list-style-type: disc;
  padding-left: var(--space-lg);
}

.tip-list li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

.text-link {
  color: var(--color-interactive);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.text-link:hover {
  color: var(--color-interactive-hover);
  text-decoration: underline;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.resource-card {
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

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

.resource-card h3 {
  margin-bottom: var(--space-md);
  color: var(--color-interactive);
}

.resource-links {
  list-style: none;
  padding: 0;
}

.resource-link {
  display: block;
  padding: var(--space-sm) 0;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-light);
  transition: color var(--transition-fast);
}

.resource-link:hover {
  color: var(--color-interactive);
}

.resource-link:last-child {
  border-bottom: none;
}

/* Dark Mode Styles for New Components */
body.dark-mode .terms-section,
body.dark-mode .privacy-section {
  border-bottom-color: var(--color-border);
}

body.dark-mode .highlight-item,
body.dark-mode .protection-item,
body.dark-mode .mission-point,
body.dark-mode .stat-item,
body.dark-mode .feature-showcase-item,
body.dark-mode .creator-profile,
body.dark-mode .tech-category,
body.dark-mode .contact-option,
body.dark-mode .help-category,
body.dark-mode .contact-form,
body.dark-mode .faq-item,
body.dark-mode .sitemap-category,
body.dark-mode .resource-card,
body.dark-mode .tip-category {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
}

body.dark-mode .faq-question {
  background: var(--color-surface-elevated);
}

body.dark-mode .faq-question:hover {
  background: var(--color-surface);
}

body.dark-mode .faq-answer {
  background: var(--color-surface);
}

body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

body.dark-mode .checkbox-custom {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
}

body.dark-mode .contact-info-item,
body.dark-mode .feature-item {
  background: var(--color-surface);
}

body.dark-mode .sitemap-link {
  background: var(--color-surface);
}

body.dark-mode .sitemap-link:hover {
  background: var(--color-interactive);
  color: var(--color-text-inverse);
}

/* Responsive Design for New Components */
@media (max-width: 768px) {
  .highlight-grid,
  .protection-measures,
  .mission-points,
  .stats-showcase,
  .features-showcase,
  .tech-categories,
  .contact-options,
  .quick-help-grid,
  .sitemap-grid,
  .resources-grid,
  .navigation-tips,
  .features-list {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .mission-point {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }
  
  .contact-info {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .contact-form {
    padding: var(--space-lg);
  }
  
  .site-stats .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .terms-section,
  .privacy-section {
    padding: var(--space-md) 0;
  }
  
  .highlight-item,
  .protection-item,
  .mission-point,
  .stat-item,
  .feature-showcase-item,
  .contact-option,
  .help-category,
  .sitemap-category,
  .resource-card,
  .tip-category {
    padding: var(--space-md);
  }
  
  .contact-form {
    padding: var(--space-md);
  }
  
  .form-submit-btn {
    width: 100%;
    padding: var(--space-md);
  }
  
  .site-stats .stat-grid {
    grid-template-columns: 1fr;
  }
}
