/* ==========================================================================
   OmniTools - Modern Lightweight Multi-Tool Platform Stylesheet
   Mobile-First, Responsive, High Performance, AdSense-Friendly
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables & Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --bg-surface-elevated: #ffffff;
  --border-color: #e2e8f0;
  --border-color-focus: #3b82f6;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --accent: #10b981;
  --accent-light: #ecfdf5;
  --accent-border: #a7f3d0;

  --warning: #f59e0b;
  --warning-light: #fffbeb;

  --danger: #ef4444;
  --danger-light: #fef2f2;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Layout & Spacing */
  --container-max: 1200px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

a:hover {
  color: var(--primary-hover);
}

input, button, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --------------------------------------------------------------------------
   3. Layout & Container
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

main {
  flex: 1;
}

/* --------------------------------------------------------------------------
   4. Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: box-shadow var(--transition-normal);
}

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

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.brand-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.brand-name span {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

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

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

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-alt);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  font-size: 0.8125rem;
  font-weight: 600;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.lang-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover:not(.active) {
  color: var(--text-main);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  padding: 0.5rem;
  color: var(--text-main);
  font-size: 1.5rem;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   5. Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 3.5rem 0 2rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, #eff6ff 0%, transparent 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-badge svg {
  width: 1rem;
  height: 1rem;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-main);
  max-width: 800px;
  margin: 0 auto 1rem;
}

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

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 2rem;
}

/* Instant Search Input in Hero */
.search-wrapper {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 0.95rem 1.25rem 0.95rem 3rem;
  font-size: 1rem;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-subtle);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. Tools Grid Section
   -------------------------------------------------------------------------- */
.tools-section {
  padding: 2.5rem 0 4rem;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.tools-count-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--bg-surface-alt);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem;
}

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

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

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.tool-icon-box {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  transition: all var(--transition-fast);
}

.tool-card:hover .tool-icon-box {
  background: var(--primary);
  color: #ffffff;
}

.tool-icon-box svg {
  width: 1.5rem;
  height: 1.5rem;
}

.tool-category-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  color: var(--text-muted);
}

.tool-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.tool-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.tool-card-footer svg {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform var(--transition-fast);
}

.tool-card:hover .tool-card-footer svg {
  transform: translateX(4px);
}

/* Category Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip.active,
.filter-chip:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* --------------------------------------------------------------------------
   7. Features & Value Prop Section
   -------------------------------------------------------------------------- */
.features-section {
  padding: 4rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.feature-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
}

.feature-icon-wrapper {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon-wrapper svg {
  width: 1.35rem;
  height: 1.35rem;
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.feature-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   8. Breadcrumbs & Page Headers
   -------------------------------------------------------------------------- */
.page-top-nav {
  padding: 1.25rem 0 0.5rem;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  list-style: none;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs li::after {
  content: "/";
  color: var(--text-subtle);
}

.breadcrumbs li:last-child::after {
  content: "";
}

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

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs li[aria-current="page"] {
  color: var(--text-main);
  font-weight: 600;
}

/* Tool Hero Header */
.tool-header-section {
  padding: 1.5rem 0 2rem;
}

.tool-header-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.625rem;
}

.tool-header-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 780px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   9. Interactive Tool Widget Styles
   -------------------------------------------------------------------------- */
.tool-layout-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 992px) {
  .tool-layout-container {
    grid-template-columns: 1fr 340px;
    align-items: start;
  }
}

.tool-card-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  position: relative;
}

.widget-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 640px) {
  .widget-form-grid.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label .label-hint {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-muted);
}

.form-input,
.form-select {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-input:invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.widget-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
}

.btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1.5px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-surface-alt);
  color: var(--text-main);
  border-color: var(--text-subtle);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
}

/* Results Display Box */
.results-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.results-box.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-title svg {
  color: var(--accent);
}

.hero-result-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  padding: 1.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-result-card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-result-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.hero-result-value {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
}

.hero-result-sub {
  font-size: 0.9375rem;
  color: #cbd5e1;
  margin-top: 0.5rem;
}

/* Secondary Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Milestone Cards */
.milestones-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.milestones-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.milestones-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.milestone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-sm);
}

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

.milestone-item-val {
  font-weight: 600;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   10. Google AdSense Containers (CLS Optimized)
   -------------------------------------------------------------------------- */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fdfdfd;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  margin: 2rem auto;
  position: relative;
  overflow: hidden;
  text-align: center;
  width: 100%;
}

.ad-slot::before {
  content: "ADVERTISEMENT";
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.ad-slot-placeholder-text {
  font-size: 0.8125rem;
  color: #94a3b8;
}

/* Specific Sizes for Core AdSense Formats */
.ad-leaderboard {
  min-height: 90px;
  max-width: 728px;
}

.ad-rectangle {
  min-height: 250px;
  max-width: 300px;
}

.ad-large-rectangle {
  min-height: 280px;
  max-width: 336px;
}

.ad-in-content {
  min-height: 120px;
  max-width: 800px;
  margin: 2.5rem auto;
}

/* --------------------------------------------------------------------------
   11. Rich Educational Content & Guides (AdSense Quality SEO)
   -------------------------------------------------------------------------- */
.educational-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  margin: 3rem 0;
}

.content-section {
  margin-bottom: 2.75rem;
}

.content-section:last-child {
  margin-bottom: 0;
}

.content-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.content-heading svg {
  color: var(--primary);
  width: 1.5rem;
  height: 1.5rem;
}

.content-subheading {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.5rem 0 0.75rem;
}

.content-paragraph {
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 1.25rem;
}

/* Step-by-Step Instructions */
.step-list {
  list-style: none;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.25rem 0;
}

.step-item {
  counter-increment: step-counter;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-surface-alt);
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
}

.step-item::before {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.step-item-content {
  font-size: 0.9375rem;
  color: #334155;
  line-height: 1.6;
}

.step-item-content strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 0.25rem;
}

/* Formula & Math Card */
.formula-box {
  background: #0f172a;
  color: #f8fafc;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  font-family: var(--font-mono);
  overflow-x: auto;
}

.formula-expression {
  font-size: 1.15rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.75rem;
}

.formula-explanation {
  font-size: 0.875rem;
  color: #cbd5e1;
  font-family: var(--font-sans);
  line-height: 1.6;
}

/* Practical Real-Life Examples */
.example-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.example-card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border-left: 4px solid var(--accent);
}

.example-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.example-card-body {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Semantic FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.faq-item {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-item[open] {
  background: var(--bg-surface);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--primary);
  line-height: 1;
  transition: transform var(--transition-fast);
}

.faq-item[open] .faq-question::after {
  content: "−";
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #334155;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

/* --------------------------------------------------------------------------
   12. Toast Notification
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 4rem 0 2rem;
  border-top: 1px solid #1e293b;
  margin-top: auto;
}

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

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand-col p {
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 1rem;
  max-width: 320px;
  color: #cbd5e1;
}

.footer-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
}

.footer-bottom p {
  color: #64748b;
}

.footer-lang-select {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
}

.footer-lang-select a {
  color: #cbd5e1;
  font-weight: 600;
}

.footer-lang-select a:hover {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   14. Mobile Responsive Utilities
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.active {
    display: flex;
  }

  .hero-section {
    padding: 2.5rem 0 1.5rem;
  }

  .tool-card-widget {
    padding: 1.25rem;
  }

  .educational-content {
    padding: 1.75rem 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   15. Health & BMI Specific Styles
   -------------------------------------------------------------------------- */
.unit-toggle-wrap {
  display: inline-flex;
  background: var(--bg-surface-alt);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  width: fit-content;
}

.unit-toggle-btn {
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.unit-toggle-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.unit-group {
  display: none;
}

.unit-group.active {
  display: block;
}

/* Visual BMI Spectrum Gauge */
.bmi-gauge-wrap {
  margin: 1.5rem 0 1.25rem;
  position: relative;
}

.bmi-spectrum-bar {
  display: flex;
  height: 14px;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}

.bmi-bar-underweight { background: #38bdf8; flex: 18.5; }
.bmi-bar-normal { background: #10b981; flex: 6.4; }
.bmi-bar-overweight { background: #f59e0b; flex: 5.0; }
.bmi-bar-obese { background: #ef4444; flex: 15.0; }

.bmi-pointer {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--text-main);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bmi-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Category Badges */
.bmi-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.bmi-badge-underweight { background: #e0f2fe; color: #0284c7; }
.bmi-badge-normal { background: #ecfdf5; color: #059669; }
.bmi-badge-overweight { background: #fef3c7; color: #d97706; }
.bmi-badge-obese { background: #fee2e2; color: #dc2626; }

/* Clean Data Table */
.data-table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--bg-surface-alt);
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: #334155;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background: #f8fafc;
}

/* --------------------------------------------------------------------------
   16. Finance & Loan EMI Styles
   -------------------------------------------------------------------------- */
.loan-proportion-bar {
  display: flex;
  height: 16px;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
  margin: 1.25rem 0 0.75rem;
}

.loan-bar-principal {
  background: var(--primary);
  transition: width 0.4s ease;
}

.loan-bar-interest {
  background: #f59e0b;
  transition: width 0.4s ease;
}

.loan-legend-wrap {
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.loan-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.loan-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.loan-dot-principal {
  background: var(--primary);
}

.loan-dot-interest {
  background: #f59e0b;
}

/* Responsive header: keep logo + language select + menu button on one line on phones */
@media (max-width: 480px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .header-inner {
    gap: 0.5rem;
  }

  .nav-actions {
    gap: 0.5rem;
  }

  .brand-logo {
    font-size: 1.1rem;
  }

  .brand-icon {
    width: 1.9rem;
    height: 1.9rem;
  }

  #langSelect {
    max-width: 120px;
    font-size: 0.875rem;
  }
}

@media (max-width: 380px) {
  .brand-name {
    display: none;
  }

  #langSelect {
    max-width: 110px;
  }
}
/* ADS PAUSED — owner request 2026-10-31: hide empty ad placeholders until AdSense is ready.
   To re-enable ads, delete this rule only. No page markup was changed. */
.ad-slot { display: none !important; }

/* ==========================================================================
   UI/UX UPGRADE — 2026-10-31 (appended block; no earlier rules were edited)
   1) Explicit 3/2/1 tool grid  2) Card motion + keyboard focus
   3) Tab selected/focus states  4) No-results note
   5) Searchable language switcher  6) RTL layout fixes
   7) Dark theme (follows the device setting; no toggle added)
   ========================================================================== */

/* 1. Explicit responsive grid: 1 column mobile, 2 tablet, 3 desktop. */
.tools-grid { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 2. Card motion: animate only transform/shadow/border (not "all");
   keyboard focus gets the same lift as hover; motion-sensitive users get none. */
.tool-card {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.tool-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-xl);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .tool-card, .tool-card:hover, .tool-card:focus-visible { transform: none; transition: none; }
  .tool-card:hover .tool-card-footer svg { transform: none; }
}

/* 3. Tabs: selected state follows aria-selected (set by main.js); visible focus ring. */
.filter-chip[aria-selected="true"] {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.filter-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 4. No-results note — created by main.js only when a filter matches nothing. */
.no-results {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

/* 5. Searchable language switcher — progressive enhancement over #langSelect.
   The native select stays in the markup as the no-JS fallback; main.js hides
   it (visually only) and builds this dropdown from its own options. */
.lang-select-native-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.lang-switcher { position: relative; display: inline-block; }
.lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 180px;
}
.lang-switcher-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-switcher-btn:hover,
.lang-switcher-btn[aria-expanded="true"] { border-color: var(--primary); }
.lang-switcher-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.lang-switcher-panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 0.5rem);
  width: 260px;
  max-width: 80vw;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem;
  z-index: 200;
}
.lang-switcher-panel[hidden] { display: none; }
.lang-switcher-search {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background: var(--bg-surface);
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.lang-switcher-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.lang-switcher-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}
.lang-switcher-list li {
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-main);
}
.lang-switcher-list li:hover,
.lang-switcher-list li[aria-selected="true"] {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
@media (max-width: 480px) {
  .lang-switcher-panel { width: 240px; }
  .lang-switcher-btn { max-width: 140px; }
}

/* 6. RTL fixes — these pages already carry dir="rtl" (ur/ar/fa/he).
   Anything positioned or accented on one side is mirrored here. */
[dir="rtl"] .data-table { text-align: right; }
[dir="rtl"] .search-icon { left: auto; right: 1.15rem; }
[dir="rtl"] .search-input { padding-left: 1.25rem; padding-right: 3rem; }
[dir="rtl"] .tool-card:hover .tool-card-footer svg { transform: translateX(-4px); }
[dir="rtl"] .toast { right: auto; left: 2rem; }
[dir="rtl"] .hero-result-card::after { right: auto; left: -50%; }
[dir="rtl"] .step-item { border-left: none; border-right: 4px solid var(--primary); }
[dir="rtl"] .example-card { border-left: none; border-right: 4px solid var(--accent); }

/* 7. Dark theme — follows the device setting (no toggle added).
   Contrast targets (WCAG AA, normal text ≥ 4.5:1):
   text #f1f5f9 on surface #1e293b ≈ 14:1; muted #cbd5e1 ≈ 10:1;
   primary #60a5fa on #1e293b ≈ 5.8:1. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-alt: #263449;
    --bg-surface-elevated: #1e293b;
    --border-color: #334155;
    --border-color-focus: #60a5fa;
    --text-main: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-subtle: #94a3b8;
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-light: #1e3a5f;
    --primary-border: #3b82f6;
    --accent: #34d399;
    --accent-light: #123326;
    --accent-border: #166534;
    --warning: #fbbf24;
    --warning-light: #3a2a0a;
    --danger: #f87171;
    --danger-light: #3f1212;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.35), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.35);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.45), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  }
  /* Hardcoded light-theme text colors that variables do not cover. */
  .content-paragraph, .step-item-content, .faq-answer { color: #e2e8f0; }
  /* Light hero glow becomes a subtle dark glow. */
  .hero-section { background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 70%); }
  .search-input:focus, .lang-switcher-search:focus { box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25); }
}
