@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* ══════════════════════════════════════════
   Design Tokens
══════════════════════════════════════════ */
:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow:  rgba(37,99,235,0.18);
  --accent:        #7c3aed;
  --accent-light:  #f5f3ff;
  --green:         #16a34a;
  --green-bg:      #f0fdf4;
  --red:           #dc2626;
  --red-bg:        #fef2f2;
  --amber:         #d97706;
  --amber-bg:      #fffbeb;

  --bg:            #f0f4ff;
  --surface:       #ffffff;
  --surface-2:     #f8faff;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --border:        #e2e8f0;
  --border-focus:  #93c5fd;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
  --shadow:    0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.05);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.14), 0 8px 20px rgba(0,0,0,0.08);

  --success-bg:     #f0fdf4;
  --success-border: #86efac;
  --success-text:   #166534;
  --warning-bg:     #fffbeb;
  --warning-border: #fcd34d;
  --warning-text:   #92400e;
  --danger-bg:      #fef2f2;
  --danger-border:  #fca5a5;
  --danger-text:    #991b1b;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', 'Segoe UI', system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   Navbar
══════════════════════════════════════════ */
.navbar {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226,232,240,0.8);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(37,99,235,0.07);
}

.nav-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-brand::before {
  content: '⚡';
  -webkit-text-fill-color: initial;
  font-size: 18px;
}

.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  transition: all 0.18s;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--primary); background: var(--primary-light); }
.nav-links a.active {
  color: var(--primary);
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  font-weight: 700;
}

/* Signup button */
.signup-nav-btn {
  display: inline-block !important;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.18s;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(37,99,235,0.3);
}
.signup-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

/* ══════════════════════════════════════════
   Language Switcher
══════════════════════════════════════════ */
.lang-switcher { position: relative; }

.lang-btn {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s;
  white-space: nowrap;
}
.lang-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  min-width: 160px;
  z-index: 300;
  overflow: hidden;
  animation: fadeDown 0.15s ease;
}

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

[dir="ltr"] .lang-menu { left: auto; right: 0; }
.lang-menu.open { display: block; }

.lang-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}
.lang-menu a:hover { background: var(--primary-light); color: var(--primary); }

/* ══════════════════════════════════════════
   Main
══════════════════════════════════════════ */
main { flex: 1; }

/* ══════════════════════════════════════════
   Hero (index only)
══════════════════════════════════════════ */
.hero {
  background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 40%, #1d4ed8 70%, #7c3aed 100%);
  color: #fff;
  text-align: center;
  padding: 88px 24px 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(124,58,237,0.3) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(37,99,235,0.25) 0%, transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-content { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 16px;
  line-height: 1.15;
  letter-spacing: -1px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.hero p {
  font-size: 18px;
  opacity: 0.85;
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 7px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ══════════════════════════════════════════
   Tools Section (homepage)
══════════════════════════════════════════ */
.tools-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 56px 28px 72px;
}

.section-heading {
  text-align: center;
  margin-bottom: 40px;
}

.section-heading h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.section-heading p {
  font-size: 15px;
  color: var(--text-muted);
}

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

.tool-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.22s cubic-bezier(.22,.68,0,1.2), box-shadow 0.22s ease, border-color 0.22s;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.22s;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #bfdbfe;
}

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

.tool-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-xs);
}

.tool-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
}

.tool-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.tool-card-arrow {
  margin-top: 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.18s;
}

[dir="ltr"] .tool-card-arrow { transform: translateX(4px); }

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

/* Stats row (homepage) */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 40px 28px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-item-val {
  font-size: 34px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.stat-item-lbl { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

/* ══════════════════════════════════════════
   Tool Page Layout
══════════════════════════════════════════ */
.tool-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 44px 24px 72px;
}

.page-header { margin-bottom: 24px; }

.page-header a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.18s;
  box-shadow: var(--shadow-xs);
}

.page-header a:hover {
  color: var(--primary);
  border-color: var(--border-focus);
  background: var(--primary-light);
}

/* ══════════════════════════════════════════
   Card
══════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-xl);
  border: 1.5px solid rgba(226,232,240,0.8);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 40px; right: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 0 0 4px 4px;
}

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 24px 0;
}

/* ══════════════════════════════════════════
   Form Elements
══════════════════════════════════════════ */
label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
  margin-top: 18px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
  border-color: var(--border-focus);
}

textarea { resize: vertical; }

/* ══════════════════════════════════════════
   Buttons
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 22px;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 8px 24px rgba(37,99,235,0.45);
  transform: translateY(-2px);
}

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

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 2px solid var(--border);
  margin-top: 10px;
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--primary-light);
  border-color: var(--border-focus);
  color: var(--primary);
}

/* ══════════════════════════════════════════
   Tabs
══════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 5px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  border: 1.5px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.18s;
  font-family: inherit;
}

.tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.section { display: none; }
.section.active { display: block; }

/* ══════════════════════════════════════════
   Result Boxes
══════════════════════════════════════════ */
.result-box {
  margin-top: 22px;
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
  display: none;
  border: 2px solid;
  animation: popIn 0.25s cubic-bezier(.22,.68,0,1.2);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.result-box.show { display: block; }
.result-box.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.result-box.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.result-box.danger  { background: var(--danger-bg);  border-color: var(--danger-border);  color: var(--danger-text); }

.result-value { font-size: 46px; font-weight: 900; margin-bottom: 6px; letter-spacing: -1px; }
.result-label { font-size: 14px; opacity: 0.75; font-weight: 600; }

/* ══════════════════════════════════════════
   Stat Grid
══════════════════════════════════════════ */
.stat-grid {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.stat-box {
  flex: 1;
  min-width: 72px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.stat-box:hover { border-color: var(--border-focus); box-shadow: var(--shadow-sm); }
.stat-val { font-size: 24px; font-weight: 900; color: var(--primary); }
.stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

/* ══════════════════════════════════════════
   Option Toggle
══════════════════════════════════════════ */
.option-toggle {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.option-btn {
  flex: 1;
  padding: 11px;
  text-align: center;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.18s;
  font-family: inherit;
}

.option-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ══════════════════════════════════════════
   Switch Row (password generator)
══════════════════════════════════════════ */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #cbd5e1;
  border-radius: 24px;
  transition: 0.25s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

input:checked + .slider { background: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

[dir="rtl"] input:checked + .slider:before { transform: translateX(-20px); }

/* ══════════════════════════════════════════
   Row Layout
══════════════════════════════════════════ */
.row { display: flex; gap: 14px; }
.row > * { flex: 1; min-width: 0; }

/* ══════════════════════════════════════════
   Pro / Buy Section (diet)
══════════════════════════════════════════ */
.pro-section {
  margin-top: 22px;
  border: 2px solid var(--warning-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
  position: relative;
  overflow: hidden;
}

.pro-section::before {
  content: '⭐';
  position: absolute;
  top: -10px;
  font-size: 80px;
  opacity: 0.06;
  right: 10px;
  pointer-events: none;
}

.pro-title {
  font-weight: 800;
  color: var(--warning-text);
  font-size: 16px;
  margin-bottom: 12px;
}

.pro-list {
  font-size: 13px;
  color: #78350f;
  list-style: none;
  margin-bottom: 16px;
}

.pro-list li {
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-list li::before { content: '✓'; color: var(--green); font-weight: 800; }

.pro-price {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: -0.5px;
}

.btn-buy {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #451a03;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  width: 100%;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(245,158,11,0.4);
  letter-spacing: 0.2px;
}

.btn-buy:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245,158,11,0.5);
}

/* ══════════════════════════════════════════
   About / Contact Prose
══════════════════════════════════════════ */
.prose p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px;
  line-height: 1.85;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid var(--primary);
}

/* ══════════════════════════════════════════
   Password Output
══════════════════════════════════════════ */
.password-output {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.password-output input {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  text-align: center;
  letter-spacing: 2px;
  background: var(--surface-2);
}

.copy-btn {
  padding: 0 16px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.18s;
}

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

.copy-msg {
  text-align: center;
  font-size: 13px;
  color: var(--green);
  height: 20px;
  margin-bottom: 8px;
  font-weight: 700;
}

/* ══════════════════════════════════════════
   Footer
══════════════════════════════════════════ */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 56px 28px 32px;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.footer-brand-block .footer-brand {
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-bottom: 10px;
}

.footer-brand::before { content: '⚡'; -webkit-text-fill-color: initial; }

.footer-brand-block p {
  font-size: 14px;
  line-height: 1.65;
  max-width: 240px;
  color: #64748b;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 800;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  color: #64748b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 9px;
  transition: color 0.15s;
}

.footer-col a:hover { color: #93c5fd; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy { font-size: 13px; color: #475569; }

.footer-langs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-langs span {
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 3px 10px;
  border-radius: 100px;
  color: #64748b;
}

/* Simple footer fallback for tool pages */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 10px;
}

.footer-links a {
  color: #64748b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s;
}

.footer-links a:hover { color: #93c5fd; }
.footer-copy-simple { font-size: 13px; color: #475569; text-align: center; }

/* ══════════════════════════════════════════
   Responsive
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero { padding: 64px 20px 80px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 16px; }
  .tools-section { padding: 40px 18px 56px; }
  .stats-row { gap: 28px; padding: 28px 18px; }
  .stat-item-val { font-size: 26px; }
  .footer-top { flex-direction: column; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 520px) {
  .nav-container { padding: 0 16px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 7px 8px; font-size: 12px; }
  .signup-nav-btn { padding: 7px 10px; font-size: 12px; }
  .tool-page { padding: 28px 16px 56px; }
  .card { padding: 28px 20px; }
  .result-value { font-size: 38px; }
  .hero h1 { font-size: 28px; }
  .hero-label { font-size: 12px; }
  .tools-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .tool-card { padding: 18px 14px; }
}

/* ══════════════════════════════════════════
   Dark Mode
══════════════════════════════════════════ */
html.dark {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1a2233;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-light: #6e7681;
  --border: #30363d;
  --border-focus: #388bfd;
  --primary-light: rgba(56,139,253,0.15);
  --accent-light: rgba(188,140,252,0.12);
  --primary-glow: rgba(56,139,253,0.25);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.45);
  --shadow:    0 4px 16px rgba(0,0,0,0.5);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.55);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.6);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.65);
  --success-bg: rgba(35,134,54,0.15);
  --success-border: #2ea043;
  --success-text: #56d364;
  --warning-bg: rgba(187,128,9,0.15);
  --warning-border: #bb8009;
  --warning-text: #e3b341;
  --danger-bg: rgba(218,54,51,0.15);
  --danger-border: #da3633;
  --danger-text: #ff7b72;
}
html.dark .navbar {
  background: rgba(13,17,23,0.96);
  border-bottom-color: #30363d;
}
html.dark .card {
  border-color: #30363d;
  background: var(--surface);
}
html.dark .card::before { opacity: 0.7; }
html.dark .stats-row { background: var(--surface); border-color: #30363d; }
html.dark .hero::after { background: var(--bg); }
html.dark .stat-box { background: linear-gradient(145deg, #1a2233, #161b22); }
html.dark .tool-card { background: var(--surface); border-color: #30363d; }
html.dark .tool-card:hover { border-color: #388bfd; box-shadow: 0 16px 40px rgba(0,0,0,0.5); }
html.dark .page-header a { background: var(--surface); border-color: #30363d; }
html.dark .lang-menu { background: var(--surface); border-color: #30363d; }
html.dark .lang-menu a:hover { background: var(--primary-light); }
html.dark .tab.active { background: var(--bg); }
html.dark .tab { color: var(--text-muted); }
html.dark input:focus, html.dark select:focus, html.dark textarea:focus { background: var(--bg); }
html.dark .pro-section {
  background: linear-gradient(145deg, rgba(187,128,9,0.08), rgba(180,90,0,0.05));
  border-color: #bb8009;
}
html.dark .footer { background: #010409; }
html.dark .prose p { background: var(--surface); }
html.dark .btn-secondary { background: var(--surface-2); border-color: var(--border); }
html.dark .password-output input { background: var(--surface-2); }
html.dark .copy-btn { background: var(--surface-2); border-color: var(--border); }

/* Dark mode toggle button */
.dark-toggle {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  transition: all 0.18s;
  line-height: 1;
  color: var(--text);
}
.dark-toggle:hover { background: var(--primary-light); border-color: var(--primary); }

/* ══════════════════════════════════════════
   Homepage Search Bar
══════════════════════════════════════════ */
.tools-search-wrap {
  max-width: 480px;
  margin: 0 auto 28px;
  position: relative;
}
.tools-search-wrap svg {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  inset-inline-start: 16px;
  width: 18px; height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
#toolSearch {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.18s, box-shadow 0.18s;
  box-shadow: var(--shadow-sm);
  margin-top: 0;
}
[dir="rtl"] #toolSearch { padding: 13px 44px 13px 16px; }
#toolSearch:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.search-no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 15px;
  display: none;
}
.search-no-results .no-results-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }

/* ══════════════════════════════════════════
   Homepage Category Filter Tabs
══════════════════════════════════════════ */
.cat-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.cat-tab {
  padding: 8px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cat-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.tool-card[style*="display:none"], .tool-card.hidden { display: none !important; }

/* ══════════════════════════════════════════
   Related Tools Section
══════════════════════════════════════════ */
.related-tools {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.related-tools h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}
.related-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.related-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.18s;
  flex: 1;
  min-width: 140px;
  justify-content: center;
}
/* Favorite star button */
.fav-star {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 2;
}
.fav-star:hover, .fav-star.fav-active { opacity: 1; transform: scale(1.2); }
.fav-star.fav-active { color: #f59e0b; }

.related-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════════════════
   PWA Install Banner
══════════════════════════════════════════ */
.pwa-banner {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-xl);
  z-index: 8888;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeDown 0.25s ease;
}
.pwa-banner-title { font-weight: 800; font-size: 14px; color: var(--text); }
.pwa-banner-sub { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pwa-banner-btns { display: flex; gap: 8px; }
.pwa-install-btn {
  flex: 1;
  padding: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.pwa-dismiss-btn {
  padding: 9px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .cat-tabs { gap: 6px; }
  .cat-tab { padding: 7px 14px; font-size: 12px; }
  .dark-toggle { padding: 7px 8px; font-size: 14px; }
  .related-link { min-width: 120px; font-size: 12px; }
  .pwa-banner { inset-inline-end: 12px; bottom: 12px; max-width: calc(100vw - 24px); }
}
