/* ========================================
   Features Wiki - Sidebar TOC & Bento Grid Layout
   ======================================== */

/* Material Symbols Font Setup */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

.hero-title-icon {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--seed-color);
  vertical-align: middle;
  margin-right: 0.25rem;
}

/* Fixed static navbar for features page (prevents height change / wobbling on scroll) */
.navbar,
.navbar.scrolled {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(14, 17, 23, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(33, 150, 243, 0.15);
  padding: 1rem 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: none;
}

.navbar .nav-links a:not(.cta-button-small) {
  color: var(--on-surface-variant);
}

.navbar .nav-links a:not(.cta-button-small):hover,
.navbar .nav-links a:not(.cta-button-small).nav-active {
  color: var(--seed-color);
}



/* Wiki Layout (sidebar + main) */
.wiki-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 7rem 2rem 6rem;
  align-items: stretch;
}

/* Sidebar TOC */
.wiki-toc {
  padding-right: 2rem;
  height: 100%;
}

.toc-sticky {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.toc-sticky::-webkit-scrollbar {
  width: 4px;
}

.toc-sticky::-webkit-scrollbar-thumb {
  background: rgba(33, 150, 243, 0.25);
  border-radius: 4px;
}

.toc-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
  margin-bottom: 1rem;
  -webkit-text-fill-color: var(--on-surface-variant);
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--on-surface-variant);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.toc-link::after,
.toc-link:hover::after {
  display: none !important;
  content: none !important;
  width: 0 !important;
}

.toc-link:hover {
  color: var(--on-surface);
  background: rgba(33,150,243,0.06);
  border-left-color: var(--seed-color);
}

.toc-link.toc-link-active {
  color: var(--seed-color);
  background: rgba(33,150,243,0.12);
  border-left-color: var(--seed-color);
  font-weight: 600;
}

.toc-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  color: var(--on-surface-variant);
  transition: color 0.2s ease;
}

.toc-link:hover .toc-icon,
.toc-link.toc-link-active .toc-icon {
  color: var(--seed-color);
}

.toc-plus-tag {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ff8a65;
  background: rgba(255,107,53,0.15);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.toc-cta {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  padding: 0.8rem 1.2rem;
  border-radius: 24px;
}

/* Wiki Main Content */
.wiki-main {
  min-width: 0;
  padding-left: 2.5rem;
  border-left: 1px solid rgba(33,150,243,0.08);
}

/* Section Groups */
.wiki-section-group {
  margin-bottom: 3.5rem;
  scroll-margin-top: 110px;
}

/* Hide padding and margins when section is hidden */
.wiki-section-group[style*="display: none"] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wiki-section-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.wiki-section-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  line-height: 1;
  color: var(--seed-color);
  background: rgba(33, 150, 243, 0.1);
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(33, 150, 243, 0.15);
}

.wiki-section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--on-surface);
  background: linear-gradient(135deg, var(--on-surface) 0%, var(--seed-color) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.wiki-section-subtitle {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  -webkit-text-fill-color: var(--on-surface-variant);
}

.section-plus-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #ff6b35, #ff8a65);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  align-self: center;
  box-shadow: 0 4px 15px rgba(255,107,53,0.25);
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

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

.bento-card {
  background: rgba(18, 22, 31, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--seed-color), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(33, 150, 243, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 20px rgba(33, 150, 243, 0.1);
  background: rgba(22, 28, 40, 0.8);
}

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

/* Featured Bento Card */
.bento-card-featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 2rem;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.08) 0%, rgba(18, 22, 31, 0.85) 100%);
  border-color: rgba(33, 150, 243, 0.25);
}

@media (max-width: 1000px) {
  .bento-card-featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
}

.bento-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.bento-card-header h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--on-surface);
  margin: 0;
  line-height: 1.3;
}

.bento-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  color: var(--seed-color);
  background: rgba(33, 150, 243, 0.1);
  padding: 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(33, 150, 243, 0.15);
}

.bento-card p {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  color: var(--on-surface-variant);
  line-height: 1.6;
  margin: 0;
}

.bento-card-media {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  aspect-ratio: 16 / 10;
  width: 100%;
}

.bento-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  cursor: zoom-in;
}

.bento-card:hover .bento-img {
  transform: scale(1.03);
}

/* Feature Sub Lists */
.feature-sub-list {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  color: var(--on-surface-variant);
  line-height: 1.6;
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.feature-sub-list li {
  margin-bottom: 0.3rem;
}

.bento-card code {
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.85rem;
  background: rgba(33,150,243,0.12);
  color: var(--seed-color);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* Badges */
.plus-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: rgba(255,107,53,0.15);
  color: #ff8a65;
  border: 1px solid rgba(255,107,53,0.25);
  align-self: flex-start;
  margin-left: auto;
}

.inline-plus-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255,107,53,0.15);
  color: #ff8a65;
  border: 1px solid rgba(255,107,53,0.25);
  padding: 0.1em 0.4em;
  border-radius: 10px;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

/* Section Divider inside section group */
.wiki-section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(33,150,243,0.2), transparent);
  margin-top: 3.5rem;
}

/* Shortcut Table Bento Container */
.shortcut-bento-card {
  background: rgba(18, 22, 31, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.5rem;
  overflow: hidden;
}

.shortcut-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(33,150,243,0.1);
}

.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
}

.shortcut-table thead tr {
  background: rgba(33,150,243,0.08);
}

.shortcut-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface-variant);
  border-bottom: 1px solid rgba(33,150,243,0.1);
}

.shortcut-table td {
  padding: 0.9rem 1.25rem;
  color: var(--on-surface-variant);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

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

.shortcut-table tr:hover td {
  background: rgba(33,150,243,0.04);
}

kbd {
  display: inline-block;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.78rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.15em 0.5em;
  color: var(--on-surface);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* CTA Banner */
.wiki-cta-banner {
  margin-top: 4rem;
  padding: 3.5rem;
  background: linear-gradient(135deg, rgba(33,150,243,0.12) 0%, rgba(25,118,210,0.18) 100%);
  border: 1px solid rgba(33,150,243,0.25);
  border-radius: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.wiki-cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(33,150,243,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.wiki-cta-content h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--on-surface) 0%, var(--seed-color) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wiki-cta-content p {
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  color: var(--on-surface-variant);
  margin-bottom: 2rem;
}

.wiki-cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Active nav link */
.nav-active {
  color: var(--seed-color) !important;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .wiki-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 6.5rem 1rem 4rem;
  }

  .wiki-toc {
    display: block;
    padding-right: 0;
    height: auto;
    border-bottom: 1px solid rgba(33, 150, 243, 0.12);
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
  }

  .toc-sticky {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .toc-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .toc-link {
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    border-left: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(18, 22, 31, 0.5);
    border-radius: 8px;
  }

  .toc-link.toc-link-active {
    border-color: var(--seed-color);
    background: rgba(33, 150, 243, 0.15);
  }

  .toc-cta {
    display: none;
  }

  .wiki-main {
    padding-left: 0;
    border-left: none;
  }

  .wiki-section-group {
    margin-bottom: 2.25rem;
  }

  .wiki-section-header {
    margin-bottom: 1.25rem;
    gap: 0.75rem;
  }

  .wiki-section-icon {
    font-size: 1.8rem;
    padding: 0.4rem;
  }

  .bento-grid {
    gap: 1rem;
  }

  .bento-card {
    padding: 1rem;
    gap: 0.75rem;
    border-radius: 14px;
  }

  .bento-card-featured {
    padding: 1.15rem;
    gap: 1rem;
  }

  .bento-card-media {
    max-height: 200px;
    aspect-ratio: 16 / 9;
  }

  .wiki-cta-banner {
    padding: 2rem 1.25rem;
    margin-top: 2.5rem;
  }
}

@media (max-width: 600px) {
  .wiki-layout {
    padding: 5.5rem 0.75rem 3rem;
  }

  .bento-grid {
    gap: 0.85rem;
  }

  .bento-card {
    padding: 0.85rem;
    gap: 0.6rem;
    border-radius: 12px;
  }

  .bento-card p {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .bento-card-media {
    max-height: 160px;
    aspect-ratio: 16 / 9;
  }

  .bento-icon {
    font-size: 1.3rem;
    padding: 0.35rem;
  }

  .wiki-section-divider {
    margin-top: 2.25rem;
  }
}

/* ========================================
   Image Modal
   ======================================== */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(14, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-modal.active {
  display: flex;
  opacity: 1;
}

.image-modal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 90%;
  max-height: 90%;
  width: 100%;
}

.image-modal-content {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  object-fit: contain;
}

.image-modal-caption {
  margin-top: 1.5rem;
  color: var(--on-surface);
  max-width: 800px;
  width: 100%;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
}

.image-modal-caption .bento-card-header {
  justify-content: center;
}

.image-modal-caption p,
.image-modal-caption ul {
  text-align: center;
  font-size: 1.05rem;
  color: var(--on-surface-variant);
}

.image-modal-caption ul {
  list-style: none;
  padding: 0;
}

.image-modal.active .image-modal-content,
.image-modal.active .image-modal-caption {
  transform: scale(1);
  opacity: 1;
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 40px;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10000;
}

.image-modal-close:hover {
  color: #fff;
}
