/* Main Container - Compact & Clean */
.ez-toc-container {
  background: #fafafa;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0.8em 0;
  width: auto;
  display: inline-block;
  min-width: 220px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Title Container - Clickable */
.ez-toc-title-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease;
}

.ez-toc-title-container:hover {
  opacity: 0.85;
}

/* Title Text */
.ez-toc-title {
  font-weight: 600;
  font-size: 17px;
  color: #111;
  margin: 0;
  line-height: 1.3;
  flex: 1;
}

/* Toggle Button */
.ez-toc-toggle {
  display: inline-block;
  margin-left: 6px;
}

.ez-toc-pull-right {
  float: none;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid #aaa;
  border-radius: 3px;
  display: inline-block;
  pointer-events: none;
}

/* Toggle Icon */
.ez-toc-icon-toggle {
  display: inline-block;
  width: 14px;
  height: 10px;
  position: relative;
}

.ez-toc-icon-toggle::before,
.ez-toc-icon-toggle::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: #333;
  left: 0;
  transition: all 0.3s ease;
}

.ez-toc-icon-toggle::before { top: 2px; }
.ez-toc-icon-toggle::after { bottom: 2px; }

/* Active (X) State */
.ez-toc-toggle-icon-container.active .ez-toc-icon-toggle::before {
  transform: rotate(45deg);
  top: 4px;
}

.ez-toc-toggle-icon-container.active .ez-toc-icon-toggle::after {
  transform: rotate(-45deg);
  bottom: 4px;
}

/* TOC List */
.ez-toc-container nav {
  display: none;
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 1000px; }
}

.ez-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: item;
}

.ez-toc-list li {
  margin: 0;
  counter-increment: item;
}

.ez-toc-list li a {
  display: block;
  padding: 4px 0;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  transition: all 0.2s ease;
}

.ez-toc-list li a::before {
  content: counter(item) ". ";
  font-weight: 500;
  color: #777;
  margin-right: 3px;
}

.ez-toc-list li a:hover {
  color: #0073aa;
  padding-left: 4px;
}

.ez-toc-list li a:hover::before {
  color: #0073aa;
}

/* Responsive */
@media (max-width: 750px) {
  .ez-toc-container {
    width: 100%;
  }

  .ez-toc-title {
    font-size: 16px;
  }

  .ez-toc-list li a {
    font-size: 12.5px;
  }
}
