/* =====================================================
   Tools Hub - Shared Stylesheet
   Modern Blue theme, fully responsive
   Used on homepage and all tool pages
   ===================================================== */

:root {
  /* Colors - LIGHT THEME (default) */
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-soft: #f1f5f9;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: #eff6ff;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --success: #22c55e;
  --success-hover: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;

  /* Spacing & shape */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);

  /* Transitions */
  --transition: all 0.2s ease;
}

/* DARK THEME */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-soft: #334155;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: #1e3a5f;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;
  --border: #334155;
  --border-strong: #475569;
  --success: #22c55e;
  --success-hover: #4ade80;
  --warning: #f59e0b;
  --danger: #ef4444;
  --accent-purple: #a78bfa;
  --accent-pink: #f472b6;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.4);
}

/* Apply transition on theme switch */
body, header, footer, .tool-card, .sidebar-card, .ad-slot, .stat-card, .drop-zone,
.result-item, .output-box, input, textarea, select, button {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ===================== Header ===================== */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Theme toggle button */
.theme-toggle {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  transform: rotate(15deg);
}
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* Hide theme toggle on very small screens (use header menu) */
@media (max-width: 480px) {
  .theme-toggle { width: 34px; height: 34px; font-size: 1rem; }
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--primary-hover); }
.logo-icon { font-size: 1.5rem; }

nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}
nav a:hover { color: var(--primary); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
}

/* ===================== Layout ===================== */
.container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.container.narrow {
  grid-template-columns: 1fr;
  max-width: 960px;
}

@media (max-width: 900px) {
  .container { grid-template-columns: 1fr; }
}

/* ===================== Breadcrumbs ===================== */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { margin: 0 0.5rem; color: var(--text-light); }
.breadcrumbs .current { color: var(--text); font-weight: 500; }

/* ===================== Tool Card ===================== */
.tool-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.tool-header {
  margin-bottom: 2rem;
  text-align: center;
}

.tool-header h1 {
  font-size: 1.85rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tool-header p {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 640px;
  margin: 0 auto;
}

.tool-icon-large {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* ===================== Forms & Inputs ===================== */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.field {
  margin-bottom: 1.25rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Range slider */
input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
}

/* Checkboxes */
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  user-select: none;
}
.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}
.checkbox-field label {
  margin: 0;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
}

/* Color input */
input[type="color"] {
  width: 60px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-card);
}

/* ===================== Buttons ===================== */
.btn {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { background: var(--text-light); cursor: not-allowed; transform: none; }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.25rem; font-size: 1.05rem; }

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

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.btn-ghost {
  background: var(--bg-soft);
  color: var(--text);
}
.btn-ghost:hover { background: var(--border); }

.btn-block { width: 100%; }

/* ===================== Drop Zone (image upload) ===================== */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-soft);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.drop-zone p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

/* ===================== Results ===================== */
.results-container {
  margin-top: 1.5rem;
  display: none;
}
.results-container.active { display: block; }

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
  background: var(--bg-soft);
  gap: 1rem;
  flex-wrap: wrap;
}
.result-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 200px;
}
.result-info img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.file-details h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.file-details p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.size-reduction {
  color: var(--success);
  font-weight: 600;
}
.btn-download {
  background: var(--success);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-download:hover { background: var(--success-hover); }

/* ===================== Stats Grid ===================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0;
}
.stat-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

/* ===================== Sidebar ===================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.sidebar-tools-list {
  list-style: none;
}

.sidebar-tools-list li {
  margin-bottom: 0.15rem;
}

.sidebar-tools-list a {
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 500;
}
.sidebar-tools-list a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.sidebar-tools-list a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-tools-list .tool-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}
.sidebar-tools-list .tool-name {
  flex: 1;
}
.sidebar-tools-list .current-tag {
  font-size: 0.65rem;
  background: var(--primary);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.sidebar-cat-head {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 0.6rem 0.35rem;
  margin-top: 0.4rem;
}
.sidebar-cat-head:first-child { margin-top: 0; }

.blog-teaser-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

/* ===================== Ad Slots ===================== */
.ad-slot {
  width: 100%;
  min-height: 120px;
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  text-align: center;
  padding: 1rem;
  gap: 0.25rem;
}
.ad-slot .ad-label {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.ad-slot .ad-note {
  font-size: 0.75rem;
  color: var(--text-light);
}
.ad-slot.sidebar-ad {
  min-height: 250px;
  margin: 0;
  /* Sticky: scrolls with content until end of sidebar, then stops */
  position: sticky;
  top: 90px;
  align-self: flex-start;
}
.ad-slot.ad-topBanner { min-height: 100px; }

/* On very tall pages, the sticky ad stays in view as user scrolls.
   On short pages, it just sits at the bottom of the sidebar.
   The sidebar is a flex column, so sticky works naturally. */

/* ===================== SEO Content Section ===================== */
.seo-content {
  margin-top: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.seo-content h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--text);
}
.seo-content h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  font-weight: 600;
  color: var(--text);
}
.seo-content p {
  margin-bottom: 0.9rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}
.seo-content ul, .seo-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}
.seo-content li { margin-bottom: 0.4rem; }

/* ===================== Footer ===================== */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2.5rem 2rem 1.5rem;
}
.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 768px) {
  .footer-container { grid-template-columns: 1fr 1fr; }
}
.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text);
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 0.4rem;
}
.footer-col ul a {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
}
.footer-col ul a:hover { color: var(--primary); }
.footer-col p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 0.6rem;
}
.footer-bottom {
  max-width: 1280px;
  margin: 1.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ===================== Homepage Hero ===================== */
.hero {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: rotate 30s linear infinite;
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}
.hero p {
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 640px;
  margin: 0 auto 1.5rem;
}
.hero-search {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.hero-search input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.hero-search input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.3), var(--shadow-lg);
}
@media (max-width: 600px) {
  .hero { padding: 2.5rem 1.25rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero p { font-size: 0.98rem; }
}

/* ===================== Homepage Tools Grid ===================== */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.tool-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.tool-card-link::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.tool-card-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.tool-card-link:hover::before { transform: scaleX(1); }

.tool-card-link .tool-icon-big {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  display: inline-block;
}
.tool-card-link h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.tool-card-link p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.tool-card-link .tool-cat-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.65rem;
  background: var(--bg-soft);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tool-card-link.popular::after {
  content: '🔥';
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 1.1rem;
}

/* Favorite button on tool cards */
.tool-card-link .fav-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  z-index: 2;
  width: auto;
  height: auto;
}
.tool-card-link .fav-btn:hover {
  color: var(--warning);
  transform: scale(1.15);
}
.tool-card-link .fav-btn.favorited {
  color: var(--warning);
}
/* Move category badge to make room for fav button */
.tool-card-link .tool-cat-badge {
  top: 0.85rem;
  right: 2.8rem;
}

/* AI badge on tool cards */
.tool-card-link .ai-badge-card {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tool-card-link.ai-tool {
  border-color: var(--accent-purple);
}
.tool-card-link.ai-tool::before {
  background: linear-gradient(90deg, var(--primary), var(--accent-purple)) !important;
}

/* Filter tabs (homepage) */
.tool-filter-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
  padding: 0.5rem;
  background: var(--bg-soft);
  border-radius: var(--radius);
  overflow-x: auto;
}
.tool-filter-tab {
  padding: 0.5rem 0.95rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.tool-filter-tab:hover {
  background: var(--bg-card);
  color: var(--text);
}
.tool-filter-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.tool-filter-tab .favorites-count {
  display: none;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}
.tool-filter-tab.active .favorites-count {
  display: inline-flex;
}

/* Empty state for favorites */
.empty-state {
  grid-column: 1 / -1;
}

/* ===================== Categories Section ===================== */
.category-section {
  margin-bottom: 2.5rem;
}

/* ===================== Toast / Notification ===================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: var(--transition);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===================== Copy Button ===================== */
.copy-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  transition: var(--transition);
}
.copy-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===================== Output Box (code/text output) ===================== */
.output-box {
  background: var(--text);
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0.75rem 0;
  position: relative;
}

/* ===================== Loading Spinner ===================== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}
.loading-overlay.active { display: flex; }
.loading-overlay .spinner {
  width: 48px;
  height: 48px;
  border-width: 4px;
}
.loading-overlay p {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===================== Mobile Nav ===================== */
@media (max-width: 768px) {
  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    border-top: 1px solid var(--border);
  }
  nav ul.open { display: flex; }
  .nav-toggle { display: block; }
  header { padding: 0.85rem 1.25rem; }
  .nav-container { gap: 0.5rem; }
  .theme-toggle { order: 2; }
  .nav-toggle { order: 3; }
}

/* ===================== Print friendly ===================== */
@media print {
  header, footer, .sidebar, .ad-slot, .btn, .copy-btn { display: none !important; }
  .container { display: block; }
}

/* ===================== Utility ===================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hidden { display: none; }

/* ===================== About/Contact Pages ===================== */
.about-hero, .contact-hero {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  padding: 3rem 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  margin-bottom: 2rem;
}
.about-hero h1, .contact-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.about-hero p, .contact-hero p {
  font-size: 1.05rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.feature-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.feature-card .feature-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.feature-card h4 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
  font-weight: 700;
}
.feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.team-card {
  text-align: center;
  padding: 1.25rem;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.team-card .avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
}
.team-card h4 { font-size: 1rem; margin-bottom: 0.2rem; }
.team-card .role { font-size: 0.82rem; color: var(--primary); font-weight: 600; margin-bottom: 0.4rem; }
.team-card .bio { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 1.5rem 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-card);
}
.timeline-item h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.timeline-item .date {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.timeline-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.contact-method {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: var(--transition);
}
.contact-method:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.contact-method .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.contact-method h4 { font-size: 1rem; margin-bottom: 0.3rem; }
.contact-method a, .contact-method p {
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-word;
}
.contact-method a:hover { color: var(--primary); }

.faq-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
}
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 700;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Form for contact page */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.form-status {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  font-size: 0.9rem;
  display: none;
}
.form-status.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}
.form-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* Stats showcase on About page */
.stats-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.stats-showcase .stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
}
.stats-showcase .stat .num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.stats-showcase .stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
