/*
 * AllCalculators.in — Main Stylesheet
 * Premium SaaS-quality design system
 * Font: Sora (display) + JetBrains Mono (code)
 */

/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */
:root {
  /* Colors - Light Mode */
  --bg-primary:     #ffffff;
  --bg-secondary:   #f8f7ff;
  --bg-card:        #ffffff;
  --bg-elevated:    #f1f0fe;
  --border-color:   #e5e3ff;
  --text-primary:   #0f0d1a;
  --text-secondary: #5b5779;
  --text-muted:     #9896b0;

  /* Brand */
  --brand-500:   #6366f1;
  --brand-600:   #4f46e5;
  --brand-400:   #818cf8;
  --brand-glow:  rgba(99, 102, 241, 0.2);
  --accent:      #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.15);

  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --error:   #ef4444;
  --info:    #3b82f6;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(15,13,26,0.06), 0 1px 2px rgba(15,13,26,0.04);
  --shadow-md:  0 4px 12px rgba(15,13,26,0.08), 0 2px 6px rgba(15,13,26,0.04);
  --shadow-lg:  0 10px 30px rgba(15,13,26,0.10), 0 4px 12px rgba(15,13,26,0.06);
  --shadow-xl:  0 20px 60px rgba(15,13,26,0.12);
  --shadow-brand: 0 8px 30px rgba(99, 102, 241, 0.25);

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-sans: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --gradient-warm:  linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-cool:  linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  --gradient-hero:  linear-gradient(145deg, #f8f7ff 0%, #ede9fe 40%, #fce7f3 100%);

  /* Layout */
  --container-width: 1200px;
  --nav-height: 68px;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary:     #0c0b14;
  --bg-secondary:   #13111f;
  --bg-card:        #1a1729;
  --bg-elevated:    #231f38;
  --border-color:   #2d2a47;
  --text-primary:   #f0eeff;
  --text-secondary: #9896b0;
  --text-muted:     #5b5779;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.5);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.6);
  --shadow-brand: 0 8px 30px rgba(99, 102, 241, 0.4);

  --gradient-hero: linear-gradient(145deg, #0c0b14 0%, #1a1729 50%, #1a0f2e 100%);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-500); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-600); }

button { cursor: pointer; font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); }

ul[role="list"] { list-style: none; }

/* Skip link */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--brand-500); color: #fff;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  z-index: 9999;
}
.skip-link:focus { top: 1rem; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-title { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: .75rem; }
.section-subtitle { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 3rem; }

/* ============================================
   NAVBAR
   ============================================ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(var(--bg-primary-rgb, 255,255,255), 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition);
}

[data-theme="dark"] .site-header {
  background: rgba(12, 11, 20, 0.85);
}

.site-header.scrolled { box-shadow: var(--shadow-md); }

.nav-container {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--nav-height);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.logo-text { letter-spacing: -0.03em; }
.logo-accent { color: var(--brand-500); }

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem .85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  background: none;
  border: none;
}

.nav-link:hover, .nav-link.active {
  color: var(--brand-500);
  background: var(--brand-glow);
}

/* Dropdown */
.nav-dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + .5rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: .5rem;
  min-width: 220px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: .85rem;
  transition: all var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-elevated);
  color: var(--brand-500);
}

.dropdown-icon { font-size: 1rem; }

/* Nav Actions */
.nav-actions { display: flex; align-items: center; gap: .5rem; }

.nav-search-btn, .theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-search-btn:hover, .theme-toggle:hover {
  background: var(--brand-glow);
  color: var(--brand-500);
  border-color: var(--brand-400);
}

.sun-icon { display: block; }
.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: .5rem;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0; bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  padding: 2rem 1.5rem;
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

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

.mobile-nav-links a {
  display: block;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 13, 26, 0.7);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.search-overlay.open { opacity: 1; pointer-events: all; }

.search-container { width: 100%; max-width: 640px; padding: 0 1.5rem; }

.search-box {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--bg-card);
  border: 1px solid var(--brand-400);
  border-radius: var(--radius-xl);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-brand);
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  padding: .25rem;
  line-height: 1;
}

.search-results {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: .75rem;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.25rem;
  transition: background var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-elevated); }

.search-result-icon {
  width: 36px; height: 36px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

.search-result-info h4 { font-size: .9rem; margin-bottom: .1rem; }
.search-result-info p { font-size: .8rem; color: var(--text-secondary); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-bounce);
  outline: none;
  white-space: nowrap;
}

.btn:focus-visible { box-shadow: 0 0 0 3px var(--brand-glow); }

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(99,102,241,0.4);
  color: #fff;
}

.btn-primary:active { transform: translateY(0); }

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

.btn-secondary:hover {
  background: var(--brand-glow);
  color: var(--brand-500);
  border-color: var(--brand-400);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--brand-500);
  border: 1.5px solid var(--brand-500);
}

.btn-outline:hover {
  background: var(--gradient-brand);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
}

.btn-sm { padding: .45rem 1rem; font-size: .82rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-icon { padding: .65rem; min-width: 0; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-400);
  transform: translateY(-3px);
}

.card-body { padding: 1.5rem; }

/* Tool Card */
.tool-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-bounce);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
}

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

.tool-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-400);
  transform: translateY(-4px);
  color: var(--text-primary);
}

.tool-card:hover::before { transform: scaleX(1); }

.tool-card-icon {
  width: 52px; height: 52px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  transition: all var(--transition-bounce);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--brand-500);
}

.tool-card:hover .tool-card-icon {
  background: var(--gradient-brand);
  color: #fff;
  transform: scale(1.1) rotate(-5deg);
}

.tool-card-title { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; }
.tool-card-desc { font-size: .85rem; color: var(--text-secondary); line-height: 1.5; flex: 1; }

.badge-trending {
  position: absolute;
  top: .85rem; right: .85rem;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  background: var(--gradient-hero);
  padding: 6rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  top: -200px; right: -100px;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(168,85,247,0.1) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.hero-content {
  position: relative; z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--brand-glow);
  border: 1px solid var(--brand-400);
  color: var(--brand-500);
  padding: .4rem 1rem;
  border-radius: var(--radius-full);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease;
}

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

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-search {
  display: flex;
  align-items: center;
  max-width: 560px;
  margin: 0 auto 2.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: .4rem .4rem .4rem 1.25rem;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.7s ease 0.3s both;
  transition: all var(--transition);
}

.hero-search:focus-within {
  border-color: var(--brand-400);
  box-shadow: var(--shadow-brand);
}

.hero-search input {
  flex: 1; background: none;
  border: none; outline: none;
  font-size: 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.hero-search input::placeholder { color: var(--text-muted); }

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.4s both;
}

.hero-stat { text-align: center; }
.hero-stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}
.hero-stat-label { font-size: .8rem; color: var(--text-secondary); font-weight: 500; }

.hero-divider {
  width: 1px; height: 40px;
  background: var(--border-color);
}

/* ============================================
   CATEGORIES
   ============================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.category-card::after {
  content: '';
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

.category-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: transform var(--transition-bounce);
}

.category-card:hover .category-icon { transform: scale(1.15) rotate(-8deg); }

.category-info h3 { font-size: .95rem; font-weight: 700; margin-bottom: .1rem; }
.category-info p { font-size: .78rem; color: var(--text-secondary); }

/* ============================================
   TOOLS GRID
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.tools-grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ============================================
   TOOL PAGE
   ============================================ */
.tool-page { padding: 2.5rem 0 5rem; }

.tool-page-header {
  margin-bottom: 2rem;
}

.tool-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: .6rem;
}

.tool-description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 700px;
}

.tool-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.tool-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.tool-sidebar {}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.sidebar-widget h3 {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.related-tool-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-primary);
  transition: color var(--transition);
}

.related-tool-item:last-child { border-bottom: none; }
.related-tool-item:hover { color: var(--brand-500); }
.related-tool-item-icon { font-size: 1.2rem; }
.related-tool-item-name { font-size: .88rem; font-weight: 500; }

/* Ad Placeholder */
.ad-slot {
  background: var(--bg-elevated);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: .75rem;
  text-align: center;
}

.ad-slot-banner { height: 90px; width: 100%; }
.ad-slot-sidebar { height: 250px; width: 100%; }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: .7rem 1rem;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: .95rem;
  font-family: var(--font-sans);
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--brand-400);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
  resize: vertical;
  min-height: 140px;
  font-family: var(--font-sans);
}

.form-control-mono {
  font-family: var(--font-mono);
  font-size: .88rem;
}

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

input[type="range"].form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--gradient-brand);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

/* ============================================
   UPLOAD / DROPZONE
   ============================================ */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-secondary);
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand-400);
  background: var(--brand-glow);
}

.dropzone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}

.dropzone-icon {
  font-size: 2.5rem; margin-bottom: .75rem;
  display: block;
  animation: float 3s ease-in-out infinite;
}

.dropzone-text { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }
.dropzone-hint { font-size: .82rem; color: var(--text-secondary); }

/* Progress bar */
.progress-wrap { margin: 1rem 0; }
.progress-label { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: .4rem; }
.progress-bar {
  height: 8px; border-radius: var(--radius-full);
  background: var(--border-color);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.5s ease;
}

/* ============================================
   RESULT BOX
   ============================================ */
.result-box {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
}

.result-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .75rem;
  font-size: .85rem; font-weight: 600; color: var(--text-secondary);
}

.result-content {
  font-family: var(--font-mono);
  font-size: .88rem;
  word-break: break-all;
  color: var(--text-primary);
  max-height: 200px;
  overflow-y: auto;
}

/* ============================================
   STATS STRIP
   ============================================ */
.stats-strip {
  display: flex; gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex; align-items: center; gap: .4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: .4rem .85rem;
  font-size: .82rem;
  font-weight: 600;
}

.stat-chip-val { color: var(--brand-500); }

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-nav { margin-bottom: 1.5rem; }

.breadcrumb-list {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: .25rem;
  list-style: none; padding: 0;
  font-size: .82rem;
}

.breadcrumb-list li {
  display: flex; align-items: center; gap: .25rem;
  color: var(--text-muted);
}

.breadcrumb-list li::after {
  content: '/';
  color: var(--border-color);
  margin-left: .25rem;
}

.breadcrumb-list li:last-child::after { display: none; }
.breadcrumb-list li:last-child { color: var(--text-primary); font-weight: 500; }
.breadcrumb-list a { color: var(--text-secondary); }
.breadcrumb-list a:hover { color: var(--brand-500); }

/* ============================================
   NEWSLETTER BANNER
   ============================================ */
.newsletter-banner {
  background: var(--gradient-brand);
  padding: 3rem 0;
}

.newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.newsletter-text h3 { color: #fff; font-size: 1.4rem; margin-bottom: .35rem; }
.newsletter-text p { color: rgba(255,255,255,0.8); font-size: .95rem; }

.newsletter-form {
  display: flex; gap: .5rem; flex-wrap: wrap;
}

.newsletter-form input {
  flex: 1; min-width: 260px;
  padding: .7rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  outline: none;
  font-size: .95rem;
  font-family: var(--font-sans);
}

.newsletter-form .btn {
  background: #fff;
  color: var(--brand-600);
  font-weight: 700;
}

/* ============================================
   FOOTER
   ============================================ */
.footer-main { background: var(--bg-secondary); padding: 4rem 0 0; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

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

.footer-logo {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.2rem; font-weight: 800;
  color: var(--text-primary);
}

.footer-logo span { color: var(--text-primary); }
.footer-logo span span { color: var(--brand-500); }

.social-links { display: flex; gap: .5rem; margin-top: 1.25rem; }

.social-link {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.social-link:hover { background: var(--gradient-brand); color: #fff; border-color: transparent; transform: translateY(-2px); }

.footer-col h4 { font-size: .9rem; font-weight: 700; margin-bottom: 1rem; }

.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul a { color: var(--text-secondary); font-size: .88rem; transition: color var(--transition); }
.footer-col ul a:hover { color: var(--brand-500); }

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
}

.footer-bottom-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .75rem;
  font-size: .82rem; color: var(--text-muted);
}

.footer-bottom-inner a { color: var(--text-secondary); }

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-brand);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: all var(--transition-bounce);
  z-index: 500;
}

.back-to-top.visible {
  opacity: 1; pointer-events: all;
  transform: translateY(0);
}

.back-to-top:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(99,102,241,0.5); }

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: .75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: .9rem; font-weight: 500;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow-xl);
  transition: transform var(--transition-bounce);
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--error); color: #fff; }

/* ============================================
   SECTION STYLES
   ============================================ */
.section-header { text-align: center; max-width: 700px; margin: 0 auto 3rem; }

.section-label {
  display: inline-block;
  background: var(--brand-glow);
  color: var(--brand-500);
  font-size: .78rem; font-weight: 700;
  padding: .3rem .85rem;
  border-radius: var(--radius-full);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

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

.testimonial-stars { color: #f59e0b; margin-bottom: .75rem; font-size: 1.1rem; }
.testimonial-text { color: var(--text-secondary); font-size: .92rem; line-height: 1.7; margin-bottom: 1.25rem; }

.testimonial-author { display: flex; align-items: center; gap: .75rem; }
.testimonial-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: .9rem;
}

.testimonial-name { font-size: .9rem; font-weight: 700; }
.testimonial-role { font-size: .78rem; color: var(--text-muted); }

/* FAQ */
.faq-list { max-width: 780px; margin: 0 auto; }

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: .75rem;
  overflow: hidden;
  transition: all var(--transition);
}

.faq-item.open { border-color: var(--brand-400); box-shadow: var(--shadow-sm); }

.faq-question {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: 600; font-size: .95rem;
  background: none; border: none; width: 100%;
  text-align: left; color: var(--text-primary);
  font-family: var(--font-sans);
  transition: background var(--transition);
}

.faq-question:hover { background: var(--bg-elevated); }

.faq-icon {
  width: 24px; height: 24px;
  background: var(--bg-elevated);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-bounce);
  font-size: .8rem;
}

.faq-item.open .faq-icon {
  background: var(--gradient-brand);
  color: #fff;
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition-slow);
}

.faq-answer-inner {
  padding-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: .92rem;
  line-height: 1.7;
}

.faq-item.open .faq-answer { max-height: 400px; }

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border-color) 50%, var(--bg-elevated) 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(-15px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

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

.animate-fade-up { animation: fadeInUp 0.6s ease both; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* Intersection observer animations */
.reveal { opacity: 0; transform: translateY(20px); transition: all 0.6s cubic-bezier(0.4,0,0.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .tool-wrapper { grid-template-columns: 1fr; }
  .tool-sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-height: 60px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 4rem 0 3rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-divider { display: none; }
  .newsletter-inner { flex-direction: column; text-align: center; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
  .section { padding: 3rem 0; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .hero-search { flex-direction: column; border-radius: var(--radius-lg); }
  .hero-search input { width: 100%; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .categories-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Color stripes for categories */
.cat-text    { --cat-color: #6366f1; }
.cat-image   { --cat-color: #ec4899; }
.cat-calculator { --cat-color: #f59e0b; }
.cat-converter  { --cat-color: #10b981; }
.cat-developer  { --cat-color: #3b82f6; }
.cat-seo        { --cat-color: #8b5cf6; }
.cat-generator  { --cat-color: #ef4444; }
.cat-security   { --cat-color: #14b8a6; }

.category-card .category-icon { background: color-mix(in srgb, var(--cat-color) 15%, transparent); color: var(--cat-color); }
.category-card:hover { border-color: var(--cat-color); box-shadow: 0 8px 30px color-mix(in srgb, var(--cat-color) 20%, transparent); }
