/* Enhanced TOC Title Styling */
.toc-heading {
  background: linear-gradient(135deg, #0a4275 0%, #1e40af 100%);
  color: white !important;
  padding: 1rem 1.5rem !important;
  margin: 0 0 1rem 0 !important;
  border-radius: 12px 12px 0 0 !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border: none !important;
  position: relative;
  overflow: hidden;
}

.toc-heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.toc-heading::after {
  content: "📋";
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  opacity: 0.8;
}

/* Enhanced Responsive TOC Styles */
.toc-container {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  padding: 0.75rem;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

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

.toc-entry {
  display: flex;
  flex-direction: column;
  padding: 0.375rem 0.625rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.toc-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-color: #0a4275;
}

.toc-link {
  color: #0a4275;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.4;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.toc-link:hover {
  color: #1e40af;
}

.toc-description {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  padding-left: 0;
}

/* Desktop and wider screens - single line layout */
@media (min-width: 768px) {
  .toc-entry {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.5rem 0.875rem;
  }
  
  .toc-link {
    min-width: 280px;
    flex-shrink: 0;
  }
  
  .toc-description {
    margin-top: 0;
    flex: 1;
    padding-left: 1rem;
    border-left: 2px solid #e5e7eb;
  }
  
  .toc-description::before {
    content: "";
  }
}

/* Large desktop screens - even better spacing */
@media (min-width: 1024px) {
  .toc-link {
    min-width: 320px;
  }
  
  .toc-description {
    padding-left: 1.5rem;
  }
}

/* Mobile and smaller screens - separate lines */
@media (max-width: 767px) {
  .toc-container {
    padding: 0.5rem;
  }

  .toc-heading {
    font-size: 1.25rem !important;
    padding: 0.875rem 1.25rem !important;
  }

  .toc-heading::after {
    right: 1.25rem;
    font-size: 1.1rem;
  }

  .toc-list {
    padding: 0;
  }
  
  .toc-entry {
    flex-direction: column;
    padding: 0.375rem;
  }
  
  .toc-link {
    font-size: 1rem;
  }
  
  .toc-description {
    font-size: 0.9rem;
    margin-top: 0.75rem;
    padding-left: 0.5rem;
    border-left: 3px solid #0a4275;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .toc-container {
    padding: 0.375rem;
  }

  .toc-heading {
    font-size: 1.125rem !important;
    padding: 0.75rem 1rem !important;
  }

  .toc-heading::after {
    right: 1rem;
    font-size: 1rem;
  }

  .toc-list {
    padding: 0;
  }
  
  .toc-entry {
    padding: 0.375rem;
  }
  
  .toc-link {
    font-size: 0.95rem;
  }
  
  .toc-description {
    font-size: 0.85rem;
    padding: 0.5rem;
  }
}

/* Simple TOC styling for pages without descriptions */
.toc-list li:not(.toc-item) {
  margin: 0;
  padding: 0;
}

.toc-list li:not(.toc-item) a {
  display: block;
  padding: 0.375rem 0.625rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  color: #0a4275;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.toc-list li:not(.toc-item) a:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-color: #0a4275;
  color: #1e40af;
}

@media (max-width: 767px) {
  .toc-list li:not(.toc-item) a {
    font-size: 1rem;
    padding: 0.375rem;
  }
}

@media (max-width: 480px) {
  .toc-list li:not(.toc-item) a {
    font-size: 0.95rem;
  }
}
