/* ===================================
   TOOLHUB - MODERN DARK THEME CSS
   =================================== */

/* CSS Variables - Color Palette */
:root {
  --primary-color: #3b82f6;
  --secondary-color: #64748b;
  --bg-dark: #0f172a;
  --text-light: #f1f5f9;
}

/* Cookie Consent */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  z-index: 9999;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease-out;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.cookie-content p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.cookie-buttons {
  display: flex;
  gap: 0.5rem;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
}

:root {
  --primary-dark: #0a0e27;
  --secondary-dark: #1a1f3a;
  --tertiary-dark: #252d47;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.2);
  --hover-overlay: rgba(59, 130, 246, 0.1);
  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: #0a0e27;
  overflow-y: scroll;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1229 100%);
  background-attachment: scroll;
  background-color: #0a0e27;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

@media (min-width: 1024px) {
  body {
    background-attachment: fixed;
  }
}

@supports (-webkit-touch-callout: none) {
  body {
    background-attachment: scroll;
  }
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

h3 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

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

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

/* ===== BUTTONS ===== */
.btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  border: 1.5px solid var(--accent-purple);
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(139, 92, 246, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-blue);
  border: 1.5px solid var(--border-color);
}

.btn-ghost:hover {
  background: rgba(59, 130, 246, 0.1);
}

.btn-small {
  padding: 0.6rem 1.2rem;
  font-size: 0.875rem;
}

.btn-large {
  padding: 1rem 3rem;
  font-size: 1.1rem;
}

/* ===== CONTAINERS ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== CARDS & GLASSMORPHISM ===== */
.card {
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.6) 0%, rgba(37, 45, 71, 0.4) 100%);
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  padding: 2rem;
  transition: var(--transition);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-12px);
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.8) 0%, rgba(37, 45, 71, 0.6) 100%);
  box-shadow: 0 16px 48px rgba(59, 130, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}

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

.card-compact {
  padding: 1.5rem;
}

/* ===== TOOL CARDS ===== */
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  height: 100%;
  padding: 1.5rem;
  border-radius: 18px;
  text-decoration: none !important;
  color: inherit !important;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(16, 22, 44, 0.86) 0%, rgba(28, 36, 60, 0.66) 100%) padding-box,
    linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(236, 72, 153, 0.35)) border-box;
  border: 1.25px solid transparent;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(16px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 320px;
  contain: layout paint style;
}

.tool-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.55), 0 0 28px rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.45);
  background:
    linear-gradient(135deg, rgba(20, 26, 50, 0.92) 0%, rgba(32, 40, 68, 0.74) 100%) padding-box,
    linear-gradient(135deg, rgba(59, 130, 246, 0.45), rgba(236, 72, 153, 0.45)) border-box;
}

.tool-card:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 3px;
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tool-icon {
  font-size: 1.6rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.55);
  flex-shrink: 0;
}

.tool-icon i {
  font-size: 1.6rem;
  color: var(--text-primary);
}

.category-icon i {
  font-size: 3rem;
  color: var(--text-primary);
}

.tool-hero-icon i {
  font-size: 2rem;
  color: var(--text-primary);
}

.icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  color: var(--accent-blue);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

.preset-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.ad-slot {
  margin: 2.5rem auto;
  max-width: 970px;
  width: 100%;
}

.ad-slot ins {
  width: 100%;
}

.tool-card h4 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.tool-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card .cta,
.tool-card .btn {
  margin-top: auto;
  width: 100%;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.4rem;
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.tool-card .cta:hover,
.tool-card .btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 34px rgba(59, 130, 246, 0.45);
}

/* ===== GRADIENT BACKGROUNDS ===== */
.gradient-blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
}

.gradient-purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.1) 100%);
}

/* ===== GRID LAYOUTS ===== */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 1.8rem;
}

/* Responsive breakpoints to meet requirements: mobile 1, tablet 2-3, desktop 4+ */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2 {
    grid-template-columns: repeat(1, 1fr);
  }

  .card,
  .tool-card,
  .category-card {
    backdrop-filter: none;
  }
}

@media (max-width: 480px) {

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
  }
}

/* ===== NAVBAR ===== */
nav {
  background: rgba(10, 14, 39, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1.5px solid rgba(59, 130, 246, 0.15);
  position: sticky;
  top: 0;
  padding-top: env(safe-area-inset-top);
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  gap: 1.5rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
}

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

.nav-links a {
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.15);
}

.mobile-menu-btn {
  display: none;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--text-primary);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
}

.mobile-menu-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .nav-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
  }

  .logo {
    position: relative;
    margin: 0;
    transform: none;
    text-align: left;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
  }

  .logo .spinning-icon {
    display: none;
  }

  .nav-links {
    position: fixed;
    top: calc(64px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 14, 39, 0.97);
    backdrop-filter: blur(12px);
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
    border-bottom: 1px solid rgba(59, 130, 246, 0.18);
  }

  .nav-links.active {
    max-height: min(360px, calc(100vh - 80px));
    overflow-y: auto;
  }

  .nav-links li {
    padding: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links a {
    display: block;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
  }

  .mobile-menu-btn {
    display: block;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 44px;
    height: 44px;
  }
}

/* ===== FOOTER ===== */
footer {
  background: linear-gradient(135deg, rgba(10, 14, 39, 0.8) 0%, rgba(15, 18, 41, 0.6) 100%);
  border-top: 1.5px solid rgba(59, 130, 246, 0.15);
  padding: 3.5rem 2rem 2.5rem;
  margin-top: 5rem;
  backdrop-filter: blur(10px);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.footer-section a {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--accent-blue);
  transform: translateX(4px);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 6rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 50%, rgba(236, 72, 153, 0.15) 100%);
  border-radius: 24px;
  margin-bottom: 4rem;
  border: 1.5px solid rgba(59, 130, 246, 0.2);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1), transparent);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(20px);
  }
}

.hero h1 {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 50%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
    line-height: 1.15;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  h3 {
    font-size: 1.25rem;
    line-height: 1.25;
  }

  .hero {
    padding: 3rem 1.25rem;
    border-radius: 20px;
  }

  .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 320px;
  }
}

/* ===== SEARCH BAR ===== */
.search-container {
  max-width: 600px;
  margin: 3rem auto;
  padding: 0 2rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1.1rem 1.8rem;
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.6) 0%, rgba(37, 45, 71, 0.4) 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.8) 0%, rgba(37, 45, 71, 0.6) 100%);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

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

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  input,
  textarea,
  select,
  button {
    font-size: 16px;
  }

  .container {
    padding: 0 1.1rem;
  }

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

  .search-input {
    padding: 0.85rem 1.1rem;
    font-size: 0.95rem;
    border-radius: 12px;
  }

  .category-pills {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
  }

  .category-pills .pill {
    flex: 0 0 auto;
  }

  .category-pills .pill {
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
  }

  .category-card {
    padding: 1.8rem 1.4rem;
  }

  .category-icon {
    font-size: 2.4rem;
  }

  .category-card p {
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  p {
    margin-bottom: 0.75rem;
  }

  .mt-5 {
    margin-top: 2rem;
  }

  .mb-5 {
    margin-bottom: 2rem;
  }

  .mt-4 {
    margin-top: 1.5rem;
  }

  .mb-4 {
    margin-bottom: 1.5rem;
  }

  .mt-3 {
    margin-top: 1rem;
  }

  .mb-3 {
    margin-bottom: 1rem;
  }

  .grid {
    align-items: start;
    grid-auto-rows: auto;
  }

  .grid>* {
    height: auto;
  }

  .tool-card {
    height: auto;
  }
}

@media (max-width: 768px) {
  footer {
    padding: 2.5rem 1.5rem 2rem;
  }

  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
  }

  .footer-bottom {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .tool-card {
    padding: 1.1rem;
    gap: 0.75rem;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.45);
  }

  .tool-card-header {
    gap: 0.8rem;
  }

  .tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .tool-card h4 {
    font-size: 1.05rem;
  }

  .tool-card p {
    font-size: 0.92rem;
    -webkit-line-clamp: 3;
  }

  .tool-card .cta,
  .tool-card .btn {
    padding: 0.7rem 1rem;
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .tool-card {
    padding: 1rem;
  }

  .hero h1 {
    font-size: 2.1rem;
  }
}

/* ===== PAGE INTRO ===== */
.page-intro {
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.7) 0%, rgba(37, 45, 71, 0.5) 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 12px 36px rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(16px);
}

.page-intro .search-container {
  max-width: 720px;
  margin: 2rem auto 0;
  padding: 0;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 2rem;
}

.category-pills .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--text-secondary);
  background: rgba(59, 130, 246, 0.08);
  font-size: 0.9rem;
  transition: var(--transition);
  touch-action: manipulation;
}

.category-pills .pill:hover {
  color: #fff;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
}

/* ===== CATEGORY GRID ===== */
.category-card {
  text-align: center;
  padding: 2.5rem 2rem;
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.6) 0%, rgba(37, 45, 71, 0.4) 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  content-visibility: auto;
  contain-intrinsic-size: 280px;
  contain: layout paint style;
}

body.page-tools .tool-card,
body.page-tools .category-card {
  backdrop-filter: none;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.page-tools .grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

body.page-tools .tool-card .cta,
body.page-tools .tool-card .btn {
  margin-top: 0.65rem;
}

body.page-tools .grid {
  align-items: start;
  grid-auto-rows: auto;
}

body.page-tools .grid>* {
  height: auto;
}

body.page-tools .tool-card {
  height: auto;
}

body.page-tools .tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.45);
}

body.page-tools .category-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 18px 36px rgba(59, 130, 246, 0.28);
}

body.page-home .grid>.tool-card {
  height: auto;
}

body.page-home .tool-card {
  align-self: start;
}

body.page-home .tool-card .cta,
body.page-home .tool-card .btn {
  margin-top: 0.65rem;
}

body.page-home .grid-4 {
  gap: 1.2rem;
}

@media (max-width: 768px) {
  body.page-home .grid-4 {
    gap: 1rem;
  }
}

body.page-blog .search-container {
  margin: 0.8rem auto 0.2rem;
}

body.page-blog .ad-slot {
  margin: 0.2rem auto;
}

body.page-blog .featured-post {
  margin-top: 0.25rem;
}

body.page-about section.container.mt-5 {
  margin-top: 1.5rem;
}

body.page-about section.container.mb-5 {
  margin-bottom: 1.5rem;
}

body.page-help .search-container {
  margin: 0.8rem auto 0.4rem;
}

body.page-help .help-filters {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

body.page-help .ad-slot {
  margin: 0.2rem auto;
}

body.page-help .help-articles {
  margin-top: 0.5rem;
}

.category-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-card:hover {
  transform: translateY(-16px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 16px 48px rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.8) 0%, rgba(37, 45, 71, 0.6) 100%);
}

.category-card:hover::after {
  opacity: 1;
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.category-card h3 {
  margin-bottom: 0.5rem;
}

.category-card p {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ===== TOOL DETAIL PAGE ===== */
.tool-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.tool-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.45);
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.tool-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.12);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.tool-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.tool-feature-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.tool-feature-list li {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  color: var(--text-secondary);
}

.tool-feature-list li::before {
  content: "+";
  color: var(--accent-cyan);
  font-weight: 700;
}

.notice-card {
  border: 1px solid rgba(236, 72, 153, 0.25);
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.2), rgba(15, 23, 42, 0.2));
}

/* Ensure cards stretch to equal height inside grids */
.grid {
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.grid>* {
  height: 100%;
}

/* Small meta label under CTA */
.tool-card small.text-muted {
  display: block;
  margin-top: 0.6rem;
  color: var(--text-muted);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1.8rem;
}

label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.6) 0%, rgba(37, 45, 71, 0.4) 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
  font-family: inherit;
  backdrop-filter: blur(10px);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.8) 0%, rgba(37, 45, 71, 0.6) 100%);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}

textarea {
  resize: vertical;
  min-height: 150px;
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

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

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  }

  50% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
  }
}

@keyframes spinContinuous {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.fade-in {
  animation: fadeInUp 0.6s ease-out;
}

.slide-in {
  animation: slideInLeft 0.6s ease-out;
}

.spinning-icon {
  display: inline-block;
  animation: spinContinuous 3s linear infinite;
  margin-right: 0.5rem;
}

/* ===== FOCUS STATES ===== */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 3px;
}

/* ===== UTILITY CLASSES ===== */
.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mt-5 {
  margin-top: 3rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

.mb-5 {
  margin-bottom: 3rem;
}

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

.text-right {
  text-align: right;
}

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

.text-secondary {
  color: var(--text-secondary);
}

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

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-col {
  flex-direction: column;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ===== RESPONSIVE TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

thead {
  background: rgba(26, 31, 58, 0.8);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

/* ===== CODE BLOCKS ===== */
pre {
  background: rgba(10, 14, 39, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1rem 0;
}

code {
  background: rgba(26, 31, 58, 0.5);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: var(--accent-cyan);
}

pre code {
  background: none;
  padding: 0;
}

/* ===== LOADING & STATES ===== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.success-message {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #10b981;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.info-message {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: var(--accent-blue);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

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

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