/* ============================================
   TOOLIEST.COM — Design System
   Premium Dark Mode + Glassmorphism
   ============================================ */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* === CSS Variables (Design Tokens) === */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-card: rgba(26, 26, 46, 0.6);
  --bg-card-hover: rgba(36, 36, 66, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-tertiary: #6b6b80;
  --text-accent: #8b5cf6;
  
  --accent-primary: #8b5cf6;
  --accent-secondary: #06b6d4;
  --accent-tertiary: #f43f5e;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  
  --gradient-primary: linear-gradient(135deg, #8b5cf6, #06b6d4);
  --gradient-secondary: linear-gradient(135deg, #f43f5e, #f59e0b);
  --gradient-accent: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --gradient-bg: linear-gradient(180deg, #0a0a0f 0%, #12121a 50%, #1a1a2e 100%);
  --gradient-card: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.05));
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(139, 92, 246, 0.3);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
  --shadow-glow-hover: 0 0 30px rgba(139, 92, 246, 0.25);
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Sizing */
  --max-width: 1400px;
  --nav-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background ambient effects */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 50% 50%, rgba(244, 63, 94, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

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

a:hover {
  color: var(--accent-secondary);
}

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

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* === Navigation === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  transition: background var(--transition-base);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.95);
  box-shadow: var(--shadow-md);
}

.nav-inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
}

.nav-logo .logo-text span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.nav-search input[type="text"], .nav-search input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 44px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-base);
}

.nav-search input::placeholder {
  color: var(--text-tertiary);
}

.nav-search input:focus {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.nav-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 1rem;
  pointer-events: none;
}

.nav-search .search-shortcut {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.nav-cta {
  background: var(--gradient-primary) !important;
  color: white !important;
  font-weight: 600 !important;
  padding: 8px 20px !important;
  box-shadow: var(--shadow-glow);
}

.nav-cta:hover {
  box-shadow: var(--shadow-glow-hover) !important;
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.mobile-search-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  margin-right: 8px;
}

/* Mobile Search Overlay */
#mobile-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--bg-primary);
  padding: 16px;
  flex-direction: column;
  animation: fadeInDown 0.25s ease;
}

#mobile-search-overlay.open {
  display: flex;
}

.mobile-search-inner {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding-top: 8px;
}

.mobile-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

#mobile-search-results .search-result-item:first-child {
  border-top: none;
}

/* === Main Content === */
.main-content {
  padding-top: var(--nav-height);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* === Hero Section === */
.hero {
  padding: 80px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-primary);
  margin-bottom: 24px;
  animation: fadeInDown 0.6s ease;
}

.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero h1 .gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 36px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  animation: fadeInUp 0.6s ease 0.4s both;
}

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

.hero-stat .stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat .stat-label {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* === Container === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* === Category Section === */
.categories-section {
  padding: 40px 24px 20px;
}

.category-tabs {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: var(--font-primary);
  white-space: nowrap;
}

.category-tab:hover {
  border-color: var(--border-accent);
  background: rgba(139, 92, 246, 0.05);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.category-tab.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-glow);
}

.category-tab .tab-count {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 600;
}

.category-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

/* === Tools Grid === */
.tools-section {
  padding: 20px 24px 80px;
}

.tools-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* === Tool Card === */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.tool-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
}

.tool-card-info h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  padding-right: 36px;
}

.tool-card-info .tool-category-label {
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 500;
}

.tool-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tool-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

/* === Favorite Button === */
.fav-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
  z-index: 2;
  padding: 0;
  line-height: 1;
}

.fav-btn:hover {
  transform: scale(1.1);
  color: #fbbf24;
  border-color: #fbbf24;
  background: var(--bg-primary);
}

.fav-btn.active {
  color: #fbbf24;
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

.tool-tag {
  padding: 3px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.tool-card .ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* === Tool Page === */
.tool-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.tool-page-header {
  margin-bottom: 32px;
}

.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.tool-breadcrumb a {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.tool-breadcrumb a:hover {
  color: var(--accent-primary);
}

.tool-breadcrumb .separator {
  color: var(--text-tertiary);
}

.tool-page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.tool-page-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* Tool workspace */
.tool-workspace {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tool-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-glass);
}

.tool-workspace-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.tool-workspace-body {
  padding: 24px;
}

.tool-workspace-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-glass);
}

/* === Form Elements === */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

textarea,
input[type="text"],
input[type="number"],
input[type="url"],
input[type="email"],
select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-base);
  resize: vertical;
}

textarea {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 150px;
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a0b8' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow-hover);
  transform: translateY(-2px);
}

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

.btn-secondary:hover {
  border-color: var(--border-accent);
  background: rgba(139, 92, 246, 0.05);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

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

/* === Output Area === */
.output-area {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 100px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  position: relative;
}

.output-area.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-family: var(--font-primary);
  font-style: italic;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-primary);
}

.copy-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.copy-btn.copied {
  background: var(--accent-success);
  color: white;
  border-color: var(--accent-success);
}

/* === Results Stats === */
.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.stat-card .stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.stat-card .stat-lbl {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

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

.color-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.color-value-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.color-value-item span:first-child {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.color-value-item span:last-child {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* === Toggle === */
.toggle-group {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.toggle-option {
  flex: 1;
  padding: 10px 16px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  font-family: var(--font-primary);
}

.toggle-option.active {
  background: var(--accent-primary);
  color: white;
}

.toggle-option:hover:not(.active) {
  background: var(--bg-glass-hover);
}

/* === Range Slider === */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
  transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* === Checkbox / Radio === */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-label input {
  display: none;
}

.checkbox-label .checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 0.7rem;
  color: transparent;
}

.checkbox-label input:checked + .checkmark {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* === Ad Placeholder === */
.ad-space {
  background: var(--bg-glass);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  margin: 24px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Related Tools === */
.related-tools {
  margin-top: 48px;
}

.related-tools h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

/* === Footer === */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 24px 30px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.footer-brand h3 span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: var(--text-tertiary);
  font-size: 0.88rem;
  transition: color var(--transition-fast);
}

.footer-col ul li a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* === Search Results Page === */
.search-results {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.search-results h2 {
  margin-bottom: 24px;
}

.search-result-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: padding-left var(--transition-fast);
}

.search-result-item:hover {
  padding-left: 12px;
}

.search-result-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.search-result-item p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* === Toast Notification === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-spring);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

/* === Loading Skeleton === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-in {
  animation: fadeInUp 0.5s ease both;
}

/* Stagger animation for grids */
.tools-grid .tool-card:nth-child(1) { animation-delay: 0.02s; }
.tools-grid .tool-card:nth-child(2) { animation-delay: 0.04s; }
.tools-grid .tool-card:nth-child(3) { animation-delay: 0.06s; }
.tools-grid .tool-card:nth-child(4) { animation-delay: 0.08s; }
.tools-grid .tool-card:nth-child(5) { animation-delay: 0.10s; }
.tools-grid .tool-card:nth-child(6) { animation-delay: 0.12s; }
.tools-grid .tool-card:nth-child(7) { animation-delay: 0.14s; }
.tools-grid .tool-card:nth-child(8) { animation-delay: 0.16s; }
.tools-grid .tool-card:nth-child(9) { animation-delay: 0.18s; }
.tools-grid .tool-card { animation: fadeInUp 0.5s ease both; }

/* === File Upload === */
.file-upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-glass);
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.05);
}

.file-upload-zone .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.file-upload-zone p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.file-upload-zone .upload-hint {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* === Flex Utils === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* === PWA Install Banner === */
#pwa-install-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#pwa-install-banner.show {
  transform: translateY(0);
}

@media (min-width: 768px) {
  #pwa-install-banner {
    left: auto;
  }
}

/* === Responsive === */
@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
  }
  
  .nav-search {
    display: none;
  }
  
  .nav-links {
    display: none;
  }
  
  .nav-links.mobile-open {
    display: flex;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    background: var(--bg-primary); /* Replaced rgba with solid background to prevent overlap bugs */
    padding: 24px;
    gap: 16px; /* Increased gap */
    z-index: 999;
    animation: fadeInDown 0.3s ease;
    border-top: 1px solid var(--border-color);
  }
  
  .nav-links.mobile-open a {
    padding: 16px 20px;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    text-align: center;
  }
  
  .mobile-menu-btn {
    display: flex;
  }

  .mobile-search-btn {
    display: flex;
  }
  
  .hero {
    padding: 50px 16px 40px;
  }
  
  .hero-stats {
    gap: 24px;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .tool-page {
    padding: 24px 16px 60px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .category-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }
}

/* === Print Styles === */
@media print {
  .navbar, .site-footer, .ad-space, .category-tabs {
    display: none !important;
  }
  
  .main-content {
    padding-top: 0;
  }
  
  body {
    background: white;
    color: black;
  }
}
