/* Table of Contents Button */
.toc-button {
  position: fixed;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  border-radius: 0 24px 24px 0;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  box-shadow: 10px 0 25px -5px rgba(99, 102, 241, 0.4);
}

.toc-button:hover {
  left: 0;
  width: 72px;
  padding-right: 18px;
  box-shadow: 15px 0 35px -10px rgba(99, 102, 241, 0.6);
}

.toc-button i {
  font-size: 1.6rem;
  transition: transform 0.3s ease;
}

/* Enhanced Looping Ripple Effect (Water Ripple Style) */
.toc-button::before,
.toc-button::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.5);
  background: transparent;
  z-index: -1;
  pointer-events: none;
}

.toc-button::before {
  animation: water-ripple 4s infinite;
}

.toc-button::after {
  animation: water-ripple 4s infinite 2s;
}

@keyframes water-ripple {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(15);
    opacity: 0;
  }
}

/* Table of Contents Modal */
.toc-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1001;
  opacity: 0;
  transition: all 0.4s ease;
  align-items: center;
  justify-content: center;
}

.toc-modal.show {
  opacity: 1;
}

.toc-modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 32px;
  border-radius: 24px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toc-modal.show .toc-modal-content {
  transform: translateY(0) scale(1);
}

/* Custom Scrollbar */
.toc-modal-content::-webkit-scrollbar {
  width: 6px;
}
.toc-modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.toc-modal-content::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 10px;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toc-header h3 {
  margin: 0;
  font-family: 'Outfit', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #1e293b 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.toc-close {
  background: rgba(0, 0, 0, 0.03);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  color: #64748b;
  transition: all 0.3s ease;
}

.toc-close:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: rotate(90deg);
}

.toc-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-body li {
  margin-bottom: 8px;
}

.toc-body a {
  color: #475569;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border: 1px solid transparent;
}

.toc-body a i {
  font-size: 1.25rem;
  color: #6366f1;
  transition: all 0.3s ease;
}

.toc-body a span {
  flex: 1;
}

.toc-body a:hover {
  background: white;
  color: #6366f1;
  padding-left: 20px;
  border-color: rgba(99, 102, 241, 0.1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.toc-body a:hover i {
  transform: scale(1.2);
  color: #a855f7;
}

/* Dark Mode Hint */
@media (prefers-color-scheme: dark) {
  .toc-modal-content {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
  }
  .toc-header h3 {
    background: linear-gradient(135deg, #f8fafc 0%, #818cf8 100%);
    -webkit-background-clip: text;
  }
  .toc-body a {
    color: #cbd5e1;
  }
  .toc-body a:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
  }
}

/* Mobile Adjustments */
@media (max-width: 576px) {
  .toc-modal-content {
    width: 95%;
    padding: 24px;
  }
  .toc-button {
    left: -32px;
    width: 60px;
    height: 60px;
    padding-right: 8px;
  }
  .toc-button:hover {
    left: 0;
    width: 64px;
  }
} 