/**
 * SEO TOOLS PLATFORM - PREMIUM CSS v3.0
 * Modern, responsive, and feature-rich styling with fixed sidebar
 */

/* ============================================
   CSS VARIABLES - DESIGN TOKENS
   ============================================ */
:root {
/* Primary Colors - Based on #274c77 */
--primary-50: #edf2f7;
--primary-100: #d6e1ec;
--primary-200: #b7cadd;
--primary-300: #94b0cc;
--primary-400: #6f93b8;
--primary-500: #4a769f;
--primary-600: #274c77;
--primary-700: #1f3e61;
--primary-800: #182f4a;
--primary-900: #112033;

/* Secondary Colors - Based on #6096ba */
--secondary-50: #f2f7fb;
--secondary-100: #e0edf6;
--secondary-200: #c6dff0;
--secondary-300: #a7cde7;
--secondary-400: #86b8db;
--secondary-500: #6ea7cf;
--secondary-600: #6096ba;
--secondary-700: #4f7d9c;
--secondary-800: #3e637c;
--secondary-900: #2c495c;

/* Accent Colors - Based on #a3cef1 */
--accent-50: #f4f9fe;
--accent-100: #e3f1fc;
--accent-200: #cde6f9;
--accent-300: #b5daf5;
--accent-400: #a3cef1;
--accent-500: #82b8e3;
--accent-600: #659ed0;
--accent-700: #4b82b0;
--accent-800: #37668d;
--accent-900: #254967;

/* Semantic Colors (kept standard but matching tone) */
--success-50: #ecfdf5;
--success-100: #d1fae5;
--success-500: #10b981;
--success-600: #059669;
--success-700: #047857;

--warning-50: #fffbeb;
--warning-100: #fef3c7;
--warning-500: #f59e0b;
--warning-600: #d97706;
--warning-700: #b45309;

--error-50: #fef2f2;
--error-100: #fee2e2;
--error-500: #ef4444;
--error-600: #dc2626;
--error-700: #b91c1c;

--info-50: #eff6ff;
--info-100: #dbeafe;
--info-500: #3b82f6;
--info-600: #2563eb;
--info-700: #1d4ed8;
  /* Neutral Colors - Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-hover: #e2e8f0;
  --bg-card: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-placeholder: #94a3b8;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-strong: #94a3b8;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
  --shadow-glow-lg: 0 0 60px rgba(99, 102, 241, 0.25);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Layout */
  --header-height: 70px;
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 70px;
  --max-width: 1400px;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  transition: background var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

/* Selection */
::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

[data-theme="dark"] ::selection {
  background: var(--primary-700);
  color: var(--primary-100);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

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

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

[data-theme="dark"] a {
  color: var(--primary-400);
}

[data-theme="dark"] a:hover {
  color: var(--primary-300);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-tertiary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  color: var(--accent-rose);
}

pre {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-size: var(--text-sm);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Main Wrapper */
.main-wrapper {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  position: relative;
  width: 100%;
}

/* ============================================
   SIDEBAR - ULTIMATE EDITION
   The most advanced, feature-rich sidebar
   ============================================ */

/* Sidebar Container */
.sidebar {
  width: var(--sidebar-width, 280px);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  position: sticky;
  top: var(--header-height, 70px);
  left: 0;
  height: calc(100vh - var(--header-height, 70px));
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) var(--bg-tertiary);
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 10px;
  transition: background 0.2s;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-500);
}

/* Collapsed State */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width, 10px);
}

.sidebar.collapsed .sidebar-content {
  padding: var(--space-4) var(--space-2);
}

.sidebar.collapsed .sidebar-title {
  text-align: center;
  padding-left: 0;
  font-size: 0;
}

.sidebar.collapsed .sidebar-title::first-letter {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  padding: var(--space-3);
}

.sidebar.collapsed .sidebar-nav a svg {
  margin-right: 0;
  width: 22px;
  height: 22px;
}

.sidebar.collapsed .sidebar-nav a span {
  display: none;
}

.sidebar.collapsed .sidebar-section {
  margin-bottom: var(--space-4);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  position: absolute;
  top: var(--space-4);
  right: 5px;
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
}

.sidebar-toggle:hover {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
  transform: scale(1.1) rotate(0deg);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.sidebar.collapsed .sidebar-toggle {
  transform: rotate(180deg);
  right: 5px;
}

.sidebar-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

/* Sidebar Content */
.sidebar-content {
  padding: var(--space-6);
  transition: opacity 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed .sidebar-content {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar Sections */
.sidebar-section {
  margin-bottom: var(--space-8);
  animation: slideInRight 0.5s ease forwards;
  opacity: 0;
  animation-fill-mode: forwards;
}

.sidebar-section:nth-child(1) { animation-delay: 0.1s; }
.sidebar-section:nth-child(2) { animation-delay: 0.15s; }
.sidebar-section:nth-child(3) { animation-delay: 0.2s; }
.sidebar-section:nth-child(4) { animation-delay: 0.25s; }
.sidebar-section:nth-child(5) { animation-delay: 0.3s; }
.sidebar-section:nth-child(6) { animation-delay: 0.35s; }

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

/* Section Titles */
.sidebar-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  padding-left: var(--space-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  transition: all 0.3s ease;
}

.sidebar-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: linear-gradient(to bottom, var(--primary-500), var(--secondary-500));
  border-radius: var(--radius-full);
  transition: height 0.3s ease;
}

.sidebar-title:hover::before {
  height: 20px;
}

/* Navigation List */
.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li {
  margin-bottom: var(--space-1);
  position: relative;
}

/* Navigation Links */
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 1;
}

.sidebar-nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--primary-100), var(--secondary-100));
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

[data-theme="dark"] .sidebar-nav a::before {
  background: linear-gradient(135deg, var(--primary-900), var(--secondary-900));
}

.sidebar-nav a:hover {
  color: var(--text-primary);
  transform: translateX(4px);
}

.sidebar-nav a:hover::before {
  opacity: 1;
}

.sidebar-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sidebar-nav a:hover svg {
  transform: scale(1.1);
  color: var(--primary-500);
}

/* Active Link */
.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  color: white;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  transform: scale(1.02);
}

.sidebar-nav a.active::before {
  opacity: 0;
}

.sidebar-nav a.active svg {
  color: white;
  transform: scale(1.1);
}

.sidebar-nav a.active:hover {
  transform: translateX(4px) scale(1.02);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Link with Badge */
.sidebar-nav a .badge {
  margin-left: auto;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: var(--text-xs);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.sidebar-nav a:hover .badge {
  background: var(--primary-200);
  color: var(--primary-700);
}

.sidebar-nav a.active .badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Mobile Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  z-index: 1002;
  box-shadow: var(--shadow-lg);
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

.mobile-menu-toggle:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: var(--shadow-xl);
}

.mobile-menu-toggle svg {
  width: 28px;
  height: 28px;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
}

.sidebar-footer-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-footer-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-footer-item svg {
  width: 18px;
  height: 18px;
}

/* Tooltip for Collapsed Mode */
.sidebar.collapsed .sidebar-nav a {
  position: relative;
}

.sidebar.collapsed .sidebar-nav a:hover::after {
  content: attr(data-title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  z-index: 1002;
  animation: fadeIn 0.2s ease;
}

/* Divider */
.sidebar-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-4) 0;
  position: relative;
}

.sidebar-divider::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  background: var(--primary-500);
  border-radius: 50%;
}

/* Progress Indicator */
.sidebar-progress {
  margin: var(--space-4) 0;
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
}

.sidebar-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.sidebar-progress-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s ease;
}

/* Search Inside Sidebar (Optional) */
.sidebar-search {
  position: relative;
  margin-bottom: var(--space-4);
}

.sidebar-search input {
  width: 100%;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-8);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all 0.2s ease;
}

.sidebar-search input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.sidebar-search svg {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    z-index: 1001;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

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

  .sidebar.collapsed {
    width: var(--sidebar-width, 280px);
  }

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

  .sidebar.collapsed .sidebar-content {
    opacity: 1;
  }

  .sidebar.collapsed .sidebar-title {
    font-size: var(--text-xs);
    padding-left: var(--space-3);
  }

  .sidebar.collapsed .sidebar-nav a {
    justify-content: flex-start;
    padding: var(--space-3) var(--space-4);
  }

  .sidebar.collapsed .sidebar-nav a svg {
    margin-right: var(--space-3);
  }

  .sidebar.collapsed .sidebar-nav a span {
    display: inline;
  }

  .sidebar-toggle {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

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

/* Small Mobile */
@media (max-width: 480px) {
  .sidebar {
    width: 85%;
  }

  .mobile-menu-toggle {
    width: 50px;
    height: 50px;
    bottom: var(--space-4);
    right: var(--space-4);
  }

  .mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
  }
}

/* Landscape Mode */
@media (max-height: 600px) and (orientation: landscape) {
  .sidebar {
    padding-bottom: var(--space-4);
  }

  .sidebar-section {
    margin-bottom: var(--space-4);
  }

  .mobile-menu-toggle {
    bottom: var(--space-2);
    right: var(--space-2);
  }
}

/* Print Styles */
@media print {
  .sidebar,
  .mobile-menu-toggle,
  .sidebar-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }
}

/* Loading Skeleton Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.sidebar-loading .sidebar-nav a {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
  color: transparent;
  pointer-events: none;
}

/* Active Category Indicator */
.sidebar-nav a.active-category {
  border-left: 3px solid var(--primary-500);
  background: linear-gradient(90deg, var(--primary-50), transparent);
}

[data-theme="dark"] .sidebar-nav a.active-category {
  background: linear-gradient(90deg, var(--primary-900), transparent);
}

/* Group Headers */
.sidebar-group-header {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Nested Navigation */
.sidebar-nav-nested {
  padding-left: var(--space-6);
  list-style: none;
  margin-top: var(--space-1);
  margin-bottom: var(--space-1);
}

.sidebar-nav-nested a {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.sidebar-nav-nested a::before {
  content: '↳';
  margin-right: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* Hover Effects */
.sidebar-nav a::after {
  content: '';
  position: absolute;
  right: var(--space-3);
  width: 0;
  height: 2px;
  background: var(--primary-500);
  transition: width 0.2s ease;
  bottom: 50%;
  transform: translateY(50%);
}

.sidebar-nav a:hover::after {
  width: 4px;
}

/* Active Link Ripple Effect */
.sidebar-nav a.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.5s ease-out;
  border-radius: inherit;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* Bottom Gradient */
.sidebar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, var(--bg-secondary), transparent);
  pointer-events: none;
  opacity: 0.8;
}

/* Focus Visible for Accessibility */
.sidebar-nav a:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Custom Properties for Easy Customization */
:root {
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;
  --sidebar-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-hover-scale: 1.02;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: var(--space-8);
  min-width: 0;
  transition: all var(--transition-base);
  background: var(--bg-primary);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border: none;
  border-radius: var(--radius-full);
  color: white;
  cursor: pointer;
  z-index: 98;
  box-shadow: var(--shadow-lg);
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding: var(--space-20) 0;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  margin-bottom: var(--space-12);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--primary-200) 0%, transparent 70%);
  opacity: 0.3;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.hero-title {
  font-size: var(--text-5xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-600), var(--secondary-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-6);
  line-height: 1.1;
}

.hero-description {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto var(--space-10);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-12);
  margin-top: var(--space-12);
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: var(--text-4xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ============================================
   TOOL CARDS
   ============================================ */
.category-section {
  margin-bottom: var(--space-16);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.category-title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-2xl);
  font-weight: 700;
}

.category-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.category-description {
  color: var(--text-secondary);
  max-width: 600px;
  margin-top: var(--space-2);
}

.category-count {
  padding: var(--space-2) var(--space-4);
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  display: block;
  color: inherit;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.tool-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  flex-shrink: 0;
}

.tool-card-icon.blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.tool-card-icon.purple {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.tool-card-icon.green {
  background: linear-gradient(135deg, #10b981, #059669);
}

.tool-card-icon.orange {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.tool-card-icon.red {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tool-card-icon.cyan {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.tool-card-icon.pink {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.tool-card-icon.indigo {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.tool-card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.tool-card-category {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tool-card-description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.tool-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tool-card-feature {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.tool-card-feature svg {
  width: 12px;
  height: 12px;
  color: var(--success-500);
}

/* ============================================
   TOOL PAGE STYLES
   ============================================ */
.tool-page {
  max-width: 1200px;
  margin: 0 auto;
}

.tool-header {
  text-align: center;
  margin-bottom: var(--space-10);
  padding: var(--space-8) 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-2xl);
}

.tool-header-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
  background: linear-gradient(135deg, var(--primary-600), var(--secondary-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tool-header-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.tool-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-8);
}

.tool-main {
  min-width: 0;
}

.tool-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-8));
  height: fit-content;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.card-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-label span {
  font-weight: 400;
  color: var(--text-muted);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

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

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-placeholder);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--error-600);
  margin-top: var(--space-2);
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-sm);
  cursor: pointer;
  accent-color: var(--primary-500);
}

.form-check-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Input Groups */
.input-group {
  display: flex;
  gap: var(--space-2);
}

.input-group .form-input {
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--error-500), var(--error-600));
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

.btn-icon {
  padding: var(--space-2);
  width: 40px;
  height: 40px;
}

/* Button Groups */
.btn-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Output Wrapper */
.output-wrapper {
  position: relative;
}

.output-wrapper pre {
  margin: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.copy-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-4);
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  text-align: center;
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--primary-600);
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-bar-fill.good {
  background: linear-gradient(90deg, var(--success-500), var(--success-600));
}

.progress-bar-fill.warning {
  background: linear-gradient(90deg, var(--warning-500), var(--warning-600));
}

.progress-bar-fill.danger {
  background: linear-gradient(90deg, var(--error-500), var(--error-600));
}

/* Score Display */
.score-display {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  font-size: var(--text-2xl);
  font-weight: 800;
  position: relative;
}

.score-display.good {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  color: white;
}

.score-display.warning {
  background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
  color: white;
}

.score-display.danger {
  background: linear-gradient(135deg, var(--error-500), var(--error-600));
  color: white;
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.tab {
  padding: var(--space-3) var(--space-5);
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-500);
}

/* Tab Content */
.tab-content {
  display: none;
}

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

/* Alert/Info Boxes */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alert-info {
  background: var(--info-50);
  border: 1px solid var(--info-100);
  color: var(--info-700);
}

.alert-success {
  background: var(--success-50);
  border: 1px solid var(--success-100);
  color: var(--success-700);
}

.alert-warning {
  background: var(--warning-50);
  border: 1px solid var(--warning-100);
  color: var(--warning-700);
}

.alert-error {
  background: var(--error-50);
  border: 1px solid var(--error-100);
  color: var(--error-700);
}

/* Info Panel */
.info-panel {
  background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.info-panel-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--primary-700);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.info-panel-list {
  list-style: none;
}

.info-panel-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.info-panel-list li svg {
  width: 18px;
  height: 18px;
  color: var(--success-500);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Tips List */
.tips-list {
  list-style: none;
}

.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.tip-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tip-icon.success {
  background: var(--success-100);
  color: var(--success-600);
}

.tip-icon.warning {
  background: var(--warning-100);
  color: var(--warning-600);
}

.tip-icon.info {
  background: var(--info-100);
  color: var(--info-600);
}

/* Instructions */
.instructions {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.instructions-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.instructions-list {
  list-style: none;
  counter-reset: step;
}

.instructions-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.instructions-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.step-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

/* FAQ Section */
.faq-section {
  margin-top: var(--space-12);
}

.faq-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.faq-question svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 var(--space-6) var(--space-6);
  color: var(--text-secondary);
  display: none;
}

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

/* Related Tools */
.related-tools {
  margin-top: var(--space-8);
}

.related-tools-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.related-tool-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
  color: inherit;
}

.related-tool-card:hover {
  background: var(--bg-hover);
  border-color: var(--primary-300);
  transform: translateY(-2px);
}

/* Optional: Add hover effect to reveal full text */
.tool-name:hover {
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  background: var(--bg-secondary);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  z-index: 10;
  position: relative;
}

.related-tool-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.related-tool-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.related-tool-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Tool Card Panel (Sidebar) */
.tool-card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.tool-card-panel-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Preview Box */
.preview-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-top: var(--space-4);
}

/* Character Counter */
.char-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.char-count {
  font-weight: 600;
}

.char-count.good { color: var(--success-600); }
.char-count.warning { color: var(--warning-600); }
.char-count.danger { color: var(--error-600); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge-success {
  background: var(--success-100);
  color: var(--success-700);
}

.badge-warning {
  background: var(--warning-100);
  color: var(--warning-700);
}

.badge-error {
  background: var(--error-100);
  color: var(--error-700);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-6) 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-12);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  color: var(--text-muted);
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.empty-state-description {
  color: var(--text-muted);
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary-500);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: slideIn 0.3s ease-out;
  min-width: 300px;
}

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

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

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

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

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.flex-wrap { flex-wrap: wrap; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
  .tool-content {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    z-index: 1000;
  }

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

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

  .mobile-menu-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-6);
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .sidebar-toggle {
    display: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }

  .hero {
    padding: var(--space-12) 0;
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-description {
    font-size: var(--text-lg);
  }

  .main-content {
    padding: var(--space-4);
  }

  .card {
    padding: var(--space-4);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-group {
    flex-direction: column;
    grid-template-columns: repeat(2, 1fr);
  }

  .btn {
    width: 100%;
  }

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

  .related-tools-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: var(--text-2xl);
  }

  .tool-header-title {
    font-size: var(--text-2xl);
  }

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

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
  }

  .toast {
    min-width: auto;
  }

  .mobile-menu-toggle {
    bottom: var(--space-4);
    right: var(--space-4);
    width: 48px;
    height: 48px;
  }
}

/* Print Styles */
@media print {
  .sidebar,
  .sidebar-overlay,
  .mobile-menu-toggle,
  .sidebar-toggle,
  .toast-container,
  .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .tool-page {
    max-width: 100%;
  }

  .card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
}
/* ============================================
   SIDEBAR HEADER & THEME TOGGLE
   ============================================ */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-4);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-brand {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-header {
  padding: var(--space-4) var(--space-3);
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-footer, 
.sidebar.collapsed .sidebar-content,
.sidebar.collapsed .sidebar-logo {
  display: none;
}

/* Theme Toggle Button in Sidebar */
.theme-toggle {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: all var(--transition-base);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  position: absolute;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Light mode - show sun, hide moon */
.theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

/* Dark mode - show moon, hide sun */
.theme-toggle.dark-mode .sun-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

.theme-toggle.dark-mode .moon-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Pulse animation for first-time visitors */
.theme-toggle:not(:hover) {
  animation: subtle-pulse 3s ease-in-out infinite;
}

@keyframes subtle-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  }
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.sidebar-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-version {
  background: var(--bg-tertiary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 992px) {
  .sidebar-header {
    padding: var(--space-4);
  }
  
  .theme-toggle {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .sidebar-header {
    padding: var(--space-3);
  }
}

/* ============================================
   CONTENT SECTIONS & TYPOGRAPHY
   ============================================ */
.content-section {
  margin: var(--space-12) 0;
  padding: var(--space-8) var(--space-6);
  background: var(--bg-primary);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.content-section h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
  position: relative;
  padding-bottom: var(--space-3);
}

.content-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
  border-radius: var(--radius-full);
}

.content-section h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: var(--space-6) 0 var(--space-4) 0;
  color: var(--text-primary);
}

.content-section h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: var(--space-4) 0 var(--space-3) 0;
  color: var(--text-primary);
}

.content-section p {
  margin-bottom: var(--space-4);
  line-height: 1.7;
  color: var(--text-secondary);
}

.content-section ul,
.content-section ol {
  margin: var(--space-4) 0 var(--space-6) var(--space-5);
  padding-left: var(--space-4);
}

.content-section li {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  line-height: 1.6;
}

.content-section li strong {
  color: var(--text-primary);
}

.content-section pre {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow-x: auto;
}

.content-section code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: var(--space-1) var(--space-2);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--primary-600);
}

.content-section pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* ============================================
   ENHANCED LIST STYLES
   ============================================ */
ul:not(.sidebar-nav):not(.nav-menu):not(.info-panel-list):not(.instructions-list):not(.tips-list) {
  list-style-type: disc;
  padding-left: var(--space-6);
}

ol:not(.sidebar-nav):not(.nav-menu):not(.info-panel-list):not(.instructions-list):not(.tips-list) {
  list-style-type: decimal;
  padding-left: var(--space-6);
}

ul ul,
ol ul {
  list-style-type: circle;
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

ol ol,
ul ol {
  list-style-type: lower-alpha;
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

li {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}

li > ul,
li > ol {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Check list / Task list */
ul.task-list {
  list-style: none;
  padding-left: 0;
}

.task-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
}

.task-list-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-500);
}

/* ============================================
   HEADING STYLES
   ============================================ */
h1, .h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

h2, .h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.3;
  margin: var(--space-8) 0 var(--space-4) 0;
  color: var(--text-primary);
}

h3, .h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.4;
  margin: var(--space-6) 0 var(--space-3) 0;
  color: var(--text-primary);
}

h4, .h4 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.5;
  margin: var(--space-4) 0 var(--space-2) 0;
  color: var(--text-primary);
}

h5, .h5 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.6;
  margin: var(--space-3) 0 var(--space-2) 0;
  color: var(--text-primary);
}

h6, .h6 {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.6;
  margin: var(--space-2) 0 var(--space-1) 0;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   INFO CARDS & PANELS
   ============================================ */
.info-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

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

.info-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.info-card h3 svg {
  width: 20px;
  height: 20px;
  color: var(--primary-500);
}

.info-card ul,
.info-card ol {
  margin: 0;
  padding-left: var(--space-5);
}

.info-card li {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}

.info-card li:last-child {
  margin-bottom: 0;
}

.info-panel {
  background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}

[data-theme="dark"] .info-panel {
  background: linear-gradient(135deg, var(--primary-900), var(--secondary-900));
  border-color: var(--primary-700);
}

.info-panel-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--primary-700);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

[data-theme="dark"] .info-panel-title {
  color: var(--primary-300);
}

.info-panel-list {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
}

.info-panel-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.info-panel-list li svg {
  width: 18px;
  height: 18px;
  color: var(--success-500);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================
   INSTRUCTION & TIPS LISTS
   ============================================ */
.instructions-list {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
  counter-reset: instruction-step;
}

.instructions-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
  counter-increment: instruction-step;
}

.instructions-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.instructions-list li::before {
  content: counter(instruction-step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  color: white;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

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

.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.tip-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 600;
}

.tip-icon.success {
  background: var(--success-100);
  color: var(--success-600);
}

.tip-icon.warning {
  background: var(--warning-100);
  color: var(--warning-600);
}

.tip-icon.info {
  background: var(--info-100);
  color: var(--info-600);
}

.tip-icon.primary {
  background: var(--primary-100);
  color: var(--primary-600);
}

/* ============================================
   FAQ ACCORDION
   ============================================ */
.faq-section {
  margin: var(--space-12) 0;
}

.faq-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

.faq-list {
  border-top: 1px solid var(--border-light);
}

.faq-item {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-primary);
  transition: all var(--transition-fast);
}

.faq-item:hover {
  background: var(--bg-secondary);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.faq-question:hover {
  color: var(--primary-500);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-question svg {
  transform: rotate(180deg);
  color: var(--primary-500);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 var(--space-6);
  transition: max-height var(--transition-slow), padding var(--transition-slow);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 var(--space-6) var(--space-6) var(--space-6);
}

.faq-answer p {
  margin-bottom: var(--space-3);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
  margin: var(--space-3) 0 var(--space-3) var(--space-5);
}

/* ============================================
   CODE BLOCKS & PRE
   ============================================ */
pre {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: var(--space-1) var(--space-2);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--primary-600);
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* ============================================
   QUOTES & BLOCKQUOTES
   ============================================ */
blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary-500);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  color: var(--text-secondary);
  font-style: italic;
}

blockquote p {
  margin-bottom: var(--space-2);
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote cite {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: normal;
}

/* ============================================
   TABLES
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
}

th {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--border-medium);
}

td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

tr:hover td {
  background: var(--bg-hover);
}

/* ============================================
   AD CONTAINERS
   ============================================ */
.ad-container {
  align-items: center;
}

.ad-sidebar {
  margin-bottom: var(--space-6);
}

/* ============================================
   RELATED TOOLS CARDS
   ============================================ */
.related-tools {
  margin-top: var(--space-8);
}

.related-tools-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-primary);
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}

.related-tool-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
  color: inherit;
  text-decoration: none;
}

.related-tool-card:hover {
  background: var(--bg-hover);
  border-color: var(--primary-300);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.related-tool-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  flex-shrink: 0;
  color: white;
}

.related-tool-info {
  flex: 1;
  min-width: 0;
}

.related-tool-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-tool-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-muted {
  color: var(--text-muted);
}

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

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

.text-success {
  color: var(--success-600);
}

.text-warning {
  color: var(--warning-600);
}

.text-error {
  color: var(--error-600);
}

.text-info {
  color: var(--info-600);
}

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

.rounded {
  border-radius: var(--radius-lg);
}

.rounded-full {
  border-radius: var(--radius-full);
}

.shadow {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
  .content-section {
    padding: var(--space-4);
  }
  
  .content-section h2 {
    font-size: var(--text-xl);
  }
  
  .content-section h3 {
    font-size: var(--text-lg);
  }
  
  h1 {
    font-size: var(--text-3xl);
  }
  
  h2 {
    font-size: var(--text-2xl);
  }
  
  h3 {
    font-size: var(--text-xl);
  }
  
  .related-tools-grid {
    grid-template-columns: 1fr;
  }
  
  .faq-question {
    padding: var(--space-3) var(--space-4);
  }
  
  .faq-answer {
    padding: 0 var(--space-4);
  }
  
  .faq-item.active .faq-answer {
    padding: 0 var(--space-4) var(--space-4) var(--space-4);
  }
}

@media (max-width: 480px) {
  .instructions-list li::before {
    width: 24px;
    height: 24px;
    font-size: var(--text-xs);
  }
  
  .related-tool-card {
    padding: var(--space-3);
  }
  
  .related-tool-icon {
    width: 40px;
    height: 40px;
    font-size: var(--text-lg);
  }
}

/* Mobile Responsive - Sidebar after main content */
@media (max-width: 768px) {
  .tool-content {
    display: flex;
    flex-direction: column;
  }
  
  .tool-main {
    order: 1;
  }
  
  .tool-sidebar {
    order: 2;
    margin-top: var(--space-6);
  }
}

/* Responsive Tables for Mobile */
@media (max-width: 768px) {
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  
  .keyword-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  
  .keyword-table th,
  .keyword-table td {
    white-space: nowrap;
    min-width: 120px;
  }
  
  .keyword-bar {
    width: 80px; /* Smaller on mobile */
  }
}

/* Alternative card view for very small screens if needed */
@media (max-width: 480px) {
  .keyword-table th,
  .keyword-table td {
    min-width: 100px;
    padding: var(--space-2);
    font-size: 13px;
  }
  
  .keyword-bar {
    width: 60px; /* Even smaller for tiny screens */
  }
}

/* Quick Stats - Mobile Responsive */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  
  .stat-card {
    padding: var(--space-3);
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
  }
  
  .stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--primary-500);
    margin-bottom: var(--space-1);
  }
  
  .stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
  }
}