/* ==========================================================================
   AI SEO NEGARNOVIN — frontend.css  (v3.4.0)
   FAQ accordion + TL;DR + AI link glassmorphism button + dark mode.

   v3.4.0 CHANGES:
   - FAQ: hide default <summary> marker (::-webkit-details-marker)
   - FAQ: smooth max-height transition for open/close
   - FAQ: first item open by default (via JS)
   - AI button: stronger !important rules (survives theme conflicts)
   - AI button: better dark mode (auto + manual + force)
   - AI button: z-index 2147483000 (max, above everything)
   ========================================================================== */

/* ===== FAQ Accordion ===== */
.aiseo-nv-faq {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(4px);
}
.aiseo-nv-faq-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}
.aiseo-nv-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Each FAQ item — uses native <details>/<summary>. */
.aiseo-nv-faq-item {
  border-bottom: 1px solid rgba(100, 116, 139, 0.15);
  padding: 0;
  margin: 0;
}
.aiseo-nv-faq-item:last-child {
  border-bottom: none;
}

/* Hide default <summary> triangle marker in all browsers. */
.aiseo-nv-faq-q {
  display: flex !important;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0 !important;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
  list-style: none !important;
  transition: color 0.2s ease;
  user-select: none;
}
.aiseo-nv-faq-q::-webkit-details-marker,
.aiseo-nv-faq-q::marker {
  display: none !important;
  content: '' !important;
}
.aiseo-nv-faq-q::before {
  content: '+' !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.aiseo-nv-faq-q:hover {
  color: #0ea5e9;
}

/* Rotate + to × when open. */
details.aiseo-nv-faq-item[open] > .aiseo-nv-faq-q::before {
  transform: rotate(135deg);
}

/* Answer — animated reveal. */
.aiseo-nv-faq-a {
  padding: 0 0 1rem 2rem !important;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.8;
  overflow: hidden;
}
.aiseo-nv-faq-a p {
  margin: 0 0 0.5rem;
}
.aiseo-nv-faq-a p:last-child {
  margin-bottom: 0;
}

/* ===== TL;DR Block ===== */
.aiseo-nv-tldr {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(6, 182, 212, 0.05));
  border-right: 4px solid #0ea5e9;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.aiseo-nv-tldr h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0369a1;
}
.aiseo-nv-tldr p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ==========================================================================
   AI Link — Glassmorphism Button (bulletproof, survives theme conflicts)
   v3.6.0: Smaller, opacity 40% (more transparent/subtle as user requested).
   Positioned: fixed, bottom-left, z-index max.
   ========================================================================== */
.aiseo-nv-ai-link {
  position: fixed !important;
  bottom: 1.5rem !important;
  left: 1.5rem !important;
  right: auto !important;
  top: auto !important;
  z-index: 2147483000 !important;
  /* v3.6.0: Smaller padding + font */
  padding: 0.4rem 0.9rem !important;
  /* v3.6.0: opacity 40% — more subtle/transparent as requested */
  background: rgba(14, 165, 233, 0.4) !important;
  backdrop-filter: blur(12px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
  color: #fff !important;
  border-radius: 50px !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow:
    0 2px 12px rgba(14, 165, 233, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  letter-spacing: 0.01em !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif !important;
  white-space: nowrap !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  text-transform: none !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
  opacity: 0.85 !important;
}
.aiseo-nv-ai-link:hover {
  background: rgba(14, 165, 233, 0.65) !important;
  opacity: 1 !important;
  transform: translateY(-1px) !important;
  box-shadow:
    0 4px 20px rgba(14, 165, 233, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}
.aiseo-nv-ai-link:active {
  transform: translateY(0) !important;
}
/* Pulsing green dot — smaller to match button. */
.aiseo-nv-ai-link::before {
  content: '' !important;
  width: 6px !important;
  height: 6px !important;
  background: #22c55e !important;
  border-radius: 50% !important;
  animation: aiseo-pulse 2s infinite !important;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5) !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}
@keyframes aiseo-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ==========================================================================
   DARK MODE
   Auto: prefers-color-scheme: dark
   Manual: body.dark, [data-theme="dark"], .aiseo-dark, .aiseo-force-dark
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  .aiseo-nv-ai-link:not(.aiseo-light-force) {
    background: rgba(56, 189, 248, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow:
      0 4px 24px rgba(56, 189, 248, 0.25),
      0 1px 2px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  }
  .aiseo-nv-ai-link:not(.aiseo-light-force):hover {
    background: rgba(56, 189, 248, 0.6) !important;
  }
  .aiseo-nv-faq {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
  }
  .aiseo-nv-faq-title {
    color: #f1f5f9 !important;
  }
  .aiseo-nv-faq-q {
    color: #e2e8f0 !important;
  }
  .aiseo-nv-faq-q:hover {
    color: #38bdf8 !important;
  }
  .aiseo-nv-faq-a {
    color: #94a3b8 !important;
  }
  .aiseo-nv-faq-item {
    border-bottom-color: rgba(148, 163, 184, 0.15) !important;
  }
  .aiseo-nv-tldr {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(6, 182, 212, 0.08)) !important;
    border-right-color: #38bdf8 !important;
  }
  .aiseo-nv-tldr h3 {
    color: #7dd3fc !important;
  }
}

/* Manual dark mode via body class / data attribute / force.
   v3.6.0: Added more theme-specific dark mode selectors for better
   compatibility with popular themes (Elementor Dark, Astra Dark, etc.). */
body.dark .aiseo-nv-ai-link,
body[data-theme="dark"] .aiseo-nv-ai-link,
body[class*="dark"] .aiseo-nv-ai-link,
html.dark .aiseo-nv-ai-link,
html[data-theme="dark"] .aiseo-nv-ai-link,
.aiseo-dark .aiseo-nv-ai-link,
.aiseo-nv-ai-link.aiseo-force-dark {
  background: rgba(56, 189, 248, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow:
    0 2px 12px rgba(56, 189, 248, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  opacity: 0.85 !important;
}
body.dark .aiseo-nv-faq,
body[data-theme="dark"] .aiseo-nv-faq,
body[class*="dark"] .aiseo-nv-faq,
html.dark .aiseo-nv-faq,
html[data-theme="dark"] .aiseo-nv-faq,
.aiseo-dark .aiseo-nv-faq {
  background: rgba(15, 23, 42, 0.6) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}
body.dark .aiseo-nv-faq-title,
body[data-theme="dark"] .aiseo-nv-faq-title,
body[class*="dark"] .aiseo-nv-faq-title,
html.dark .aiseo-nv-faq-title,
html[data-theme="dark"] .aiseo-nv-faq-title,
.aiseo-dark .aiseo-nv-faq-title {
  color: #f1f5f9 !important;
}
body.dark .aiseo-nv-faq-q,
body[data-theme="dark"] .aiseo-nv-faq-q,
body[class*="dark"] .aiseo-nv-faq-q,
html.dark .aiseo-nv-faq-q,
html[data-theme="dark"] .aiseo-nv-faq-q,
.aiseo-dark .aiseo-nv-faq-q {
  color: #e2e8f0 !important;
}
body.dark .aiseo-nv-faq-a,
body[data-theme="dark"] .aiseo-nv-faq-a,
body[class*="dark"] .aiseo-nv-faq-a,
html.dark .aiseo-nv-faq-a,
html[data-theme="dark"] .aiseo-nv-faq-a,
.aiseo-dark .aiseo-nv-faq-a {
  color: #94a3b8 !important;
}
body.dark .aiseo-nv-faq-item,
body[data-theme="dark"] .aiseo-nv-faq-item,
body[class*="dark"] .aiseo-nv-faq-item,
html.dark .aiseo-nv-faq-item,
html[data-theme="dark"] .aiseo-nv-faq-item,
.aiseo-dark .aiseo-nv-faq-item {
  border-bottom-color: rgba(148, 163, 184, 0.15) !important;
}

/* Responsive: smaller on mobile. */
@media (max-width: 480px) {
  .aiseo-nv-ai-link {
    bottom: 1rem !important;
    left: 1rem !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.75rem !important;
  }
  .aiseo-nv-faq {
    padding: 1rem !important;
  }
}

/* Respect reduced motion preference. */
@media (prefers-reduced-motion: reduce) {
  .aiseo-nv-ai-link::before {
    animation: none !important;
  }
  .aiseo-nv-ai-link {
    transition: none !important;
  }
  .aiseo-nv-faq-q::before {
    transition: none !important;
  }
}

/* ============================================================================
 * v19.0.0 FIX 22: Dark mode support for FAQ / Collapse blocks
 *
 * Two activation modes:
 *   1. Browser dark mode: @media (prefers-color-scheme: dark)
 *   2. Bootstrap / theme dark mode: [data-bs-theme="dark"] selector
 *   3. Site's own dark mode class: .aiseo-dark on body/html
 *
 * Google Lighthouse / modern themes use any of these — we cover all three.
 * ========================================================================== */

@media (prefers-color-scheme: dark) {
  .aiseo-nv-faq,
  .aiseo-nv-collapse {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
    border-color: #333 !important;
  }
  .aiseo-nv-faq summary,
  .aiseo-nv-collapse summary,
  .aiseo-nv-faq-q,
  .aiseo-nv-collapse-q {
    color: #e0e0e0 !important;
  }
  .aiseo-nv-faq summary:hover,
  .aiseo-nv-collapse summary:hover {
    background: rgba(255, 255, 255, 0.05) !important;
  }
  .aiseo-nv-faq-item,
  .aiseo-nv-collapse-item {
    border-bottom-color: rgba(148, 163, 184, 0.2) !important;
  }
}

/* Bootstrap 5.3+ data-bs-theme="dark" attribute (applied to <html> or <body>). */
html[data-bs-theme="dark"] .aiseo-nv-faq,
html[data-bs-theme="dark"] .aiseo-nv-collapse,
body[data-bs-theme="dark"] .aiseo-nv-faq,
body[data-bs-theme="dark"] .aiseo-nv-collapse,
.aiseo-dark .aiseo-nv-faq,
.aiseo-dark .aiseo-nv-collapse {
  background: #1a1a1a !important;
  color: #e0e0e0 !important;
  border-color: #333 !important;
}

html[data-bs-theme="dark"] .aiseo-nv-faq summary,
html[data-bs-theme="dark"] .aiseo-nv-collapse summary,
body[data-bs-theme="dark"] .aiseo-nv-faq summary,
body[data-bs-theme="dark"] .aiseo-nv-collapse summary,
.aiseo-dark .aiseo-nv-faq summary,
.aiseo-dark .aiseo-nv-collapse summary {
  color: #e0e0e0 !important;
}

/* ============================================================================
 * v25.1 FIX-EEAT-BOX: "About the Author" card
 *
 * - Class-based (no inline styles) so dark-mode rules can override cleanly.
 * - Light theme: gradient #f8fafc → #f1f5f9, text #1e293b.
 * - Dark theme: solid #1e293b, text #e2e8f0. Triggered by either:
 *     1. Browser/OS dark mode  → @media (prefers-color-scheme: dark)
 *     2. Hostim theme toggle  → [data-bs-theme="dark"] on <html> or <body>
 *
 * NOTE: We deliberately use !important on the dark-mode colors because the
 * Hostim theme loads its CSS AFTER the plugin's frontend.css (themes
 * typically register at priority 10, plugins at default 10 — order varies).
 * !important guarantees the dark palette wins regardless of load order.
 * ========================================================================== */

.aiseo-eeat-author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  margin: 32px 0 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  direction: rtl;
  text-align: right;
  box-sizing: border-box;
}

.aiseo-eeat-author-avatar {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: #cbd5e1;
}
.aiseo-eeat-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.aiseo-eeat-author-info {
  flex: 1;
  min-width: 0;
}

.aiseo-eeat-author-eyebrow {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 2px;
  font-weight: 600;
}

.aiseo-eeat-author-name-row {
  margin-bottom: 4px;
}

.aiseo-eeat-author-name {
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}

.aiseo-eeat-author-jobtitle {
  color: #475569;
  font-size: 0.9rem;
  margin-right: 8px;
}

.aiseo-eeat-author-bio {
  margin: 0 0 8px;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.6;
}

.aiseo-eeat-author-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.aiseo-eeat-author-badge {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 500;
}

.aiseo-eeat-author-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
}

.aiseo-eeat-author-social-link {
  color: #0369a1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.aiseo-eeat-author-social-link:hover {
  text-decoration: underline;
}

/* --- Dark mode (auto / system) --- */
@media (prefers-color-scheme: dark) {
  .aiseo-eeat-author-box {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
  }
  .aiseo-eeat-author-avatar {
    background: #334155 !important;
  }
  .aiseo-eeat-author-eyebrow {
    color: #94a3b8 !important;
  }
  .aiseo-eeat-author-name {
    color: #e2e8f0 !important;
  }
  .aiseo-eeat-author-jobtitle {
    color: #94a3b8 !important;
  }
  .aiseo-eeat-author-bio {
    color: #94a3b8 !important;
  }
  .aiseo-eeat-author-badge {
    background: #334155 !important;
    color: #60a5fa !important;
  }
  .aiseo-eeat-author-social-link {
    color: #60a5fa !important;
  }
  .aiseo-eeat-author-social-link:hover {
    color: #93c5fd !important;
  }
}

/* --- Dark mode (Hostim theme toggle: [data-bs-theme="dark"]) ---
   Also covers body.dark / html.dark / .aiseo-dark for theme compat. */
html[data-bs-theme="dark"] .aiseo-eeat-author-box,
body[data-bs-theme="dark"] .aiseo-eeat-author-box,
body.dark .aiseo-eeat-author-box,
html.dark .aiseo-eeat-author-box,
.aiseo-dark .aiseo-eeat-author-box {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

html[data-bs-theme="dark"] .aiseo-eeat-author-avatar,
body[data-bs-theme="dark"] .aiseo-eeat-author-avatar,
body.dark .aiseo-eeat-author-avatar,
html.dark .aiseo-eeat-author-avatar,
.aiseo-dark .aiseo-eeat-author-avatar {
  background: #334155 !important;
}

html[data-bs-theme="dark"] .aiseo-eeat-author-eyebrow,
body[data-bs-theme="dark"] .aiseo-eeat-author-eyebrow,
body.dark .aiseo-eeat-author-eyebrow,
html.dark .aiseo-eeat-author-eyebrow,
.aiseo-dark .aiseo-eeat-author-eyebrow {
  color: #94a3b8 !important;
}

html[data-bs-theme="dark"] .aiseo-eeat-author-name,
body[data-bs-theme="dark"] .aiseo-eeat-author-name,
body.dark .aiseo-eeat-author-name,
html.dark .aiseo-eeat-author-name,
.aiseo-dark .aiseo-eeat-author-name {
  color: #e2e8f0 !important;
}

html[data-bs-theme="dark"] .aiseo-eeat-author-jobtitle,
body[data-bs-theme="dark"] .aiseo-eeat-author-jobtitle,
body.dark .aiseo-eeat-author-jobtitle,
html.dark .aiseo-eeat-author-jobtitle,
.aiseo-dark .aiseo-eeat-author-jobtitle {
  color: #94a3b8 !important;
}

html[data-bs-theme="dark"] .aiseo-eeat-author-bio,
body[data-bs-theme="dark"] .aiseo-eeat-author-bio,
body.dark .aiseo-eeat-author-bio,
html.dark .aiseo-eeat-author-bio,
.aiseo-dark .aiseo-eeat-author-bio {
  color: #94a3b8 !important;
}

html[data-bs-theme="dark"] .aiseo-eeat-author-badge,
body[data-bs-theme="dark"] .aiseo-eeat-author-badge,
body.dark .aiseo-eeat-author-badge,
html.dark .aiseo-eeat-author-badge,
.aiseo-dark .aiseo-eeat-author-badge {
  background: #334155 !important;
  color: #60a5fa !important;
}

html[data-bs-theme="dark"] .aiseo-eeat-author-social-link,
body[data-bs-theme="dark"] .aiseo-eeat-author-social-link,
body.dark .aiseo-eeat-author-social-link,
html.dark .aiseo-eeat-author-social-link,
.aiseo-dark .aiseo-eeat-author-social-link {
  color: #60a5fa !important;
}

/* Mobile: smaller avatar + tighter padding. */
@media (max-width: 480px) {
  .aiseo-eeat-author-box {
    padding: 14px 12px;
    gap: 12px;
  }
  .aiseo-eeat-author-avatar {
    width: 48px;
    height: 48px;
  }
  .aiseo-eeat-author-name {
    font-size: 0.98rem;
  }
}
