/* Interactive SEO & Topic Deep-Linking Styles */

/* 1. Heading Anchor Copy Link */
.heading-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.heading-anchor-link {
  opacity: 0;
  color: #e11d48;
  font-size: 0.75em;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(225, 29, 72, 0.12);
}

h1:hover .heading-anchor-link,
h2:hover .heading-anchor-link,
h3:hover .heading-anchor-link,
.heading-wrapper:hover .heading-anchor-link {
  opacity: 1;
}

.heading-anchor-link:hover {
  background: rgba(225, 29, 72, 0.25);
  transform: scale(1.1);
}

/* 2. Interactive Table of Contents (TOC) Container — Red Theme System */
/* LIGHT MODE (Default on Light Pages like index.html) */
.interactive-toc-container {
  background: linear-gradient(135deg, #ffffff 0%, #fff5f6 100%);
  border: 2px solid #801321;
  border-left: 5px solid #e11d48;
  border-radius: 20px;
  padding: 1.25rem 1.65rem;
  margin: 1.5rem 0 2rem 0;
  box-shadow: 0 10px 25px rgba(128, 19, 33, 0.08);
  color: #1f1610;
  transition: all 0.3s ease;
}

.interactive-toc-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(128, 19, 33, 0.15);
}

.interactive-toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.12rem;
  font-weight: 900;
  color: #801321;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(128, 19, 33, 0.15);
}

.interactive-toc-toggle {
  background: #801321;
  border: 1px solid #801321;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(128, 19, 33, 0.2);
  transition: all 0.2s ease;
}

.interactive-toc-toggle:hover {
  background: #e11d48;
  border-color: #e11d48;
  transform: scale(1.04);
}

.interactive-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.interactive-toc-item {
  margin: 0;
}

.interactive-toc-item--h2 {
  font-weight: 700;
}

.interactive-toc-item--h3 {
  font-size: 0.85rem;
}

.interactive-toc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff0f2;
  border: 1px solid #fecdd3;
  color: #801321;
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 15px;
  border-radius: 20px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(128, 19, 33, 0.05);
  transition: all 0.25s ease;
}

.interactive-toc-link:hover,
.interactive-toc-link.active-scrollspy {
  color: #ffffff !important;
  background: linear-gradient(135deg, #e11d48 0%, #801321 100%) !important;
  border-color: #e11d48 !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35) !important;
  transform: translateY(-2px) scale(1.02);
  text-decoration: none;
}

.interactive-toc-container {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-top: 3px solid #801321 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.interactive-toc-header {
  color: #801321 !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.interactive-toc-link {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

/* 3. Interactive Topic Filter Chips */
.topic-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px 0;
  align-items: center;
}

.topic-filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #801321;
  margin-right: 4px;
}

.topic-filter-chip {
  background: #fff0f2;
  color: #801321;
  border: 1px solid #fecdd3;
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topic-filter-chip:hover,
.topic-filter-chip.active {
  background: #801321;
  color: #ffffff;
  border-color: #801321;
  box-shadow: 0 2px 8px rgba(128, 19, 33, 0.3);
}

/* 4. SEO Toast Copy Notification */
.seo-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #18121b;
  color: #ffffff;
  border-left: 4px solid #e11d48;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 99999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

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

/* 5. Mobile & Tablet Responsive Optimizations */
@media (max-width: 640px) {
  .interactive-toc-container {
    padding: 0.85rem 1rem !important;
    border-radius: 10px !important;
    margin: 1rem 0 !important;
  }
  .interactive-toc-header {
    font-size: 1rem;
  }
  .interactive-toc-list {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .interactive-toc-link {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    padding: 8px 12px;
    border-radius: 8px;
  }
  .topic-filter-bar {
    gap: 6px;
  }
  .topic-filter-chip {
    padding: 6px 12px;
    font-size: 0.82rem;
  }
  .seo-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    text-align: center;
    font-size: 0.85rem;
  }
}
