/* ==========================================================================
   مِفْتَاح (Miftah Tools) - Core Design System & Responsive Stylesheet
   Eye-friendly Royal Blue (#2563EB) & Teal (#0D9488) on Snow White (#F8FAFC)
   Full Dark Mode (#0F172A), RTL Arabic Typography, Floating SVG Icons,
   and Strict Google AdSense Compliance (>= 24px safety margins).
   ========================================================================== */

:root {
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-hero-grad: radial-gradient(circle at 85% 15%, rgba(37, 99, 235, 0.09), transparent 45%),
                  radial-gradient(circle at 15% 85%, rgba(13, 148, 136, 0.09), transparent 45%),
                  linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);

  --text-main: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --accent: #0D9488;
  --accent-hover: #0F766E;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --warning: #D97706;
  --danger: #DC2626;
  --success: #059669;

  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(37, 99, 235, 0.12);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-body: 'Tajawal', 'Cairo', system-ui, -apple-system, sans-serif;
  --font-heading: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;

  --container-max: 1200px;
  --header-height: 74px;
  --transition: 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg-page: #0F172A;
  --bg-card: #1E293B;
  --bg-subtle: #162032;
  --bg-glass: rgba(15, 23, 42, 0.88);
  --bg-hero-grad: radial-gradient(circle at 85% 15%, rgba(59, 130, 246, 0.16), transparent 45%),
                  radial-gradient(circle at 15% 85%, rgba(20, 184, 166, 0.14), transparent 45%),
                  linear-gradient(180deg, #0B1221 0%, #0F172A 100%);

  --text-main: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --primary: #3B82F6;
  --primary-hover: #60A5FA;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --accent: #14B8A6;
  --accent-hover: #2DD4BF;
  --accent-soft: rgba(20, 184, 166, 0.16);

  --border: #334155;
  --border-strong: #475569;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.45);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.35;
  margin-top: 0;
  font-weight: 700;
}

p {
  margin-top: 0;
  color: var(--text-secondary);
}

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

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

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-svg {
  height: 44px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  inset-inline: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px 24px;
  box-shadow: var(--shadow-md);
  z-index: 99;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav .nav-link {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Hero Section & Floating SVG Icons
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-hero-grad);
  border-bottom: 1px solid var(--border);
  padding: 64px 0 72px;
}

.hero-floating-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.float-icon {
  position: absolute;
  color: var(--primary);
  opacity: 0.11;
  will-change: transform;
  animation: miftahFloat 9s ease-in-out infinite;
}

.float-icon.teal {
  color: var(--accent);
}

.float-icon.fi-1 { top: 12%; right: 7%; width: 54px; animation-duration: 8.5s; animation-delay: 0s; }
.float-icon.fi-2 { top: 20%; left: 8%; width: 48px; animation-duration: 10s; animation-delay: -2s; }
.float-icon.fi-3 { bottom: 18%; right: 12%; width: 44px; animation-duration: 9.5s; animation-delay: -4s; }
.float-icon.fi-4 { bottom: 15%; left: 11%; width: 52px; animation-duration: 11s; animation-delay: -1.5s; }
.float-icon.fi-5 { top: 52%; right: 3%; width: 38px; animation-duration: 8s; animation-delay: -3s; }
.float-icon.fi-6 { top: 48%; left: 3%; width: 40px; animation-duration: 10.5s; animation-delay: -5s; }

@keyframes miftahFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-16px) rotate(5deg);
  }
}

@keyframes miftahFloatSubtle {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) rotate(3deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .float-icon,
  .card-float-accent {
    animation: none !important;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

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

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* Search Box */
.hero-search-wrap {
  position: relative;
  max-width: 620px;
  margin: 0 auto 24px;
}

.hero-search-input {
  width: 100%;
  padding: 16px 52px 16px 20px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow-md);
}

.hero-search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-subtle);
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear-btn.visible {
  display: inline-flex;
}

/* Trust Pillars */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-item svg {
  color: var(--accent);
}

/* ==========================================================================
   Category Filter Pills & Sections
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 28px 0 12px;
}

.filter-pill {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.section-block {
  padding: 36px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon-badge.teal {
  background: var(--accent-soft);
  color: var(--accent);
}

.section-title {
  font-size: 1.45rem;
  margin-bottom: 2px;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

/* ==========================================================================
   Interactive Tool Cards
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.tool-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.35);
}

.card-float-accent {
  position: absolute;
  left: -8px;
  bottom: -8px;
  width: 72px;
  height: 72px;
  color: var(--primary);
  opacity: 0.055;
  pointer-events: none;
  animation: miftahFloatSubtle 7s ease-in-out infinite;
  transition: opacity var(--transition);
}

.tool-card:hover .card-float-accent {
  opacity: 0.11;
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-icon.teal {
  background: var(--accent-soft);
  color: var(--accent);
}

.tool-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.tool-card h3 {
  font-size: 1.15rem;
  margin: 2px 0 0;
  color: var(--text-main);
}

.tool-card p {
  font-size: 0.94rem;
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
}

.tool-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary);
  margin-top: 6px;
}

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

.tool-card-cta svg {
  transition: transform var(--transition);
}

/* ==========================================================================
   Strict Google AdSense Compliant Ad Slots (Minimum 24px Safety Margin!)
   ========================================================================== */
.ad-slot-wrapper {
  margin: 32px auto; /* Strictly >= 24px safety margin from all interactive UI */
  padding: 14px 16px 18px;
  max-width: 100%;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  text-align: center;
  clear: both;
}

.ad-slot-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.ad-slot-box {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px;
}

.ad-slot-box.ad-mid {
  min-height: 120px;
}

/* ==========================================================================
   Tool Page Layout, Forms, Inputs, Buttons, Tabs & Results
   ========================================================================== */
.page-hero {
  background: var(--bg-hero-grad);
  border-bottom: 1px solid var(--border);
  padding: 36px 0 32px;
  position: relative;
  overflow: hidden;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

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

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

.page-hero h1 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  margin-bottom: 10px;
}

.page-hero p {
  font-size: 1.02rem;
  max-width: 720px;
  margin-bottom: 0;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.tool-workspace {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-top: 28px;
}

.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-weight: 700;
  font-size: 0.93rem;
  color: var(--text-main);
}

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

.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-page);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.btn-accent {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-whatsapp {
  background: #16A34A;
  color: #FFFFFF;
}

.btn-whatsapp:hover {
  background: #15803D;
  color: #FFFFFF;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.88rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--bg-card);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
}

/* Result Cards & KPI Grid */
.results-box {
  margin-top: 26px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.kpi-card.highlight {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--bg-card));
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Data Tables */
.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-main);
}

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

/* Quick Share Bar */
.share-bar {
  margin-top: 28px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.share-bar-title {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text-main);
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   Rich SEO Content & FAQ Section (Below Every Tool)
   ========================================================================== */
.seo-content-section {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-xs);
}

.seo-content-section h2 {
  font-size: 1.4rem;
  margin-top: 26px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-soft);
}

.seo-content-section h2:first-child {
  margin-top: 0;
}

.seo-content-section h3 {
  font-size: 1.12rem;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--primary);
}

.seo-content-section ul,
.seo-content-section ol {
  padding-right: 22px;
  color: var(--text-secondary);
}

.seo-content-section li {
  margin-bottom: 8px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  overflow: hidden;
}

.faq-item summary {
  padding: 15px 18px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-main);
}

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

.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 700;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 18px 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==========================================================================
   Blog & Articles
   ========================================================================== */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.article-banner {
  height: 150px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #FFFFFF;
  background: linear-gradient(135deg, #2563EB, #0D9488);
  position: relative;
}

.article-banner.teal-theme {
  background: linear-gradient(135deg, #0D9488, #0284C7);
}

.article-banner.indigo-theme {
  background: linear-gradient(135deg, #1D4ED8, #4F46E5);
}

.article-cat-pill {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.article-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.article-prose {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  font-size: 1.04rem;
  line-height: 1.9;
}

.article-prose h2 {
  margin-top: 32px;
  margin-bottom: 14px;
  font-size: 1.45rem;
}

.article-prose h3 {
  margin-top: 22px;
  margin-bottom: 10px;
  font-size: 1.16rem;
  color: var(--primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 56px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 48px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}

.footer-col h4 {
  font-size: 1.02rem;
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.93rem;
}

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

.footer-bottom {
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Cookie Consent Banner & Toast
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  inset-inline: 20px;
  max-width: 920px;
  margin-inline: auto;
  z-index: 999;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: slideUpCookie 0.35s ease;
}

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

.cookie-text {
  flex: 1;
  min-width: 240px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cookie-text strong {
  color: var(--text-main);
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.miftah-toast {
  position: fixed;
  bottom: 26px;
  left: 26px;
  z-index: 1050;
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all 0.25s ease;
}

[data-theme="dark"] .miftah-toast {
  background: #F1F5F9;
  color: #0F172A;
}

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

/* Utility Alerts & Badges */
.alert-box {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.alert-info {
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--text-main);
}

.alert-success {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.3);
  color: var(--text-main);
}

.alert-warning {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.3);
  color: var(--text-main);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .hero {
    padding: 44px 0 52px;
  }
  .float-icon.fi-5,
  .float-icon.fi-6 {
    display: none;
  }
  .tool-workspace,
  .seo-content-section,
  .article-prose {
    padding: 20px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .cookie-banner {
    bottom: 12px;
    inset-inline: 12px;
  }
}
