/* ========================================
   SEOToolsK - Main Stylesheet
   Modern Multi-Tool Website
   ======================================== */

/* CSS Custom Properties */
:root {
  /* Colors - Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  /* Brand Colors */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --gradient-card: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e3a5f 100%);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  
  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  
  /* Layout */
  --container-max: 1280px;
  --sidebar-width: 280px;
  --header-height: 70px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --border-hover: #475569;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

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

img {
  max-width: 100%;
  height: auto;
}

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

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

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

/* ========================================
   Layout
   ======================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* ========================================
   Header & Navigation
   ======================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header Search */
.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
  outline: none;
}

.header-search input:focus {
  border-color: var(--primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.header-search .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.search-dropdown.active { display: block; }

.search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.search-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.search-item-info .name { font-size: 0.875rem; font-weight: 600; }
.search-item-info .category { font-size: 0.75rem; color: var(--text-muted); }

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

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

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  background: var(--gradient-hero);
  padding: 7rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 0.35rem 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.hero h1 {
  color: white;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero h1 span {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: rgba(255,255,255,0.75);
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Hero Search */
.hero-search {
  max-width: 560px;
  margin: 0 auto 2.5rem;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3rem;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.95);
  color: #1e293b;
  font-size: 1rem;
  outline: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.hero-search input:focus {
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 3px rgba(99, 102, 241, 0.4);
}

.hero-search .search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

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

.hero-stat .number {
  font-size: 1.75rem;
  font-weight: 800;
  display: block;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat .label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========================================
   Ad Banners
   ======================================== */
.ad-banner {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  overflow: hidden;
}

.ad-banner-header {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0;
}

.ad-banner-sidebar {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-banner-content {
  min-height: 90px;
  max-width: 728px;
  margin: 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* ========================================
   Main Content Layout
   ======================================== */
.main-content {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.page-wrapper {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-wrapper.no-sidebar {
  grid-template-columns: 1fr;
  max-width: 900px;
}

.content-area { min-width: 0; }

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  height: fit-content;
}

/* ========================================
   Category Section
   ======================================== */
.section {
  padding: 3rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  position: relative;
  padding-left: 1rem;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.section-link {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Category Filter Tabs */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
}

.cat-tab {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

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

.cat-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* ========================================
   Tool Cards
   ======================================== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

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

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

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

.tool-card:hover::before { transform: scaleX(1); }

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.tool-card-body { flex: 1; }

.tool-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.tool-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.tool-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Category Color Themes */
.cat-image { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.cat-design { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.cat-dev { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.cat-layout { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.cat-seo { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }
.cat-text { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.cat-calc { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.cat-security { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.cat-misc { background: rgba(251, 146, 60, 0.1); color: #fb923c; }

/* Category Cards on Home */
.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.category-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  color: inherit;
}

.category-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.category-card-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.category-card-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   Tool Page Styles
   ======================================== */
.tool-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 0;
}

.tool-header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.tool-header-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.tool-header-info h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.25rem;
}

.tool-header-info p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--text-muted); }

/* Tool UI Box */
.tool-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.tool-box-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

/* Range Input */
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Color Input */
input[type="color"] {
  width: 48px;
  height: 36px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-secondary);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

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

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

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

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ========================================
   Output / Result Box
   ======================================== */
.result-box {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  margin-top: 1rem;
}

.result-box pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-primary);
  max-height: 400px;
  overflow-y: auto;
}

.result-box .copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* ========================================
   Tabs
   ======================================== */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.6rem 1.25rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

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

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

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

/* ========================================
   Alerts & Messages
   ======================================== */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid transparent;
}

.alert-info {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.2);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.2);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.2);
}

/* ========================================
   Stats Row
   ======================================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========================================
   SEO Content Area
   ======================================== */
.seo-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-top: 2rem;
}

.seo-content h2 {
  font-size: 1.35rem;
  margin: 1.5rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.seo-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.seo-content h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--primary);
}

.seo-content p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.seo-content ul, .seo-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.seo-content li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  line-height: 1.6;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

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

.footer-brand .logo { margin-bottom: 1rem; }

.footer-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 280px;
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

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

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================
   Sidebar Widgets
   ======================================== */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.widget-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.related-tool-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

.related-tool-item:last-child { border-bottom: none; }

.related-tool-item:hover .related-tool-name {
  color: var(--primary);
}

.related-tool-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.related-tool-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

/* ========================================
   Canvas / Image Tools
   ======================================== */
.canvas-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  overflow: hidden;
}

.canvas-wrapper canvas {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-secondary);
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.upload-area .upload-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.upload-area h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.upload-area p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ========================================
   Color Picker / Preview
   ======================================== */
.color-preview {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.color-swatch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.color-swatch {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s ease;
  border: 2px solid transparent;
}

.color-swatch:hover { transform: scale(1.1); }

/* ========================================
   Wheel / Spinner
   ======================================== */
.wheel-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
}

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

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

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

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

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

.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.animate-fadeIn { animation: fadeIn 0.4s ease forwards; }

.tool-card, .category-card { animation: fadeInUp 0.5s ease forwards; }

/* Stagger animation */
.tools-grid .tool-card:nth-child(1) { animation-delay: 0.05s; }
.tools-grid .tool-card:nth-child(2) { animation-delay: 0.1s; }
.tools-grid .tool-card:nth-child(3) { animation-delay: 0.15s; }
.tools-grid .tool-card:nth-child(4) { animation-delay: 0.2s; }
.tools-grid .tool-card:nth-child(5) { animation-delay: 0.25s; }
.tools-grid .tool-card:nth-child(6) { animation-delay: 0.3s; }

/* ========================================
   Loading Spinner
   ======================================== */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  animation: slideInRight 0.3s ease;
  min-width: 280px;
  max-width: 360px;
}

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

/* ========================================
   Scroll to Top
   ======================================== */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 42px;
  height: 42px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
}

.scroll-top:hover { transform: translateY(-2px); }

/* ========================================
   Mobile Sidebar Overlay
   ======================================== */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-new { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-popular { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-updated { background: rgba(99, 102, 241, 0.15); color: #6366f1; }

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 1.5rem 0;
}

.code-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  color: var(--text-primary);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
  .page-wrapper {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root { --header-height: 60px; }

  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  
  .header-search { max-width: none; }
  
  .hero { padding: 5rem 0 3rem; }
  
  .hero-stats { gap: 1.5rem; }
  
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.875rem;
  }
  
  .tool-card { padding: 1.25rem; }
  
  .category-cards {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  
  .page-wrapper { padding: 1.25rem 1rem; }
  
  .tool-box { padding: 1.25rem; }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .toast-container { left: 1rem; right: 1rem; }
  .toast { min-width: auto; }
}

@media (max-width: 480px) {
  .logo-text { display: none; }
  
  .hero h1 { font-size: 1.75rem; }
  
  .tools-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .form-row { grid-template-columns: 1fr; }
}

/* Mobile Nav Drawer */
.mobile-nav {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  z-index: 999;
  padding: 1.5rem;
  overflow-y: auto;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav.open { left: 0; }

.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.mobile-nav a:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.mobile-nav .nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

/* ========================================
   Tool Page Layout
   ======================================== */
.tool-hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 0;
}

.tool-hero-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.tool-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.tool-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
  color: var(--text-primary);
}

.tool-hero-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  max-width: 600px;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge-category {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

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

.tool-sidebar {
  position: sticky;
  top: 5rem;
}

.tool-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

/* Ad banner */
.ad-banner {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  text-align: center;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
  .tool-sidebar {
    position: static;
  }
}

@media (max-width: 600px) {
  .tool-hero-content {
    flex-direction: column;
    text-align: center;
  }
  .tool-meta {
    justify-content: center;
  }
  .tool-hero-title {
    font-size: 1.3rem;
  }
}

/* ========================================
   SEO Content Section — Homepage
   ======================================== */
.seo-content-section {
  padding: 4rem 0;
}

.seo-content-intro {
  max-width: 860px;
  margin: 0 auto 3rem;
  text-align: center;
}

.seo-h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.seo-lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.9rem;
}

.seo-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 0.9rem;
}

.seo-body a, .seo-lead a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.seo-body a:hover, .seo-lead a:hover {
  color: var(--primary-dark);
}

/* Category deep-dive cards */
.seo-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.seo-cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: var(--transition);
}

.seo-cat-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(99,102,241,0.1);
  transform: translateY(-2px);
}

.seo-cat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.seo-cat-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.seo-cat-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0;
}

.seo-cat-body a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.seo-cat-body a:hover {
  text-decoration: underline;
}

/* FAQ accordion */
.seo-faq-wrap {
  max-width: 900px;
  margin: 0 auto 3rem;
}

.seo-faq-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.seo-faq {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.seo-faq[open] {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(99,102,241,0.08);
}

.seo-faq summary {
  padding: 1.1rem 1.5rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  user-select: none;
}

.seo-faq summary::-webkit-details-marker { display: none; }

.seo-faq summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--primary);
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.2s;
}

.seo-faq[open] summary::after {
  transform: rotate(45deg);
}

.seo-faq summary h3 {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

.seo-faq > p {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.seo-faq a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Closing authority block */
.seo-closing-block {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
}

.seo-closing-block .seo-h2 { font-size: 1.45rem; }

/* Responsive */
@media (max-width: 768px) {
  .seo-h2 { font-size: 1.3rem; }
  .seo-categories-grid { grid-template-columns: 1fr; }
  .seo-closing-block { padding: 1.5rem; }
  .seo-faq summary { padding: 0.9rem 1.1rem; }
  .seo-faq > p { padding: 0 1.1rem 1rem; padding-top: 0.75rem; }
}

@media (max-width: 480px) {
  .seo-lead { font-size: 0.95rem; }
  .seo-body  { font-size: 0.875rem; }
  .seo-content-section { padding: 2.5rem 0; }
}
