:root {
  /* Default Dark Theme / Vercel/Linear inspired */
  --bg-color: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #111111;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #ededed;
  --text-secondary: #a1a1aa;
  --accent-color: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.2);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --transition: all 0.2s ease;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme='light'] {
  --bg-color: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent-color: #000000;
  --accent-glow: rgba(0, 0, 0, 0.1);
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
}

html {
  /* Navbar is ~60-70px tall — stop anchor scrolls from hiding behind it */
  scroll-padding-top: var(--navbar-h, 70px);
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: var(--navbar-h, 64px);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button:active,
.tool-card:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
  /* Safe area insets for Capacitor/iOS */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  /* App-like smooth scrolling */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  body {
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior-y: none;
  }
}

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

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(var(--bg-primary-rgb), 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
  /* Extend behind iOS notch/status bar */
  padding-top: env(safe-area-inset-top, 0px);
}

@media (max-width: 768px) {
  .navbar {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
}

/* App Download Banner */
.app-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1005;
  /* Must sit above navbar (1000) */
  transition: all 0.3s ease;
  /* Accommodate iOS notch over banner */
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
}

/* Push navbar down when banner is present based on JS active class */
body.has-banner .navbar {
  top: var(--banner-h, 60px);
}

.app-banner.hidden {
  display: none !important;
}

.app-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.app-banner-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-banner-icon svg {
  width: 20px;
  height: 20px;
  color: var(--text-primary);
}

.app-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-banner-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-banner-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.app-banner-btn {
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.app-banner-btn:active {
  transform: scale(0.95);
}

.app-banner-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.4rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.app-banner-close svg {
  width: 16px;
  height: 16px;
}

@media (min-width: 769px) {
  .app-banner {
    display: none !important;
  }
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  z-index: 1001;
}

.mobile-menu-toggle:hover {
  background: var(--bg-card);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.logo svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent-color);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  transition: transform 0.3s ease;
}

.nav-links.mobile-open {
  transform: translateX(0);
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

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

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 6rem 2rem 4rem;
  text-align: center;
  overflow: hidden;
  padding-top: calc(6rem + env(safe-area-inset-top, 0px));
}

.hero-subtitle {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.hero-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.search-container {
  position: relative;
  max-width: 600px;
  margin: 2rem auto;
}

.search-container input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1.1rem;
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  min-height: 48px;
}

@media (max-width: 640px) {
  .search-container input {
    font-size: 15px;
    /* Prevents zoom on iOS */
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 20px;
    background: var(--bg-tertiary);
  }

  .search-icon {
    left: 1rem;
    width: 18px;
    height: 18px;
  }
}

.search-container input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  width: 20px;
  height: 20px;
}

.hero-bg {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1.5rem;
  color: var(--text-secondary);
  width: 20px;
  height: 20px;
}

#search-input {
  width: 100%;
  padding: 1.25rem 1.25rem 1.25rem 3.5rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  outline: none;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 4px 24px var(--accent-glow);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 60vh;
  opacity: 1;
  visibility: visible;
}

.container.tool-page-container {
  /*
   * Navbar is fixed and overlaps safe-area on iOS.
   * We must add safe-area-inset-top + navbar content height + gap + banner.
   * --navbar-h is set by JS (measures only nav element height, ~56px).
   * --banner-h is set by JS when the app banner is visible.
   */
  padding-top: 100px;
  /* Fallback for browsers that reject complex calc */
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--navbar-h, 56px) + var(--banner-h, 0px) + 1.5rem);
  padding-bottom: 2rem;
  animation: fadeIn 0.3s ease;
}

@media (max-width: 768px) {
  .container.tool-page-container {
    padding-top: 96px;
    /* Fallback */
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--navbar-h, 56px) + var(--banner-h, 0px) + 1.25rem);
    padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Categories */
.categories-section {
  margin-bottom: 3rem;
}

.category-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
  /* Firefox */
  position: sticky;
  top: 70px;
  z-index: 90;
  background: linear-gradient(to bottom, var(--bg-color) 80%, transparent 100%);
  padding-top: 1rem;
}

.category-tabs::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.category-filters::-webkit-scrollbar {
  height: 4px;
}

.category-filters::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.category-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.75rem 1.25rem;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  touch-action: manipulation;
  white-space: nowrap;
}

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

.category-btn.active {
  background: var(--text-primary);
  color: var(--bg-color);
  border-color: var(--text-primary);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.category-btn:active {
  transform: scale(0.95);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  opacity: 1;
  visibility: visible;
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem;
  }

  .container {
    padding: 1rem 0;
  }
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  opacity: 1;
  transform: translateY(0);
  animation: slideInUp 0.3s ease backwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tool-card:nth-child(1) {
  animation-delay: 0.02s;
}

.tool-card:nth-child(2) {
  animation-delay: 0.04s;
}

.tool-card:nth-child(3) {
  animation-delay: 0.06s;
}

.tool-card:nth-child(4) {
  animation-delay: 0.08s;
}

.tool-card:nth-child(5) {
  animation-delay: 0.1s;
}

.tool-card:nth-child(6) {
  animation-delay: 0.12s;
}

.tool-card:nth-child(n+7) {
  animation-delay: 0.14s;
}

@media (max-width: 640px) {
  .tool-card {
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 0;
  }

  .tool-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }

  .tool-card:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
  }
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
  .tool-card:hover {
    transform: none;
  }

  .tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
  }
}

.tool-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

.open-affordance {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  color: var(--accent-color);
}

.tool-card:hover .open-affordance {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 640px) {
  .open-affordance {
    bottom: 1rem;
    right: 1rem;
    opacity: 0.6;
    transform: translateX(0);
  }

  .open-affordance svg {
    width: 18px;
    height: 18px;
  }
}

.favorite-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  backdrop-filter: blur(4px);
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 640px) {
  .favorite-btn {
    opacity: 1;
    width: 40px;
    height: 40px;
  }
}

.tool-card:hover .favorite-btn {
  opacity: 1;
}

.favorite-btn:hover {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
  border-color: #ec4899;
  transform: scale(1.1);
}

.favorite-btn.active {
  opacity: 1;
  color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
  border-color: #ec4899;
}

.favorite-btn.active svg {
  fill: #ec4899;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(var(--accent-color-rgb), 0.1);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

@media (max-width: 640px) {
  .tool-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
    border-radius: 10px;
  }

  .tool-icon svg {
    width: 18px;
    height: 18px;
  }
}

/* Category-specific icon tints */
.tool-icon[data-cat-id*="PDF"] {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.tool-icon[data-cat-id*="IMAGE"] {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.tool-icon[data-cat-id*="TEXT"] {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.tool-icon[data-cat-id*="DEV"] {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.tool-icon[data-cat-id*="CALC"] {
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.1);
}

.tool-icon[data-cat-id*="FUN"] {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

.tool-icon[data-cat-id*="VIDEO"] {
  color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
}

.tool-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.tool-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .tool-info h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }

  .tool-info p {
    font-size: 0.75rem;
    line-height: 1.5;
  }
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-secondary);
}

.no-results svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  stroke: var(--text-secondary);
}

.no-results h2 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.hidden {
  display: none !important;
}

/* Tool Specific Page */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 3rem;
  transition: var(--transition);
  padding: 0.5rem;
  margin-left: -0.5rem;
  border-radius: var(--radius-sm);
  min-height: 44px;
  touch-action: manipulation;
}

.back-link:hover {
  background: var(--bg-card);
}

@media (max-width: 640px) {
  .back-link {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-left: 0;
    /* ensure it's always visible below the fixed navbar */
    position: relative;
    z-index: 1;
  }

  .back-link:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
  }
}

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

.tool-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 4rem;
}

.tool-icon.large {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
}

.tool-icon.large svg {
  width: 36px;
  height: 36px;
}

.tool-header-info h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

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

.badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.tool-placeholder {
  background: var(--bg-card);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 6rem 2rem;
  text-align: center;
}

.placeholder-content {
  max-width: 500px;
  margin: 0 auto;
}

.icon-large {
  width: 48px;
  height: 48px;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.spin {
  animation: spin 4s linear infinite;
}

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

.placeholder-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.placeholder-content p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.notify-form {
  display: flex;
  gap: 0.5rem;
}

.notify-form input {
  flex: 1;
  padding: 0.875rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.notify-form input:focus {
  border-color: var(--accent-color);
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-color);
  border: none;
  padding: 0 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  padding: 3rem 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-brand svg {
  color: var(--text-secondary);
  width: 20px;
  height: 20px;
}

.footer-brand span {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

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

.privacy-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

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

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

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

/* Bottom Navigation Bar (Mobile App Style) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 0.625rem 0;
  padding-bottom: calc(0.625rem + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem 0.875rem;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  min-width: 55px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.bottom-nav-item span {
  font-size: 0.65rem;
  margin-top: 1px;
}

.bottom-nav-item.active {
  color: var(--text-primary);
}

.bottom-nav-item.active svg {
  stroke-width: 2.5;
}

.bottom-nav-item:active {
  transform: scale(0.9);
  transition: transform 0.1s ease;
}

.bottom-nav-item {
  position: relative;
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 0 0 3px 3px;
  opacity: 0.8;
}

@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }
}

/* App-like Section Headers */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0 1rem;
}

.section-header svg {
  width: 18px;
  height: 18px;
  color: var(--text-primary);
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.favorites-section {
  margin-bottom: 2rem;
}

.favorites-section .section-header svg {
  color: #ec4899;
}

/* Hero Mobile Styles */
.hero-header-mobile {
  display: none;
}

.hero-header-desktop {
  display: block;
}

.hero-subtitle-mobile {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-header-mobile {
    display: block;
  }

  .hero-header-desktop {
    display: none;
  }

  .hero-description {
    display: none;
  }

  .hero {
    padding: 1.5rem 1.25rem 1.25rem;
    padding-top: 5rem;
    /* Fallback for older browsers */
    padding-top: calc(1.5rem + var(--navbar-h, 56px) + var(--banner-h, 0px) + env(safe-area-inset-top, 0px));
  }

  .hero-content h1 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  .hero-subtitle-mobile {
    font-size: 0.8rem;
    margin-top: 0.25rem;
  }

  .hero-description {
    display: none;
  }

  .search-container {
    margin: 1.5rem auto 0;
  }

  .search-container input {
    font-size: 1rem;
    padding: 0.875rem 1.25rem 0.875rem 2.75rem;
  }

  .mobile-menu-toggle {
    display: none;
    /* Hide hamburger menu, use bottom nav instead */
  }

  /* Mobile menu is hidden, using bottom nav instead */
  .nav-links {
    display: none;
  }

  .mobile-menu-backdrop {
    display: none;
  }

  .nav-links a {
    font-size: 1.1rem;
    padding: 0.75rem 0;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links .icon-btn {
    margin-top: auto;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .tool-header {
    flex-direction: column;
    text-align: center;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
    padding: 0 1rem;
  }

  .tool-header-info h1 {
    font-size: 1.375rem;
    line-height: 1.3;
  }

  .tool-header-info p {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .tool-icon.large {
    width: 56px;
    height: 56px;
  }

  .tool-icon.large svg {
    width: 24px;
    height: 24px;
  }

  .notify-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .notify-form input {
    font-size: 16px;
    /* Prevents zoom on iOS */
    padding: 0.875rem;
    border-radius: 10px;
  }

  .btn-primary {
    padding: 1rem;
    width: 100%;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
  }

  .btn-primary:active {
    transform: scale(0.98);
  }

  .footer {
    padding: 2rem 1rem;
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
    margin-bottom: 0;
  }

  main.container {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    opacity: 1;
    min-height: 100vh;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
    padding: 0;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }

  .category-filters {
    justify-content: flex-start;
    padding: 0 1rem 0.75rem;
    gap: 0.625rem;
    -webkit-overflow-scrolling: touch;
  }

  .category-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.875rem;
    border-radius: 16px;
  }

  .categories-section {
    margin-bottom: 1.5rem;
    position: sticky;
    top: calc(60px + env(safe-area-inset-top, 0px));
    z-index: 50;
    background: var(--bg-color);
    padding-top: 0.75rem;
    margin-top: -0.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* App-like loading states */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.375rem;
  }

  .hero-subtitle-mobile {
    font-size: 0.75rem;
  }

  .nav-content {
    padding: 0.75rem 1rem;
  }

  .logo {
    font-size: 0.95rem;
    font-weight: 700;
  }

  .logo svg {
    width: 18px;
    height: 18px;
  }

  .navbar {
    padding: 0.75rem 1rem;
  }

  .tool-card {
    padding: 0.875rem;
    border-radius: 10px;
  }

  .tool-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 0.625rem;
  }

  .tool-icon svg {
    width: 16px;
    height: 16px;
  }

  .tool-info h3 {
    font-size: 0.85rem;
    margin-bottom: 0.375rem;
  }

  .tool-info p {
    font-size: 0.7rem;
  }

  .section-header h2 {
    font-size: 1.125rem;
  }

  .section-header svg {
    width: 16px;
    height: 16px;
  }

  .bottom-nav-item {
    padding: 0.5rem 0.625rem;
    min-width: 50px;
  }

  .bottom-nav-item svg {
    width: 18px;
    height: 18px;
  }

  .bottom-nav-item span {
    font-size: 0.6rem;
  }

  .category-btn {
    font-size: 0.7rem;
    padding: 0.45rem 0.75rem;
  }

  .tools-grid {
    gap: 0.875rem;
    padding: 0 0.875rem;
  }
}