/* ToolsHub — Main Stylesheet */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --accent: #06b6d4;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 10px 30px rgba(79,70,229,0.12), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --header-h: 68px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #1e293b;
  --border-hover: #334155;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
  --card-shadow-hover: 0 10px 30px rgba(79,70,229,0.2);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a { text-decoration: none; color: inherit; }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}
[data-theme="dark"] .site-header { background: rgba(15,23,42,0.9); }

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

.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; }
.logo-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1rem;
}
.logo-text { color: var(--text); font-weight: 500; }
.logo-text strong { color: var(--primary); font-weight: 700; }

.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.5rem 0.875rem; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.9375rem; font-weight: 500;
  transition: all var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); background: rgba(79,70,229,0.08); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--bg-secondary); color: var(--text); }

.btn-ghost {
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); color: var(--text);
  font-size: 0.9rem; font-weight: 500; transition: all var(--transition);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-primary {
  padding: 0.5rem 1.125rem; border-radius: var(--radius-sm);
  background: var(--primary); color: white;
  font-size: 0.9rem; font-weight: 600; transition: all var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.mobile-menu-btn {
  display: none; width: 36px; height: 36px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 1.2rem;
  align-items: center; justify-content: center;
}

/* Mobile Nav */
.mobile-nav {
  display: none; flex-direction: column; gap: 0.25rem;
  padding: 1rem 1.25rem 1.25rem;
  background: var(--bg); border-top: 1px solid var(--border);
  position: absolute; width: 100%; top: var(--header-h); left: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.mobile-nav.open { display: flex; }
.mobile-nav-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.btn-ghost.full, .btn-primary.full { flex: 1; text-align: center; }

/* ── Main Content ── */
.main-content { min-height: calc(100vh - var(--header-h) - 280px); }

/* ── Hero ── */
.hero {
  position: relative; overflow: hidden;
  padding: 5rem 0 4rem;
  background: var(--bg-secondary);
}
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79,70,229,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { text-align: center; position: relative; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 1rem; border-radius: 99px;
  background: rgba(79,70,229,0.1); color: var(--primary);
  font-size: 0.875rem; font-weight: 600; margin-bottom: 1.5rem;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.15;
  color: var(--text); margin-bottom: 1rem;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc { font-size: 1.125rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 2rem; }

.hero-search {
  display: flex; align-items: center; gap: 0.5rem;
  max-width: 600px; margin: 0 auto 2.5rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 0.5rem 0.5rem 0.5rem 1rem;
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition);
}
.hero-search:focus-within { border-color: var(--primary); }
.hero-search i { color: var(--text-muted); font-size: 1.125rem; flex-shrink: 0; }
.hero-search input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 0.9375rem;
}
.hero-search input::placeholder { color: var(--text-light); }
.hero-search button {
  padding: 0.5rem 1.25rem; background: var(--primary); color: white;
  border: none; border-radius: var(--radius-sm); font-size: 0.875rem;
  font-weight: 600; cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.hero-search button:hover { background: var(--primary-dark); }

.hero-stats { display: flex; align-items: center; justify-content: center; gap: 2rem; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat strong { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat span { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

/* ── Categories ── */
.categories-section { padding: 1.5rem 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.categories-scroll {
  display: flex; gap: 0.5rem; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem; border-radius: 99px; white-space: nowrap;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(79,70,229,0.05); }
.cat-btn.active { border-color: var(--primary); background: var(--primary); color: white; }

/* ── Tools Section ── */
.tools-section { padding: 3rem 0; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.tool-card {
  display: flex; align-items: flex-start; gap: 0.875rem;
  padding: 1.125rem; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--bg);
  transition: all var(--transition); position: relative;
  box-shadow: var(--card-shadow);
}
.tool-card:hover {
  border-color: var(--primary); box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}
.tool-icon {
  width: 44px; height: 44px; font-size: 1.375rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); border-radius: var(--radius-sm); flex-shrink: 0;
}
.tool-info { flex: 1; min-width: 0; }
.tool-info h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.25rem; }
.tool-info p { font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.premium-badge, .free-badge {
  position: absolute; top: 0.75rem; right: 0.75rem;
  font-size: 0.6875rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 99px;
}
.premium-badge { background: linear-gradient(135deg, #f59e0b, #ef4444); color: white; }
.free-badge { background: rgba(16,185,129,0.12); color: #059669; }

.tools-loading { grid-column: 1/-1; text-align: center; padding: 4rem; color: var(--text-muted); }
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite; margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.no-tools { grid-column: 1/-1; text-align: center; padding: 4rem; color: var(--text-muted); }

/* ── Pricing Preview ── */
.pricing-preview { padding: 5rem 0; background: var(--bg-secondary); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; margin-bottom: 0.5rem; }
.section-header p { color: var(--text-muted); font-size: 1.0625rem; }

.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem; max-width: 960px; margin: 0 auto;
}
.plan-card {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  position: relative; transition: all var(--transition);
  box-shadow: var(--card-shadow);
}
.plan-card.featured {
  border-color: var(--primary); box-shadow: 0 8px 32px rgba(79,70,229,0.15);
}
.plan-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: white;
  font-size: 0.75rem; font-weight: 700; padding: 0.3rem 1rem; border-radius: 99px;
  white-space: nowrap;
}
.plan-header { margin-bottom: 1.5rem; }
.plan-name { display: block; font-size: 1.0625rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.5rem; }
.plan-price strong { font-size: 2rem; font-weight: 800; color: var(--text); }
.plan-price span { font-size: 0.875rem; color: var(--text-muted); }
.plan-features { list-style: none; margin-bottom: 1.75rem; display: flex; flex-direction: column; gap: 0.625rem; }
.plan-features li { display: flex; align-items: center; gap: 0.625rem; font-size: 0.9rem; }
.plan-features li i { font-size: 1rem; color: #10b981; }
.plan-features li.disabled { color: var(--text-light); }
.plan-features li.disabled i { color: var(--text-light); }
.plan-btn {
  display: block; width: 100%; text-align: center;
  padding: 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 600; transition: all var(--transition); cursor: pointer;
}
.plan-btn.solid { background: var(--primary); color: white; }
.plan-btn.solid:hover { background: var(--primary-dark); transform: translateY(-1px); }
.plan-btn.outline { border: 1.5px solid var(--border); color: var(--text); }
.plan-btn.outline:hover { border-color: var(--primary); color: var(--primary); }

/* ── Features Section ── */
.features-section { padding: 5rem 0; }
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem;
}
.feature-card {
  padding: 1.75rem; border-radius: var(--radius); border: 1.5px solid var(--border);
  background: var(--bg); transition: all var(--transition); text-align: center;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.feature-icon {
  width: 56px; height: 56px; border-radius: var(--radius);
  background: rgba(79,70,229,0.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 1rem;
}
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* ── Footer ── */
.site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 3.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.6; }
.social-links { display: flex; gap: 0.5rem; }
.social-links a {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  transition: all var(--transition);
}
.social-links a:hover { border-color: var(--primary); color: var(--primary); background: rgba(79,70,229,0.08); }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.875rem; }
.footer-col a { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.5rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
  font-size: 0.8125rem; color: var(--text-muted); flex-wrap: wrap; gap: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .main-nav, .btn-ghost:not(.full), .btn-primary:not(.full) { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-stats { gap: 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1/-1; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .plans-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
}
