/* ============================================================
   AI Tools Directory — Stylesheet v4.0
   Clean white-gray design + sky-blue gradient buttons
   + glassmorphism particle background
   ============================================================ */
:root {
  --primary: #a855f7;           /* sky-500 */
  --primary-dark: #7c3aed;      /* sky-600 */
  --primary-light: #f3e8ff;     /* sky-100 */
  --primary-darker: #6d28d9;    /* sky-700 */
  --accent: #ec4899;            /* blue-600 (for links) */
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #dc2626;
  --text: #0f172a;              /* slate-900 */
  --text-light: #334155;        /* slate-700 */
  --muted: #64748b;             /* slate-500 */
  --border: #e2e8f0;            /* slate-200 */
  --bg: #f8fafc;                /* slate-50 — white-gray */
  --bg-alt: #f1f5f9;            /* slate-100 */
  --card: #ffffff;
  --card-glass: rgba(255, 255, 255, 0.8);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-green: 0 4px 15px rgba(168, 85, 247, 0.4);
  --radius: 14px;
  --radius-sm: 8px;
  --gradient-green: linear-gradient(135deg, #a855f7 0%, #7c3aed 50%, #ec4899 100%);
  --gradient-green-hover: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #db2777 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  /* Note: overflow-x: hidden breaks position:sticky on .site-header.
     Use overflow-x: clip instead which doesn't break sticky. */
  overflow-x: clip;
}

/* ============================================================
   GLASSMORPHISM PARTICLE BACKGROUND (light, mouse-interactive)
   ============================================================ */
.bg-particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.particle {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  will-change: transform;
  transition: margin 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.p-1 { width: 380px; height: 380px; background: radial-gradient(circle, #a855f7 0%, transparent 70%); top: -80px; left: -80px; animation: drift-1 24s ease-in-out infinite; }
.p-2 { width: 460px; height: 460px; background: radial-gradient(circle, #f472b6 0%, transparent 70%); top: 25%; right: -120px; animation: drift-2 30s ease-in-out infinite; }
.p-3 { width: 340px; height: 340px; background: radial-gradient(circle, #06b6d4 0%, transparent 70%); bottom: -60px; left: 25%; animation: drift-3 26s ease-in-out infinite; }
.p-4 { width: 300px; height: 300px; background: radial-gradient(circle, #ec4899 0%, transparent 70%); top: 55%; left: 60%; animation: drift-4 32s ease-in-out infinite; }
.p-5 { width: 280px; height: 280px; background: radial-gradient(circle, #10b981 0%, transparent 70%); top: 10%; left: 50%; animation: drift-5 28s ease-in-out infinite; }

@keyframes drift-1 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(60px,40px) scale(1.08); } 66% { transform: translate(-30px,70px) scale(0.95); } }
@keyframes drift-2 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(-50px,60px) scale(1.05); } 66% { transform: translate(30px,-40px) scale(0.92); } }
@keyframes drift-3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(80px,-60px) scale(1.12); } }
@keyframes drift-4 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(-60px,-30px) scale(1.08); } 66% { transform: translate(40px,60px) scale(0.95); } }
@keyframes drift-5 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(50px,40px) scale(1.06); } 66% { transform: translate(-40px,-50px) scale(0.94); } }

body > *:not(.bg-particles) { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  /* !important needed here: the generic "body > *:not(.bg-particles)"
     rule above has higher specificity than a single class selector and
     was overriding position/z-index back down to relative/1, causing the
     header (and the mobile menu inside it) to render BELOW the hero,
     search bar, and category pills instead of above them. */
  position: sticky !important;
  top: 0;
  z-index: 1000 !important;  /* Raised to prevent hero from covering dropdown */
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  flex-wrap: wrap;
}
.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  margin-right: 40px;  /* Push nav menu further from logo */
}
.logo-icon {
  background: var(--gradient-green);
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: var(--shadow-green);
}

/* ---------- Site logo (image mode) ---------- */
.site-logo-img {
  display: inline-block;
  width: auto;
  object-fit: contain;
}
.site-logo-header {
  max-height: 68px;
  max-width: 340px;
}
.site-logo-footer {
  max-height: 56px;
  max-width: 260px;
}
.footer-logo { margin-bottom: 12px; }
/* Light logo shows by default; dark logo (if one was uploaded) swaps in
   once the site is switched to dark mode. When no separate dark logo is
   set, render_site_logo() only outputs one <img>, so these rules simply
   don't apply. */
.logo-mode-dark { display: none; }
[data-theme="dark"] .logo-mode-light { display: none; }
[data-theme="dark"] .logo-mode-dark { display: inline-block; }

/* ---------- Site logo (text mode): animated icon + gradient wordmark ---------- */
.text-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}
.text-logo-icon {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: 11px;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
  animation: text-logo-float 3.2s ease-in-out infinite;
}
@keyframes text-logo-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-6deg); }
}
.text-logo-word {
  font-weight: 800;
  white-space: nowrap;
  background: linear-gradient(135deg, #ec4899, #a855f7 50%, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-logo-header .text-logo-icon { width: 40px; height: 40px; }
.text-logo-header .text-logo-word { font-size: 24px; }
.text-logo-footer .text-logo-icon { width: 34px; height: 34px; }
.text-logo-footer .text-logo-word { font-size: 20px; }
.header-search {
  display: flex;
  flex: 1;
  max-width: 500px;
  min-width: 200px;
  position: relative;
  align-items: center;
}
.header-search .search-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 11px 16px 11px 42px;
  font-size: 14px;
  outline: none;
  background: var(--bg-alt);
  transition: all 0.2s;
  font-family: inherit;
}
.header-search input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.header-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: auto;  /* Push nav to the right, away from logo */
}
.header-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.header-nav a:hover { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.header-nav a.active { background: var(--gradient-green); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background: transparent;
  color: var(--text);
  padding: 48px 0;
  text-align: center;
  position: relative;
  overflow: visible;
  border-radius: 0;
  border-bottom: none;
}
.hero::before {
  display: none;
}
.hero h2 { font-size: 34px; font-weight: 800; margin-bottom: 8px; position: relative; letter-spacing: -0.5px; color: var(--text); }
.hero p { opacity: 0.8; font-size: 16px; margin-bottom: 22px; position: relative; color: var(--text-light); }
.hero-search {
  display: flex;
  max-width: 580px;
  margin: 0 auto;
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}
.hero-search input {
  flex: 1;
  border: none;
  padding: 15px 22px;
  font-size: 15px;
  outline: none;
  color: var(--text);
  background: transparent;
}
.hero-search button {
  border: none;
  background: var(--gradient-green);
  color: #fff;
  padding: 0 28px;
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-search button:hover { filter: brightness(1.08); transform: scale(1.02); }

/* ---------- Categories Bar (auto-extracted) ---------- */
.categories-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 0;
  align-items: center;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.cat-chip:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: var(--shadow);
}
.cat-chip.active {
  background: var(--gradient-green);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-green);
}
.cat-chip .cat-icon { font-size: 15px; }

/* ---------- Filter Bar (pricing) ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
}
.filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
.filter-tab.active { background: var(--gradient-green); color: #fff; border-color: var(--primary); }

/* ---------- Section Title ---------- */
.section-title {
  font-size: 22px;
  font-weight: 800;
  margin: 24px 0 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}

/* ---------- Tools Grid (3 per row) ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
@media (max-width: 1024px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 120px;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  text-decoration: none;
}
.tool-featured-badge {
  position: absolute;
  top: 5px; right: 5px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  z-index: 2;
}
.tool-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.tool-icon {
  width: 48px; height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg-alt);
  padding: 4px;
  flex-shrink: 0;
}
.tool-icon-placeholder {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--primary-light);
  border-radius: 8px;
  flex-shrink: 0;
}
.tool-card-head-text { flex: 1; min-width: 0; }
.tool-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.tool-rating .stars { color: #f59e0b; letter-spacing: 0.5px; }
.tool-desc {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
}
.tool-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pricing-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pricing-badge.free { background: #d1fae5; color: #065f46; }
.pricing-badge.freemium { background: #fef3c7; color: #92400e; }
.pricing-badge.paid { background: #fee2e2; color: #991b1b; }
.pricing-badge.open-source { background: #f3e8ff; color: #6d28d9; }
.tool-views { color: var(--muted); font-size: 11px; }
.tool-btn {
  display: block;
  padding: 7px;
  background: var(--gradient-green);
  color: #fff;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
  box-shadow: var(--shadow-green);
}
.tool-card:hover .tool-btn { filter: brightness(1.08); transform: scale(1.02); }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.pagination a {
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s;
}
.pagination a:hover { border-color: var(--primary); text-decoration: none; color: var(--primary-dark); }
.pagination a.active { background: var(--gradient-green); color: #fff; border-color: var(--primary); }

/* ---------- Empty State ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: var(--radius);
  margin: 32px 0;
  border: 1px solid var(--border);
}
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty h2 { font-size: 22px; margin-bottom: 6px; color: var(--text); }
.empty p { color: var(--muted); margin-bottom: 12px; }

/* ---------- Buttons (green gradient) ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  background: var(--gradient-green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-green);
}
.btn:hover { background: var(--gradient-green-hover); color: #fff; text-decoration: none; transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); }
.btn-success { background: var(--gradient-green); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3); }
.btn-danger:hover { box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45); transform: translateY(-2px) scale(1.02); }
.btn-warn { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3); }
.btn-warn:hover { box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45); transform: translateY(-2px) scale(1.02); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 30px; font-size: 16px; }

/* ---------- Back Link ---------- */
.back-link {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--primary-dark); text-decoration: none; }

/* ---------- Tool Detail Page ---------- */
.detail-wrap {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  margin: 20px 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.detail-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-cover-wrap { position: relative; }
.detail-cover {
  width: 200px;
  height: 200px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 12px;
}
.detail-panel { min-width: 0; }
.detail-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  letter-spacing: -0.5px;
}
.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.detail-table td {
  padding: 12px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
}
.detail-table .label {
  font-weight: 700;
  width: 130px;
  color: var(--muted);
  padding-right: 16px;
}
.detail-visit-area {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px dashed var(--border);
}
.visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 36px;
  background: var(--gradient-green);
  color: #fff;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-green);
}
.visit-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: var(--gradient-green-hover);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.5);
  color: #fff;
  text-decoration: none;
}

/* ---------- Article ---------- */
.tool-article {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}
.tool-article h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 28px 0 12px;
  letter-spacing: -0.3px;
}
.tool-article h2:first-child { margin-top: 0; }
.tool-article h3 { font-size: 18px; font-weight: 700; margin: 18px 0 8px; color: var(--primary-dark); }
.tool-article p { margin-bottom: 14px; line-height: 1.8; color: var(--text-light); font-size: 15px; }
.tool-article ul, .tool-article ol { margin: 0 0 16px 24px; }
.tool-article li { margin-bottom: 6px; line-height: 1.7; color: var(--text-light); }
.tool-article strong { color: var(--text); }

/* ---------- Related Tools ---------- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.related-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  transition: all 0.15s;
  color: var(--text);
}
.related-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  text-decoration: none;
  transform: translateY(-1px);
}
.related-card img {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-alt);
}
.related-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

/* ---------- Professional Footer ---------- */
.pro-footer {
  background: #0f172a;
  color: #cbd5e1;
  margin-top: 60px;
  padding: 0;
  font-size: 14px;
}
.pro-footer .footer-ad-zone {
  text-align: center;
  padding: 20px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pro-footer .footer-main { padding: 50px 0 30px; }
.pro-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 768px) { .pro-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (max-width: 480px) { .pro-footer .footer-grid { grid-template-columns: 1fr; } }
.pro-footer .footer-brand h3 { color: #fff; font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.pro-footer .footer-brand p { color: #94a3b8; margin-bottom: 8px; line-height: 1.6; }
.pro-footer .footer-brand .footer-text { color: #64748b; font-size: 12px; margin-top: 16px; }
.pro-footer .footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 1px; }
.pro-footer .footer-col ul { list-style: none; padding: 0; }
.pro-footer .footer-col ul li { margin-bottom: 8px; }
.pro-footer .footer-col a { color: #cbd5e1; text-decoration: none; font-size: 13px; transition: color 0.15s; }
.pro-footer .footer-col a:hover { color: #10b981; text-decoration: none; }
.pro-footer .footer-bottom {
  background: #020617;
  padding: 18px 0;
  border-top: 1px solid #1e293b;
  font-size: 12px;
}
.pro-footer .footer-bottom p { text-align: center; color: #64748b; margin: 4px 0; }
.social-links { display: flex; gap: 8px; margin-top: 14px; }
.social-links a {
  width: 36px; height: 36px;
  background: #1e293b;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 16px;
  transition: all 0.15s;
}
.social-links a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #1e293b;
  color: #cbd5e1;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  padding: 0 20px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid #334155;
}
.sidebar a {
  display: block;
  padding: 10px 20px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}
.sidebar a:hover { background: #334155; color: #fff; text-decoration: none; }
.sidebar a.active { background: var(--gradient-green); color: #fff; }
.main-area {
  background: var(--bg);
  padding: 24px;
  overflow-x: auto;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.page-header .subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-alt);
}
.card-body { padding: 20px; }

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
}
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=url],
.form-group input[type=number],
.form-group select,
.form-group textarea,
.form-group input:not([type]) {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
table th, table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
table th {
  background: var(--bg-alt);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
table tr:hover { background: var(--bg-alt); }

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }

.flash-msg {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 14px;
}
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-green);
  padding: 20px;
}
.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-box h1 { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.login-box .subtitle { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 14px; }

/* ---------- WYSIWYG Toolbar ---------- */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px;
  background: var(--bg-alt);
  border: 1px solid #d1d5db;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.editor-toolbar button {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 30px;
}
.editor-toolbar button:hover { background: var(--primary); color: #fff; }
.editor-area {
  border: 1px solid #d1d5db;
  border-radius: 0 0 8px 8px;
  padding: 12px;
  min-height: 300px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.editor-area:focus { border-color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .hero h2 { font-size: 24px; }
  .detail-title { font-size: 22px; }
  .detail-cover { width: 150px; height: 150px; margin: 0 auto; }
  .detail-grid { grid-template-columns: 1fr; text-align: center; }
}

/* Hide hamburger toggle on desktop (must come BEFORE media queries) */
.header-toggle { display: none; }

/* ─── Mobile Header (responsive) ─── */
@media (max-width: 1024px) {
  /* IMPORTANT: backdrop-filter on .site-header creates a CSS "containing block"
     for any position:fixed descendant (like #mainNav below). That traps the
     full-screen mobile menu overlay inside the small header box instead of
     covering the whole viewport, which is why only the first nav link
     ("All Tools") was visible when the hamburger was tapped. Disabling
     backdrop-filter on mobile removes that containing block and lets
     #mainNav's position:fixed work relative to the real viewport again. */
  .site-header {
    padding: 0;
    position: sticky !important;
    top: 0;
    z-index: 10000 !important;
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .header-inner {
    gap: 8px;
    padding: 10px 0;
    flex-wrap: nowrap;
    position: relative;
  }
  .logo {
    font-size: 17px;
    margin-right: 0;  /* Remove desktop margin */
    flex: 1;
    min-width: 0;
  }
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 17px;
    border-radius: 8px;
  }
  .site-logo-header {
    max-height: 48px;
    max-width: 210px;
  }
  .text-logo-header .text-logo-icon { width: 32px; height: 32px; }
  .text-logo-header .text-logo-word { font-size: 18px; }
  /* Hamburger toggle button — shows on mobile only */
  .header-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 0 8px;
    flex-shrink: 0;
    transition: all 0.2s;
    /* Must stay above #mainNav's full-screen overlay (z-index: 99999)
       or the button gets buried under it once the menu is open,
       making it impossible to tap again to close. */
    position: relative;
    z-index: 100000;
  }
  .header-toggle:hover { background: var(--bg-alt); }
  .header-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
  }
  /* Hamburger → X animation when button has .open class */
  .header-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .header-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .header-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  /* Dark mode button — smaller on mobile, stays in top bar */
  #darkModeToggle {
    width: 38px;
    height: 38px;
    font-size: 16px;
    margin-left: 0;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    flex-shrink: 0;
  }
  #darkModeToggle:hover { background: var(--bg-alt); }
  [data-theme="dark"] #darkModeToggle {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
  }
  /* Navigation menu — full-screen overlay when mobile-open */
  .header-nav {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    background: #fff;
    flex-direction: column;
    gap: 0;
    padding: 70px 20px 30px;
    margin: 0 !important;
    z-index: 99999;
    overflow-y: auto;
  }
  [data-theme="dark"] .header-nav { background: #000; }
  .header-nav.mobile-open { display: flex !important; }
  .header-nav a {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 8px;
    margin-bottom: 2px;
  }
  .header-nav a:hover { background: var(--bg-alt); }
  .header-nav a.active { background: var(--gradient-green); color: #fff; }
}

/* Extra small screens (phones) */
@media (max-width: 600px) {
  .header-inner { padding: 8px 0; }
  .logo { font-size: 15px; gap: 6px; }
  .logo-icon { width: 28px; height: 28px; font-size: 15px; }
  .site-logo-header { max-height: 40px; max-width: 160px; }
  .text-logo-header .text-logo-icon { width: 28px; height: 28px; }
  .text-logo-header .text-logo-word { font-size: 16px; }
  .header-toggle, #darkModeToggle { width: 34px; height: 34px; }
  .header-nav a { font-size: 14px; padding: 11px 12px; }
}

/* ============================================================
   CATEGORIES SYSTEM (Futurepedia-style)
   ============================================================ */

/* Main categories bar (below hero search) */
.main-cats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
}
.main-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}
.main-cat-chip.all-cats-link {
    margin-left: 8px;  /* small gap, not pushed to far right */
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    color: #7c3aed;
    border-color: #ddd6fe;
    font-weight: 700;
}
.main-cat-chip:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: var(--shadow);
}
.main-cat-chip.active {
    background: var(--gradient-green);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-green);
}

/* Categories page — main category cards grid */
.cat-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.cat-main-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow);
    display: block;
}
.cat-main-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    text-decoration: none;
}
.cat-main-icon {
    font-size: 36px;
    margin-bottom: 12px;
}
.cat-main-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}
.cat-main-count {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 14px;
}
.cat-main-subs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cat-sub-pill {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg-alt);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
}

/* Subcategory grid (on category page) */
.cat-sub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}
.cat-sub-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.cat-sub-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

/* ============================================================
   SVG CATEGORY ICONS + COMPACT CATEGORY BAR
   ============================================================ */
.cat-svg-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.cat-svg-icon-wrap svg {
    width: 100%;
    height: 100%;
}
.main-cat-chip .cat-svg-icon-wrap svg,
.main-cat-chip svg.cat-svg-icon {
    width: 16px;
    height: 16px;
}
.main-cats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 4px;
    justify-content: center;
}
.main-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.main-cat-chip:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: var(--shadow);
}
.main-cat-chip.active {
    background: var(--gradient-green);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-green);
}

/* Category count badge (in homepage chips) */
.cat-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}
.main-cat-chip.active .cat-count-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* ============================================================
   FUTUREPEDIA-STYLE CATEGORY CARDS (categories.php)
   ============================================================ */
.fp-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}
@media (max-width: 768px) {
    .fp-cat-grid { grid-template-columns: 1fr; gap: 16px; }
}

.fp-cat-card {
    display: flex;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
    min-height: 160px;
}
.fp-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    text-decoration: none;
}

/* Left: gradient icon area */
.fp-cat-icon-area {
    width: 140px;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.fp-cat-icon-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2) 0%, transparent 60%);
}
.fp-cat-icon-inner {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}
.fp-cat-icon-inner svg {
    width: 36px;
    height: 36px;
    color: #fff;
    stroke: #fff;
}

/* Right: text content */
.fp-cat-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.fp-cat-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.3px;
}
.fp-cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 7px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.fp-cat-subs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.fp-cat-sub-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--bg-alt);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
}
.fp-sub-count {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 1px 5px;
    border-radius: 6px;
    min-width: 16px;
    text-align: center;
}
.fp-cat-more {
    font-size: 11px;
    color: var(--muted);
    font-style: italic;
}
.fp-cat-show-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-top: auto;
}
.fp-cat-card:hover .fp-cat-show-all {
    text-decoration: underline;
}

/* ============================================================
   FUTUREPEDIA-EXACT CATEGORY CARDS (categories.php)
   ============================================================ */
.fp-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .fp-cat-grid { grid-template-columns: 1fr; }
}

.fp-cat-card-fp {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}
.fp-cat-card-fp:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.fp-cat-img {
    width: 100%;
    max-width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}
.fp-cat-img-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ddd6fe, #f0f6fb);
}
@media (min-width: 768px) {
    .fp-cat-img {
        width: 200px;
        height: 200px;
    }
}

.fp-cat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}
.fp-cat-h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}
.fp-cat-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.fp-cat-ul li {
    margin-bottom: 4px;
}
.fp-cat-sub-link {
    color: #1e293b;
    text-transform: capitalize;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.15s;
}
.fp-cat-sub-link:hover {
    color: #64748b;
    text-decoration: none;
}
.fp-cat-sub-count {
    color: #64748b;
    font-size: 14px;
}
.fp-cat-show-all-wrap {
    margin-top: auto;
    padding-top: 16px;
    font-weight: 700;
}
.fp-cat-show-all {
    color: #a855f7;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.15s;
}
.fp-cat-show-all:hover {
    color: #7c3aed;
    text-decoration: none;
}

/* ============================================================
   v28 NEW FEATURES — Dark Mode, Share Buttons, Ratings, Recent Tools
   ============================================================ */

/* ─── Dark Mode Toggle Button ─── */
#darkModeToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    text-decoration: none;
    margin-left: 8px;
}
#darkModeToggle:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* ─── Dark Mode Theme (pure black) ─── */
[data-theme="dark"] {
    --bg: #000000;
    --card-bg: #0a0a0a;
    --text: #ffffff;
    --text-muted: #a3a3a3;
    --border: #1a1a1a;
    --primary: #a855f7;
    --primary-hover: #7c3aed;
    --primary-light: #4c1d95;
    --accent: #ec4899;
    --shadow: 0 4px 12px rgba(0,0,0,0.8);
}
[data-theme="dark"] body {
    background: #000000;
    color: #ffffff;
}
[data-theme="dark"] .site-header {
    background: rgba(0, 0, 0, 0.95);
    border-bottom-color: #1a1a1a;
}
[data-theme="dark"] .card,
[data-theme="dark"] .detail-panel,
[data-theme="dark"] .related-card,
[data-theme="dark"] .tool-card,
[data-theme="dark"] .blog-card,
[data-theme="dark"] .detail-wrap,
[data-theme="dark"] .news-ticker-item,
[data-theme="dark"] .fp-cat-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .sponsor-card {
    background: #0a0a0a;
    border-color: #1a1a1a;
    color: #ffffff;
}
[data-theme="dark"] .detail-table .label,
[data-theme="dark"] .back-link,
[data-theme="dark"] .header-nav a {
    color: #a3a3a3;
}
[data-theme="dark"] .header-search input {
    background: #0a0a0a;
    border-color: #1a1a1a;
    color: #ffffff;
}
[data-theme="dark"] .tool-article h2,
[data-theme="dark"] .tool-article h3,
[data-theme="dark"] .section-title,
[data-theme="dark"] .detail-title {
    color: #f1f5f9;
}
[data-theme="dark"] .pro-footer {
    background: #0a0f1f;
    border-top-color: var(--border);
}
[data-theme="dark"] .pro-footer a {
    color: var(--text-muted);
}
[data-theme="dark"] .pricing-badge.free { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .pricing-badge.freemium { background: #4c1d95; color: #67e8f9; }
[data-theme="dark"] .pricing-badge.paid { background: #7c2d12; color: #fdba74; }
[data-theme="dark"] .pricing-badge.open-source { background: #581c87; color: #d8b4fe; }
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #0f172a;
    color: var(--text);
    border-color: var(--border);
}

/* ─── Share Buttons ─── */
.share-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s;
    cursor: pointer;
}
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    color: #fff;
}
.share-btn .share-icon { line-height: 1; }
.share-x { background: #000; }
.share-fb { background: #1877f2; }
.share-wa { background: #25d366; }
.share-ln { background: #0a66c2; }
.share-tg { background: #0088cc; }
.share-reddit { background: #ff4500; }
.share-email { background: #64748b; }
.share-copy { background: #a855f7; }
.share-copy.copied { background: #10b981; }

/* ─── Star Rating Widget ─── */
.rating-widget {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    text-align: center;
}
[data-theme="dark"] .rating-widget {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}
.rating-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 4px;
    margin: 12px 0;
    justify-content: center;
}
.rating-stars input { display: none; }
.rating-stars label {
    font-size: 36px;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
    line-height: 1;
}
.rating-stars label:hover,
.rating-stars label:hover ~ label,
.rating-stars input:checked ~ label {
    color: #f59e0b;
}
.rating-stars label:hover { transform: scale(1.15); }
.rating-summary {
    font-size: 14px;
    color: #64748b;
    margin-top: 8px;
}
.rating-summary .avg {
    font-size: 22px;
    font-weight: 700;
    color: #f59e0b;
}
.rating-thanks {
    color: #10b981;
    font-weight: 600;
    margin-top: 8px;
    display: none;
}
.rating-thanks.show { display: block; }

/* ─── Recently Viewed Widget ─── */
.recent-section {
    margin: 40px 0;
    padding: 24px;
    background: linear-gradient(135deg, #fafbff, #f1f5f9);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}
[data-theme="dark"] .recent-section {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: var(--border);
}
.recent-section h2 {
    margin: 0 0 16px;
    font-size: 22px;
    color: #0f172a;
}
[data-theme="dark"] .recent-section h2 { color: #f1f5f9; }
.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.recent-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.2s;
}
[data-theme="dark"] .recent-card {
    background: var(--card-bg);
    border-color: var(--border);
}
.recent-card:hover {
    border-color: #06b6d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.recent-card img,
.recent-card .related-name {
    /* uses .related-card styles already in stylesheet */
}

/* ─── Trending Tools Section (homepage) ─── */
.trending-section {
    margin: 40px 0;
}
.trending-section .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.trending-badge {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.trending-card {
    position: relative;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    overflow: hidden;
}
[data-theme="dark"] .trending-card {
    background: var(--card-bg);
    border-color: var(--border);
}
.trending-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f97316, #ef4444);
}
.trending-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.trending-rank {
    position: absolute;
    top: 8px; right: 12px;
    font-size: 32px;
    font-weight: 800;
    color: #e2e8f0;
    line-height: 1;
}
[data-theme="dark"] .trending-rank { color: #334155; }
.trending-card .tool-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
    color: #0f172a;
}
[data-theme="dark"] .trending-card .tool-name { color: #f1f5f9; }
.trending-card .tool-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 8px;
    align-items: center;
}
.trending-card .tool-views {
    color: #f97316;
    font-weight: 600;
}

/* ─── Admin: Bulk Actions Bar ─── */
.bulk-actions-bar {
    background: #1e293b;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.bulk-actions-bar select,
.bulk-actions-bar button {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    cursor: pointer;
}
.bulk-actions-bar button {
    background: #06b6d4;
    color: #fff;
    font-weight: 600;
}
.bulk-actions-bar button.danger { background: #dc2626; }
.bulk-actions-bar button.success { background: #059669; }
.bulk-actions-bar .selected-count {
    background: #06b6d4;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-left: auto;
}

/* ─── JSON-LD Breadcrumbs ─── */
.breadcrumbs {
    font-size: 13px;
    color: #64748b;
    margin: 12px 0;
    padding: 8px 0;
}
.breadcrumbs a {
    color: #06b6d4;
    text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; color: #cbd5e1; }

/* ─── Comments System ─── */
.comments-section-title {
    margin: 40px 0 16px;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    border-top: 2px solid var(--border);
    padding-top: 24px;
}
[data-theme="dark"] .comments-section-title { color: #f1f5f9; }
.comment-item {
    padding: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}
[data-theme="dark"] .comment-item {
    background: var(--card-bg);
    border-color: var(--border);
}
.comment-item:hover { border-color: #cbd5e1; }
.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.comment-content {
    color: #1e293b;
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
}
[data-theme="dark"] .comment-content { color: var(--text); }
.comment-replies { margin-top: 12px; }
.comment-reply-link {
    color: #06b6d4;
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
}
.comment-reply-link:hover { text-decoration: underline; }
.comment-like-btn:hover { color: #dc2626 !important; }
.comment-form input,
.comment-form textarea {
    background: #fff;
}
[data-theme="dark"] .comment-form input,
[data-theme="dark"] .comment-form textarea {
    background: #0f172a;
    color: var(--text);
}

/* ─── Sitewide Newsletter Widget (single compact card, left side) ─── */
.site-newsletter-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 998;
    width: 100%;
    max-width: 300px;
    background: #fff;
    border-radius: 18px;
    padding: 22px 22px 20px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.97);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-newsletter-widget.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
[data-theme="dark"] .site-newsletter-widget {
    background: #1e293b;
    color: #e2e8f0;
}
.site-newsletter-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}
.site-newsletter-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}
[data-theme="dark"] .site-newsletter-close {
    background: #334155;
    color: #94a3b8;
}
.site-newsletter-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.site-newsletter-widget h4 {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 6px;
    color: inherit;
}
.site-newsletter-widget p {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 14px;
    line-height: 1.4;
}
[data-theme="dark"] .site-newsletter-widget p { color: #94a3b8; }
.site-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.site-newsletter-form input {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13.5px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}
.site-newsletter-form input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}
[data-theme="dark"] .site-newsletter-form input {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}
.site-newsletter-form button {
    padding: 10px 18px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13.5px;
    transition: all 0.2s;
}
.site-newsletter-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
}
.site-newsletter-msg {
    margin: 8px 0 0;
    font-size: 12px;
    min-height: 16px;
}

@media (max-width: 600px) {
    .site-newsletter-widget {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }
}

/* ─── Tool Comparison ─── */
.compare-section {
    margin: 32px 0;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
[data-theme="dark"] .compare-section {
    background: var(--card-bg);
    border-color: var(--border);
}
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}
.compare-table th,
.compare-table td {
    padding: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
    font-size: 13px;
}
[data-theme="dark"] .compare-table th,
[data-theme="dark"] .compare-table td {
    border-color: var(--border);
}
.compare-table th {
    background: #f1f5f9;
    font-weight: 700;
}
[data-theme="dark"] .compare-table th {
    background: #0f172a;
}
.compare-table .compare-row-label {
    text-align: left;
    font-weight: 600;
    background: #f8fafc;
}
[data-theme="dark"] .compare-table .compare-row-label {
    background: var(--card-bg);
}

/* ─── Categories Page (v33) ─── */
.cats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.cat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
[data-theme="dark"] .cat-card {
    background: var(--card-bg);
    border-color: var(--border);
}
.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(168, 85, 247, 0.12);
    border-color: #a855f7;
}
.cat-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f1f5f9;
}
[data-theme="dark"] .cat-card-header {
    border-bottom-color: var(--border);
}
.cat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f3e8ff, #ddd6fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
[data-theme="dark"] .cat-card-icon {
    background: linear-gradient(135deg, #4c1d95, #6b21a8);
}
.cat-card-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.2;
}
[data-theme="dark"] .cat-card-header h2 { color: #f1f5f9; }
.cat-card-total {
    font-size: 12px;
    color: #a855f7;
    font-weight: 600;
}
.cat-subs-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    flex: 1;
}
.cat-subs-list li {
    margin-bottom: 6px;
}
.cat-subs-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    transition: all 0.15s;
    text-transform: capitalize;
}
[data-theme="dark"] .cat-subs-list a { color: #cbd5e1; }
.cat-subs-list a:hover {
    background: #faf5ff;
    color: #7c3aed;
    padding-left: 14px;
}
[data-theme="dark"] .cat-subs-list a:hover {
    background: rgba(168, 85, 247, 0.1);
}
.cat-subs-list .sub-count {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}
.cat-show-all {
    display: block;
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    color: #7c3aed;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    margin-top: auto;
}
.cat-show-all:hover {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
}
[data-theme="dark"] .cat-show-all {
    background: rgba(168, 85, 247, 0.1);
    color: #f472b6;
}
[data-theme="dark"] .cat-show-all:hover {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
}

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

/* ─── Tool Logo Upscale Badge ─── */
.cover-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}
.cover-badge {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

/* ─── Website Screenshot Section (in tool detail article) ─── */
.website-screenshot-section {
    margin: 32px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}
[data-theme="dark"] .website-screenshot-section {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: var(--border);
}
.screenshot-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #0f172a;
}
[data-theme="dark"] .screenshot-title { color: #f1f5f9; }
.screenshot-frame {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}
[data-theme="dark"] .screenshot-frame {
    background: #0f172a;
    border-color: var(--border);
}
.screenshot-browser-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}
[data-theme="dark"] .screenshot-browser-bar {
    background: #1e293b;
    border-bottom-color: var(--border);
}
.screenshot-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.screenshot-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }
.screenshot-url-bar {
    flex: 1;
    background: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #64748b;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
}
[data-theme="dark"] .screenshot-url-bar {
    background: #0f172a;
    color: #94a3b8;
    border-color: #334155;
}
.screenshot-image-wrap {
    position: relative;
    aspect-ratio: 1200 / 800;
    background: #f8fafc;
    overflow: hidden;
}
[data-theme="dark"] .screenshot-image-wrap {
    background: #1e293b;
}
.screenshot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}
.screenshot-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    color: #7c3aed;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 20px;
}
[data-theme="dark"] .screenshot-loading {
    background: linear-gradient(135deg, #4c1d95, #6b21a8);
    color: #7dd3fc;
}
.screenshot-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -50px 0 0 -20px;
    border: 3px solid rgba(168, 85, 247, 0.2);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: screenshotSpin 0.8s linear infinite;
}
@keyframes screenshotSpin {
    to { transform: rotate(360deg); }
}
.screenshot-caption {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}
[data-theme="dark"] .screenshot-caption { color: #94a3b8; }
.screenshot-caption a {
    color: #a855f7;
    text-decoration: none;
    font-weight: 600;
}
.screenshot-caption a:hover { text-decoration: underline; }

/* ─── Compare Toggle Button (on tool cards) ───
   Sits inline in the footer row, just before the pricing badge —
   no longer absolutely positioned over the Visit Tool button. */
.compare-toggle-btn {
    position: static;
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.compare-toggle-btn:hover {
    background: #a855f7;
    color: #fff;
    border-color: #a855f7;
}
.compare-toggle-btn.added {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    border-color: #7c3aed;
}
[data-theme="dark"] .compare-toggle-btn {
    background: rgba(30, 41, 59, 0.9);
    color: #94a3b8;
    border-color: #334155;
}

/* ─── Reading Progress Bar ─── */
#readingProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

/* ─── Compare Bar (fixed bottom) ─── */
#compareBar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid #a855f7;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 998;
    padding: 12px 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] #compareBar {
    background: #1e293b;
    border-top-color: #a855f7;
}

/* ─── Tool Card: ensure relative position for compare button ─── */
.tool-card {
    position: relative;
}

/* ─── News Ticker (Latest Tools marquee) ─── */
.news-ticker {
    background: linear-gradient(90deg, #0f172a, #1e293b);
    color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid #334155;
    height: 40px;
}
.news-ticker-label {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 2px 0 8px rgba(168, 85, 247, 0.3);
}
.news-ticker-icon {
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}
.news-ticker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}
.news-ticker-track {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: tickerScroll 40s linear infinite;
}
.news-ticker:hover .news-ticker-track {
    animation-play-state: paused;
}
@keyframes tickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.news-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 100%;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
    border-right: 1px solid #334155;
}
.news-ticker-item:hover {
    background: rgba(168, 85, 247, 0.15);
    color: #fff;
}
.news-ticker-item img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
.news-ticker-emoji {
    font-size: 16px;
}
.news-ticker-name {
    font-weight: 600;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-ticker-pricing {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.news-ticker-pricing.pricing-free { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.news-ticker-pricing.pricing-freemium { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.news-ticker-pricing.pricing-paid { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }
.news-ticker-pricing.pricing-open-source { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }

[data-theme="dark"] .news-ticker {
    background: linear-gradient(90deg, #000, #0f172a);
}

@media (max-width: 768px) {
    .news-ticker-label span:last-child { display: none; }
    .news-ticker-name { max-width: 120px; }
    .news-ticker-track { animation-duration: 30s; }
}

/* ─── Scroll-to-Top Button ─── */
.scroll-top-btn {
    position: fixed;
    bottom: 96px;  /* Raised slightly above newsletter FAB */
    right: 24px !important;
    left: auto !important;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 22px;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
    z-index: 997;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 24px rgba(168, 85, 247, 0.6);
}
[data-theme="dark"] .scroll-top-btn {
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.6);
}
@media (max-width: 600px) {
    .scroll-top-btn {
        bottom: 80px;
        right: 16px !important;
        left: auto !important;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

/* ─── Hero SEO Line ─── */
.hero-seo-line {
    font-size: 13px;
    color: #64748b;
    margin: 8px auto 22px !important;
    max-width: 600px;
    line-height: 1.6;
    opacity: 0.85;
}

/* ─── Dark Mode — Additional Elements (pure black) ─── */
[data-theme="dark"] .tool-article h2,
[data-theme="dark"] .tool-article h3,
[data-theme="dark"] .section-title,
[data-theme="dark"] .detail-title,
[data-theme="dark"] .fp-cat-title,
[data-theme="dark"] .fp-cats-hero h1,
[data-theme="dark"] .sponsor-plan-name,
[data-theme="dark"] .sponsor-price,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 {
    color: #ffffff;
}
[data-theme="dark"] .tool-article p,
[data-theme="dark"] .tool-desc,
[data-theme="dark"] .fp-cat-subs a,
[data-theme="dark"] .tool-name,
[data-theme="dark"] .sponsor-features li {
    color: #d4d4d4;
}
[data-theme="dark"] .pro-footer {
    background: #000000;
    border-top-color: #1a1a1a;
}
[data-theme="dark"] .pro-footer a {
    color: #a3a3a3;
}
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #000000 100%) !important;
}
[data-theme="dark"] .hero h2 { color: #ffffff; }
[data-theme="dark"] .hero p { color: #a3a3a3; }
[data-theme="dark"] .hero-seo-line { color: #737373 !important; }
[data-theme="dark"] .hero-search {
    background: #0a0a0a;
    border-color: #1a1a1a;
}
[data-theme="dark"] .hero-search input {
    background: #0a0a0a;
    color: #ffffff;
}
[data-theme="dark"] .hero-search input::placeholder { color: #525252; }
[data-theme="dark"] .main-cat-chip {
    background: #0a0a0a;
    border-color: #1a1a1a;
    color: #d4d4d4;
}
[data-theme="dark"] .main-cat-chip.all-cats-link {
    background: #4c1d95;
    color: #7dd3fc;
    border-color: #4c1d95;
}
[data-theme="dark"] .main-cat-chip.active {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
}
[data-theme="dark"] .news-ticker {
    background: #000000;
    border-bottom-color: #1a1a1a;
}
[data-theme="dark"] .news-ticker-item {
    color: #d4d4d4;
    border-right-color: #1a1a1a;
}
[data-theme="dark"] .news-ticker-item:hover {
    background: rgba(168, 85, 247, 0.15);
    color: #fff;
}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #0a0a0a;
    color: #ffffff;
    border-color: #1a1a1a;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #525252; }
[data-theme="dark"] .empty { color: #a3a3a3; }
[data-theme="dark"] .pricing-badge.free { background: #052e16; color: #6ee7b7; }
[data-theme="dark"] .pricing-badge.freemium { background: #4c1d95; color: #67e8f9; }
[data-theme="dark"] .pricing-badge.paid { background: #7c2d12; color: #fdba74; }
[data-theme="dark"] .pricing-badge.open-source { background: #581c87; color: #d8b4fe; }
[data-theme="dark"] .tool-card { background: #0a0a0a; border-color: #1a1a1a; }
[data-theme="dark"] .tool-card:hover { border-color: #a855f7; }
[data-theme="dark"] .tool-views { color: #737373; }
[data-theme="dark"] .tool-desc { color: #a3a3a3; }
[data-theme="dark"] .pagination a {
    background: #0a0a0a;
    color: #d4d4d4;
    border-color: #1a1a1a;
}
[data-theme="dark"] .pagination a.active {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
}
[data-theme="dark"] .fp-cats-wrap {
    background: #000000 !important;
}
[data-theme="dark"] .fp-cats-hero p { color: #a3a3a3; }
[data-theme="dark"] .fp-cat-image-wrap {
    background: #0a0a0a;
}
[data-theme="dark"] .fp-cat-image-placeholder {
    background: #0a0a0a;
}
[data-theme="dark"] .fp-cat-subs .count { color: #737373; }
[data-theme="dark"] .fp-cat-show-all a { color: #a855f7; }
[data-theme="dark"] .filter-bar { background: #0a0a0a; }
[data-theme="dark"] .filter-tab {
    background: #0a0a0a;
    color: #d4d4d4;
    border-color: #1a1a1a;
}
[data-theme="dark"] .filter-tab.active {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
}
[data-theme="dark"] .sponsor-hero {
    background: linear-gradient(135deg, #000000, #0a0a0a);
    border-bottom: 1px solid #1a1a1a;
}
[data-theme="dark"] .sponsor-card.popular { border-color: #a855f7; }
[data-theme="dark"] .sponsor-note { color: #525252; }
[data-theme="dark"] .screenshot-frame,
[data-theme="dark"] .screenshot-browser-bar { background: #0a0a0a; border-color: #1a1a1a; }
[data-theme="dark"] .screenshot-url-bar { background: #000; color: #a3a3a3; border-color: #1a1a1a; }
[data-theme="dark"] .rating-widget { background: #0a0a0a; }
[data-theme="dark"] .recent-section { background: #0a0a0a; border-color: #1a1a1a; }
[data-theme="dark"] .recent-card { background: #0a0a0a; border-color: #1a1a1a; }
[data-theme="dark"] .trending-card { background: #0a0a0a; border-color: #1a1a1a; }
[data-theme="dark"] .trending-rank { color: #1a1a1a; }
[data-theme="dark"] .trending-card .tool-name { color: #fff; }
[data-theme="dark"] .related-post { background: #0a0a0a; border-color: #1a1a1a; }
[data-theme="dark"] .article-content p,
[data-theme="dark"] .article-content li { color: #d4d4d4; }
[data-theme="dark"] .article-content blockquote { background: #0a0a0a; color: #a3a3a3; }
[data-theme="dark"] .article-content pre { background: #000; }
[data-theme="dark"] .comments-section-title { color: #fff; }
[data-theme="dark"] .comment-item { background: #0a0a0a; border-color: #1a1a1a; }
[data-theme="dark"] .comment-content { color: #d4d4d4; }
[data-theme="dark"] .comment-form input,
[data-theme="dark"] .comment-form textarea {
    background: #000;
    color: #fff;
    border-color: #1a1a1a;
}
[data-theme="dark"] .site-newsletter-widget { background: #0a0a0a; color: #fff; }
[data-theme="dark"] .site-newsletter-widget p { color: #a3a3a3; }
[data-theme="dark"] .site-newsletter-close { background: #1a1a1a; color: #a3a3a3; }
[data-theme="dark"] .site-newsletter-form input {
    background: #000; color: #fff; border-color: #1a1a1a;
}
[data-theme="dark"] .compare-section { background: #0a0a0a; border-color: #1a1a1a; }
[data-theme="dark"] #compareBar { background: #0a0a0a; border-top-color: #a855f7; }

/* ─── Dark Mode — Override ALL blue/gradient backgrounds (pure black) ─── */
[data-theme="dark"] .hero {
    background: #000000 !important;
}
[data-theme="dark"] .hero::before {
    background: none !important;
}
[data-theme="dark"] .fp-cats-wrap {
    background: #000000 !important;
}
[data-theme="dark"] .fp-cats-hero {
    background: #000000 !important;
}
[data-theme="dark"] .fp-cat-image-wrap {
    background: #0a0a0a !important;
}
[data-theme="dark"] .fp-cat-image-placeholder {
    background: #0a0a0a !important;
}
[data-theme="dark"] .main-cat-chip.all-cats-link {
    background: #4c1d95 !important;
    color: #7dd3fc !important;
}
[data-theme="dark"] .news-ticker-label {
    background: linear-gradient(135deg, #a855f7, #ec4899);
}
[data-theme="dark"] .news-ticker {
    background: #000 !important;
    border-bottom-color: #1a1a1a;
}
[data-theme="dark"] .tool-card-head .tool-icon-placeholder {
    background: #0a0a0a;
}
[data-theme="dark"] .detail-cover {
    background: #0a0a0a;
}
[data-theme="dark"] .related-card {
    background: #0a0a0a;
}
[data-theme="dark"] .related-card img {
    background: #0a0a0a;
}
[data-theme="dark"] .stat-card {
    border: 1px solid #1a1a1a;
}
[data-theme="dark"] table {
    color: #d4d4d4;
}
[data-theme="dark"] table th {
    background: #0a0a0a;
    color: #fff;
    border-color: #1a1a1a;
}
[data-theme="dark"] table td {
    border-color: #1a1a1a;
    color: #d4d4d4;
}
[data-theme="dark"] table tr:hover td {
    background: #0a0a0a;
}
[data-theme="dark"] .flash-msg {
    background: #0a0a0a !important;
    border: 1px solid #1a1a1a;
}
[data-theme="dark"] .breadcrumbs {
    color: #737373;
}
[data-theme="dark"] .breadcrumbs a {
    color: #a855f7;
}
[data-theme="dark"] .breadcrumbs .sep {
    color: #404040;
}
[data-theme="dark"] .sponsor-hero {
    background: linear-gradient(135deg, #000, #0a0a0a) !important;
}
[data-theme="dark"] .sponsor-card {
    background: #0a0a0a;
    border-color: #1a1a1a;
}
[data-theme="dark"] .sponsor-card.popular {
    border-color: #a855f7;
}
[data-theme="dark"] .sponsor-features li {
    color: #d4d4d4;
}
[data-theme="dark"] .sponsor-btn-secondary {
    background: #1a1a1a;
    color: #fff;
}
[data-theme="dark"] .bg-particles {
    background: #000 !important;
}
[data-theme="dark"] .particle {
    opacity: 0.1 !important;
}
[data-theme="dark"] .scroll-top-btn {
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.6);
}
[data-theme="dark"] #darkModeToggle {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .header-toggle {
    background: transparent;
    border-color: var(--border);
}
[data-theme="dark"] .header-toggle span {
    background: #fff;
}

/* ─── Dark Mode — Tool Detail Page (pure black) ─── */
[data-theme="dark"] .detail-wrap {
    background: #0a0a0a !important;
    border-color: #1a1a1a !important;
}
[data-theme="dark"] .detail-cover {
    background: #0a0a0a !important;
    border-color: #1a1a1a !important;
}
[data-theme="dark"] .detail-cover img {
    background: #0a0a0a !important;
}
[data-theme="dark"] .detail-panel {
    background: #0a0a0a !important;
}
[data-theme="dark"] .detail-title {
    color: #ffffff !important;
}
[data-theme="dark"] .detail-table td {
    border-bottom-color: #1a1a1a !important;
    color: #d4d4d4 !important;
}
[data-theme="dark"] .detail-table .label {
    color: #a3a3a3 !important;
}
[data-theme="dark"] .detail-visit-area {
    border-top-color: #1a1a1a !important;
}
[data-theme="dark"] .tool-article {
    border-top-color: #1a1a1a !important;
}
[data-theme="dark"] .tool-article h2,
[data-theme="dark"] .tool-article h3 {
    color: #ffffff !important;
}
[data-theme="dark"] .tool-article p {
    color: #d4d4d4 !important;
}
[data-theme="dark"] .tool-article li {
    color: #d4d4d4 !important;
}
[data-theme="dark"] .tool-article a {
    color: #a855f7 !important;
}
[data-theme="dark"] .tool-article blockquote {
    background: #0a0a0a !important;
    border-left-color: #a855f7 !important;
    color: #a3a3a3 !important;
}
[data-theme="dark"] .related-card {
    background: #0a0a0a !important;
    border-color: #1a1a1a !important;
}
[data-theme="dark"] .related-name {
    color: #ffffff !important;
}
[data-theme="dark"] .section-title {
    color: #ffffff !important;
}
[data-theme="dark"] .back-link {
    color: #a3a3a3 !important;
}
[data-theme="dark"] .breadcrumbs a {
    color: #a855f7 !important;
}
[data-theme="dark"] .breadcrumbs {
    color: #737373 !important;
}
[data-theme="dark"] .breadcrumbs .sep {
    color: #404040 !important;
}
[data-theme="dark"] .visit-btn {
    background: linear-gradient(135deg, #a855f7, #ec4899) !important;
}

/* ─── Dark Mode — Force ALL tool detail elements to black ─── */
[data-theme="dark"] .detail-wrap,
[data-theme="dark"] .detail-wrap *,
[data-theme="dark"] .detail-panel,
[data-theme="dark"] .detail-panel *,
[data-theme="dark"] .detail-table,
[data-theme="dark"] .detail-table tr,
[data-theme="dark"] .detail-table td,
[data-theme="dark"] .detail-cover,
[data-theme="dark"] .detail-cover img,
[data-theme="dark"] .detail-grid,
[data-theme="dark"] .tool-article,
[data-theme="dark"] .tool-article *,
[data-theme="dark"] .rating-widget,
[data-theme="dark"] .rating-widget *,
[data-theme="dark"] .related-grid,
[data-theme="dark"] .related-card,
[data-theme="dark"] .related-card * {
    background-color: #0a0a0a !important;
    border-color: #1a1a1a !important;
}
[data-theme="dark"] .detail-table td,
[data-theme="dark"] .detail-table .label,
[data-theme="dark"] .tool-article p,
[data-theme="dark"] .tool-article li,
[data-theme="dark"] .detail-wrap * {
    color: #d4d4d4 !important;
}
[data-theme="dark"] .detail-title,
[data-theme="dark"] .tool-article h2,
[data-theme="dark"] .tool-article h3,
[data-theme="dark"] .section-title {
    color: #ffffff !important;
}
[data-theme="dark"] .pricing-badge {
    color: #6ee7b7 !important;
}

/* ─── 3D Animated Hero Title ─── */
.hero-3d-title {
    font-size: 42px;
    font-weight: 900;
    margin: 0 0 6px;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 25%, #7c3aed 50%, #ec4899 75%, #a855f7 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease-in-out infinite, float3D 3s ease-in-out infinite;
    text-shadow: none;
    transform-style: preserve-3d;
    perspective: 600px;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes float3D {
    0%, 100% { transform: translateY(0) rotateX(0deg); }
    50% { transform: translateY(-4px) rotateX(5deg); }
}
.hero-subtitle {
    font-size: 16px;
    color: #a855f7;
    font-weight: 600;
    margin: 0 0 22px;
    animation: fadeInUp 0.8s ease-out;
}
[data-theme="dark"] .hero-3d-title {
    background: linear-gradient(135deg, #f472b6 0%, #22d3ee 25%, #a78bfa 50%, #22d3ee 75%, #f472b6 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .hero-subtitle { color: #7dd3fc; }
@media (max-width: 600px) {
    .hero-3d-title { font-size: 28px; }
    .hero-subtitle { font-size: 14px; }
}

/* ─── Animated Category Bar ─── */
.main-cats-bar {
    overflow: hidden;
    position: relative;
}
.main-cats-bar::after {
    display: none;
}
.main-cat-chip {
    animation: chipSlideIn 0.5s ease-out backwards;
}
.main-cat-chip:nth-child(1) { animation-delay: 0.05s; }
.main-cat-chip:nth-child(2) { animation-delay: 0.1s; }
.main-cat-chip:nth-child(3) { animation-delay: 0.15s; }
.main-cat-chip:nth-child(4) { animation-delay: 0.2s; }
.main-cat-chip:nth-child(5) { animation-delay: 0.25s; }
.main-cat-chip:nth-child(6) { animation-delay: 0.3s; }
.main-cat-chip:nth-child(7) { animation-delay: 0.35s; }
.main-cat-chip:nth-child(8) { animation-delay: 0.4s; }
.main-cat-chip:nth-child(9) { animation-delay: 0.45s; }
.main-cat-chip:nth-child(10) { animation-delay: 0.5s; }
.main-cat-chip:nth-child(11) { animation-delay: 0.55s; }
.main-cat-chip:nth-child(12) { animation-delay: 0.6s; }
.main-cat-chip:nth-child(13) { animation-delay: 0.65s; }
.main-cat-chip:nth-child(14) { animation-delay: 0.7s; }
.main-cat-chip:nth-child(15) { animation-delay: 0.75s; }
@keyframes chipSlideIn {
    from { opacity: 0; transform: translateY(15px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.main-cat-chip {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.main-cat-chip:hover {
    background: linear-gradient(135deg, #a855f7, #ec4899) !important;
    color: #fff !important;
    border-color: #a855f7 !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.3);
}
.main-cat-chip:hover .cat-count-badge {
    background: rgba(255,255,255,0.3);
    color: #fff;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Animated AIFinder Logo ─── */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 900;
    font-size: 22px;
    background: linear-gradient(135deg, #a855f7, #ec4899, #7c3aed);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logoGradient 4s ease-in-out infinite;
    letter-spacing: -0.5px;
}
@keyframes logoGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.logo-icon {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    animation: logoPulse 2.5s ease-in-out infinite;
    -webkit-text-fill-color: #fff;
    position: relative;
    overflow: hidden;
}
.logo-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
    animation: logoShine 3s ease-in-out infinite;
}
@keyframes logoPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 6px 25px rgba(168, 85, 247, 0.6); }
}
@keyframes logoShine {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}
[data-theme="dark"] .logo {
    background: linear-gradient(135deg, #f472b6, #22d3ee, #a78bfa);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .logo-icon {
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.6);
}
@media (max-width: 1024px) {
    .logo { font-size: 18px; }
    .logo-icon { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
}
@media (max-width: 600px) {
    .logo { font-size: 16px; }
    .logo-icon { width: 30px; height: 30px; font-size: 16px; }
}

/* ─── Quick Search Overlay (Ctrl+K) ─── */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}
.search-overlay.active { display: flex; }
.search-overlay-box {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}
[data-theme="dark"] .search-overlay-box { background: #0a0a0a; }
.search-overlay-input {
    width: 100%;
    padding: 20px 24px;
    border: none;
    font-size: 18px;
    outline: none;
    background: transparent;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
}
[data-theme="dark"] .search-overlay-input { color: #fff; border-bottom-color: #1a1a1a; }
.search-overlay-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}
.search-overlay-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.search-overlay-result:hover { background: #faf5ff; }
[data-theme="dark"] .search-overlay-result:hover { background: #1a1a1a; }
.search-overlay-result img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.search-overlay-result-name { font-weight: 600; font-size: 14px; }
.search-overlay-result-desc { font-size: 12px; color: #64748b; }
.search-overlay-hint {
    padding: 12px 24px;
    font-size: 12px;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
[data-theme="dark"] .search-overlay-hint { border-top-color: #1a1a1a; }

/* ─── Verified Badge ─── */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #a855f7;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ─── View Count Animation ─── */
.tool-views-animated {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}
.tool-views-animated.counting {
    color: #a855f7;
    font-weight: 700;
}

/* ============================================================
   EXPLORE PAGE — TABBED WIDGET
   (Popular Tools / Recently Added / Popular Articles)
   All data behind this widget is live from the database, so it
   updates automatically whenever tools or articles are added.
   ============================================================ */
.exp-tabs-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 32px;
}
.exp-tabs {
    display: flex;
    gap: 28px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 18px;
    overflow-x: auto;
}
.exp-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 2px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    position: relative;
    font-family: inherit;
}
.exp-tab .exp-tab-badge {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 10px;
    padding: 2px 7px;
    margin-left: 2px;
}
.exp-tab.active { color: var(--accent); }
.exp-tab.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}
.exp-panel { display: none; flex-direction: column; gap: 10px; }
.exp-panel.active { display: flex; }
.exp-empty { color: var(--muted); font-size: 14px; padding: 20px 4px; }
.exp-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}
.exp-row:hover { background: var(--bg-alt); text-decoration: none; }
.exp-row-icon-wrap { position: relative; flex-shrink: 0; }
.exp-row-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 1px solid var(--border);
}
.exp-verified {
    position: absolute;
    top: -4px; right: -4px;
    width: 18px; height: 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card);
    font-size: 10px;
    line-height: 1;
}
.exp-row-body { flex: 1; min-width: 0; }
.exp-row-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.exp-row-desc {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.exp-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.exp-tag { font-size: 12px; color: var(--primary); font-weight: 600; }
.exp-stats { display: flex; gap: 8px; flex-shrink: 0; }
.exp-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 52px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.exp-stat-box.up { color: var(--success); }
button.exp-stat-box {
    background: var(--bg, #fff);
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
button.exp-stat-box:hover { transform: translateY(-2px); border-color: var(--primary); }
button.exp-stat-box:active { transform: translateY(0); }
button.exp-stat-box.exp-save-btn.active { background: #fdf2f8; border-color: #ec4899; color: #ec4899; }
button.exp-stat-box.exp-vote-btn.active { background: #ecfdf5; border-color: var(--success); color: var(--success); }
button.exp-stat-box[disabled] { opacity: 0.6; cursor: wait; }
[data-theme="dark"] .exp-tabs-wrap { background: #0a0a0a; border-color: #1a1a1a; }
[data-theme="dark"] .exp-row-icon { background: #111; border-color: #1a1a1a; }
[data-theme="dark"] .exp-stat-box { border-color: #1a1a1a; }
[data-theme="dark"] button.exp-stat-box { background: #0a0a0a; }
[data-theme="dark"] button.exp-stat-box.exp-save-btn.active { background: #2a0f1e; }
[data-theme="dark"] button.exp-stat-box.exp-vote-btn.active { background: #0a2318; }
[data-theme="dark"] .exp-verified { border-color: #0a0a0a; }
@media (max-width: 640px) {
    .exp-row-desc { display: none; }
    .exp-row-icon { width: 42px; height: 42px; }
    .exp-stat-box { min-width: 42px; padding: 5px 7px; font-size: 12px; }
}

/* ============================================================
   ANIME MASCOT + SVG DECOR — hero illustration & floating sparkles
   ============================================================ */
.hero { overflow: visible; }

.hero-mascot-wrap {
  position: absolute;
  top: 50%;
  right: clamp(6px, 4vw, 60px);
  transform: translateY(-50%);
  width: clamp(120px, 13vw, 190px);
  pointer-events: none;
  animation: mascotBob 4.5s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(124, 58, 237, 0.28));
}
.hero-mascot-wrap svg { width: 100%; height: auto; display: block; }

@keyframes mascotBob {
  0%, 100% { transform: translateY(-50%) rotate(0deg); }
  50%      { transform: translateY(calc(-50% - 10px)) rotate(-2deg); }
}

.mascot-sparkle { transform-origin: center; animation: mascotTwinkle 2.4s ease-in-out infinite; }
.mascot-sparkle-a { animation-delay: 0s; }
.mascot-sparkle-b { animation-delay: 0.8s; }
.mascot-sparkle-c { animation-delay: 1.5s; }
@keyframes mascotTwinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.7); }
  50%      { opacity: 1;    transform: scale(1.15); }
}

.mascot-antenna-tip { transform-origin: 110px 22px; animation: mascotGlow 1.8s ease-in-out infinite; }
@keyframes mascotGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.25); }
}

.mascot-blink { animation: mascotBlink 5s ease-in-out infinite; transform-origin: 110px 86px; }
@keyframes mascotBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(0.1); }
}

.mascot-arm-right { animation: mascotWave 2.6s ease-in-out infinite; transform-origin: 168px 160px; }
@keyframes mascotWave {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-8deg); }
}

/* Ambient floating sparkles scattered around the hero */
.hero-sparkles { position: absolute; inset: 0; overflow: visible; pointer-events: none; z-index: 0; }
.hero-sparkle {
  position: absolute;
  opacity: 0.8;
  animation: sparkleFloat linear infinite;
}
.hero-sparkle-1 { top: 12%;  left: 6%;  width: 16px; animation-duration: 7s; }
.hero-sparkle-2 { top: 68%;  left: 14%; width: 10px; animation-duration: 9s;  animation-delay: 1.2s; }
.hero-sparkle-3 { top: 22%;  left: 88%; width: 12px; animation-duration: 8s;  animation-delay: 0.6s; }
.hero-sparkle-4 { top: 78%;  left: 92%; width: 14px; animation-duration: 10s; animation-delay: 2s; }
@keyframes sparkleFloat {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 0.4; }
  50%  { transform: translateY(-18px) rotate(180deg); opacity: 1; }
  100% { transform: translateY(0) rotate(360deg);   opacity: 0.4; }
}

@media (max-width: 900px) {
  .hero-mascot-wrap { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mascot-wrap,
  .mascot-sparkle,
  .mascot-antenna-tip,
  .mascot-blink,
  .mascot-arm-right,
  .hero-sparkle,
  .hero-3d-title,
  .logo,
  .logo-icon {
    animation: none !important;
  }
}



/* ============================================================
   NAV LINK ICONS — animated header navigation (v29)
   ============================================================ */
.header-nav a.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-ico {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-ico svg { width: 100%; height: 100%; }
.header-nav a.nav-link:hover .nav-ico { transform: scale(1.2) rotate(-8deg); }
.header-nav a.nav-link.active .nav-ico { transform: scale(1.1); }
.nav-link-cta {
  background: linear-gradient(135deg, #0ea5e9, #2563eb) !important;
  color: #fff !important;
}
.nav-link-cta .nav-ico { color: #fff; }
@media (max-width: 900px) {
  .nav-label { display: none; }
  .header-nav a.nav-link { padding: 8px 10px; }
}
@media (max-width: 768px) {
  .nav-label { display: inline; }
  .header-nav a.nav-link { padding: 11px 12px; }
}

/* ============================================================
   AI BRAND ORB STRIP — floating animated logos under hero search
   ============================================================ */
.ai-orb-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin: 28px auto 4px;
  max-width: 760px;
}
.ai-orb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--orb-color, #6366f1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  cursor: pointer;
  animation: orb-float 3.2s ease-in-out infinite;
  animation-delay: var(--orb-delay, 0s);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}
.ai-orb svg { width: 22px; height: 22px; }
.ai-orb:hover {
  transform: scale(1.22) translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
  animation-play-state: paused;
}
.ai-orb:active { transform: scale(0.94); }
.ai-orb-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}
.ai-orb:hover .ai-orb-label { opacity: 1; transform: translateX(-50%) translateY(0); }
@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@media (max-width: 600px) {
  .ai-orb-strip { gap: 10px; }
  .ai-orb { width: 36px; height: 36px; }
  .ai-orb svg { width: 18px; height: 18px; }
}

/* ============================================================
   CATEGORY CHIP INTERACTION — pop/ripple on click
   ============================================================ */
.cat-chip-anim .cat-svg-icon-wrap svg { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cat-chip-anim:hover .cat-svg-icon-wrap svg { transform: scale(1.25) rotate(-6deg); }
.cat-chip-anim:active .cat-svg-icon-wrap svg { transform: scale(0.9); }

/* ============================================================
   FOOTER — professional redesign (wave, trust strip, newsletter, socials)
   ============================================================ */
.footer-wave { line-height: 0; margin-bottom: -1px; }
.footer-wave svg { width: 100%; height: 40px; display: block; }
.footer-wave svg path { fill: #0f172a; }
.pro-footer .footer-trust {
  background: #0b1220;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.footer-trust-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  padding: 16px 0;
}
.trust-item {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.trust-ico { font-size: 15px; }
.footer-brand-icon { display: inline-block; animation: brand-bounce 2.6s ease-in-out infinite; }
@keyframes brand-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(6deg); }
}
.footer-socials { display: flex; gap: 10px; margin-top: 14px; }
.footer-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.footer-social-btn svg { width: 16px; height: 16px; }
.footer-social-btn:hover {
  background: #10b981;
  color: #fff;
  transform: translateY(-3px) scale(1.1);
}
@media (max-width: 700px) {
  .footer-newsletter-card { padding: 28px 20px; border-radius: 16px; }
  .footer-newsletter-form input { flex: 1 1 100%; }
  .footer-newsletter-form button { flex: 1 1 100%; }
}

/* ============================================================
   TOOL DETAIL PAGE — info card grid (replaces plain table)
   ============================================================ */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.detail-info-card {
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.detail-info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.detail-info-card .dic-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-info-card .dic-value { font-size: 14px; font-weight: 600; color: var(--text); }
.detail-description-card {
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 4px;
  line-height: 1.7;
  color: var(--text);
}
[data-theme="dark"] .detail-info-card,
[data-theme="dark"] .detail-description-card { background: #111827; border-color: #1f2937; }

/* ============================================================
   RTL SUPPORT — Arabic language layout mirroring
   ============================================================ */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    font-family: 'Tajawal', 'Cairo', 'Inter', -apple-system, sans-serif;
}
html[dir="rtl"] * {
    letter-spacing: 0 !important;
}

/* Language switch button (in header, next to dark mode toggle) */
.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--bg-alt, #f1f5f9);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
    margin-inline-end: 6px;
}
.lang-switch-btn:hover {
    background: var(--primary, #10b981);
    color: #fff;
    border-color: var(--primary, #10b981);
    text-decoration: none;
}
[data-theme="dark"] .lang-switch-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

/* Header: logo icon spacing flips naturally with flex, but force gap consistency */
html[dir="rtl"] .logo { flex-direction: row; }

/* Text alignment overrides for explicit left/right */
html[dir="rtl"] .footer-features,
html[dir="rtl"] .sponsor-features { text-align: right; }
html[dir="rtl"] .sponsor-features li::before { margin-right: 0; margin-left: 8px; }

/* Breadcrumbs / back links: chevrons already swapped via is_rtl() in PHP,
   but flex row order needs no change since flexbox auto-mirrors in RTL */

/* Scroll-to-top button: sits on the opposite side in RTL */
html[dir="rtl"] .scroll-top-btn {
    right: auto;
    left: 24px;
}

/* Hero / search: input direction stays natural (auto) so mixed EN/AR queries type correctly */
html[dir="rtl"] .hero-search input[type="search"] { direction: rtl; text-align: right; }
html[dir="rtl"] .hero-search input[type="search"]:placeholder-shown { text-align: right; }

/* Forms: labels & inputs align right, but keep LTR fields (email/url) visually sane */
html[dir="rtl"] label { text-align: right; }
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"] { direction: ltr; text-align: right; }

/* Tables: header/cell text follows RTL naturally via inherited text-align */
html[dir="rtl"] table th,
html[dir="rtl"] table td { text-align: right; }

/* Sidebars / grids using CSS grid ignore `dir` for track order by default —
   force reverse on the few multi-column grids where left-to-right order reads oddly */
html[dir="rtl"] .footer-grid,
html[dir="rtl"] .detail-info-grid { direction: rtl; }

/* Icons that visually imply direction (arrows inside buttons) are already
   swapped at the PHP layer via is_rtl() ? '→' : '←' — no CSS mirroring needed */

/* Dropdown / mobile nav slide direction */
@media (max-width: 768px) {
    html[dir="rtl"] .header-nav.mobile-open { right: auto; left: 0; }
}

/* Pricing badges / chips: keep gap consistent (flex already mirrors) */
html[dir="rtl"] .tool-footer-left { flex-direction: row-reverse; }

/* Arabic-friendly line-height bump for readability */
html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] .tool-desc,
html[dir="rtl"] .detail-description-card {
    line-height: 1.9;
}
