/* Global Series Accordion - Professional Design */
.series-accordion-wrapper {
  max-width: 780px;
  margin: 30px auto;
  font-family: var(--e-global-typography-text-font-family), -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Main Series Header - Professional Design */
.series-main-accordion {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(103, 56, 114, 0.1);
  background: white;
  transition: all 0.3s ease;
}

.series-main-header {
  width: 100%;
  padding: 20px 24px;
  background: linear-gradient(
    135deg,
    var(--e-global-color-primary, #673872),
    var(--e-global-color-376b304, #4c3451)
  );
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.series-main-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--e-global-color-376b304, #4c3451),
    var(--e-global-color-primary, #673872)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.series-main-header:hover::before {
  opacity: 1;
}

.series-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

/* Professional List Icon */
.series-icon {
  width: 24px;
  height: 24px;
  fill: #ffffff;
  transition: all 0.3s ease;
}

.series-main-header:hover .series-icon {
  transform: scale(1.1);
}

h2.series-title {
  margin: 0;
  font-family: var(--e-global-typography-primary-font-family);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.2px;
  transition: transform 0.3s ease;
}

.series-main-header:hover .series-title {
  transform: translateX(3px);
}

.series-toggle-icon {
  font-size: 1.6rem;
  font-weight: 300;
  color: #ffffff;
  opacity: 0.9;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.series-main-header[aria-expanded="false"] .series-toggle-icon {
  transform: rotate(180deg) scale(0.95);
}

/* Series Content */
.series-main-content {
  padding: 0;
  background: var(--e-global-color-79f706c, #f1f2f5);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.series-main-content[aria-hidden="false"] {
  max-height: 5000px;
  padding: 8px;
}

/* Category Accordions */
.category-accordions-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-accordion-item {
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.category-accordion-item:hover {
  box-shadow: 0 4px 14px rgba(103, 56, 114, 0.1);
  transform: translateY(-2px);
}

.category-header {
  width: 100%;
  padding: 18px 22px;
  background: white;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border-left: 4px solid;
  position: relative;
}

/* All category headers same color */
.category-header {
  background: rgba(103, 56, 114, 0.03) !important;
  border-left-color: var(--e-global-color-376b304, #4c3451);
}

.category-header:hover {
  color: var(--e-global-color-primary, #673872);
}

.category-header[aria-expanded="true"] {
  background: rgba(103, 56, 114, 0.03);
}

.category-title {
  font-family: var(--e-global-typography-secondary-font-family);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--e-global-color-primary, #673872);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.category-post-count {
  background: var(--e-global-color-primary, #673872);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  min-width: 26px;
  text-align: center;
  transition: transform 0.3s ease;
}

.category-header:hover .category-post-count {
  transform: scale(1.05);
}

.category-toggle-icon {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--e-global-color-75d5d69, #8e7f91);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.category-header[aria-expanded="true"] .category-toggle-icon {
  transform: rotate(45deg);
  color: var(--e-global-color-primary, #673872);
}

/* Category Content */
.category-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-content[aria-hidden="false"] {
  max-height: 2000px;
}

.category-posts-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Category is current post's category - highlight entire category */
.category-accordion-item.current-post-category {
  box-shadow: 0 4px 16px rgba(103, 56, 114, 0.15);
}

.category-accordion-item.current-post-category .category-header {
  background-color: var(--e-global-color-secondary, #fecd34) !important;
  border-left-color: var(--e-global-color-text, #422447);
}

.category-accordion-item.current-post-category .category-title {
  background: rgba(103, 56, 114, 0.02);
}

.category-accordion-item.current-post-category .category-post-count {
  background: white;
  color: #422447;
}

/* Post Items - Default style for all posts */
.post-title-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  background: rgb(255 226 139);
  border-left: 3px solid var(--e-global-color-376b304, #4c3451);
}

.post-title-item:hover {
  background: rgb(253, 212, 87, 0.8);
  transform: translateX(5px);
  box-shadow: 0 3px 10px rgba(76, 52, 81, 0.1);
}

/* Posts in current category get special style */
.category-accordion-item.current-post-category .post-title-item {
  background: rgb(255 226 139);
  border-left: 3px solid var(--e-global-color-primary, #673872);
}

.category-accordion-item.current-post-category .post-title-item:hover {
  background: rgb(253, 212, 87, 1);
  transform: translateX(5px);
  box-shadow: 0 3px 12px rgba(103, 56, 114, 0.15);
}

/* Current post itself - highlight with yellow */
.post-title-item.current-post {
  background: rgba(254, 205, 52, 0.1);
  border-left: 3px solid var(--e-global-color-secondary, #fecd34);
  box-shadow: 0 2px 8px rgba(254, 205, 52, 0.15);
  position: relative;
}

.post-title-item.current-post::before {
  content: "Current";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--e-global-color-secondary, #fecd34);
  color: var(--e-global-color-text, #422447);
  border-radius: 10px;
  z-index: 1;
}

.post-title-item.current-post:hover {
  background: rgba(254, 205, 52, 0.15);
  transform: translateX(5px);
  box-shadow: 0 3px 12px rgba(254, 205, 52, 0.2);
}

.post-bullet {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(76, 52, 81, 0.1);
  color: var(--e-global-color-376b304, #4c3451);
}

/* Different bullet colors for special posts */
.category-accordion-item.current-post-category .post-bullet {
  background: rgba(103, 56, 114, 0.15);
  color: var(--e-global-color-primary, #673872);
}

.post-title-item.current-post .post-bullet {
  background: rgba(254, 205, 52, 0.2);
  color: var(--e-global-color-secondary, #fecd34);
}

.post-title-text {
  flex: 1;
  font-family: var(--e-global-typography-text-font-family);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--e-global-color-text, #422447);
  line-height: 1.4;
  transition: color 0.3s ease;
}

.post-title-item:hover .post-title-text {
  font-weight: 600;
}

/* Different text colors for special posts */
.category-accordion-item.current-post-category .post-title-text {
  color: var(--e-global-color-primary, #673872);
  font-weight: 600;
}

.post-title-item.current-post .post-title-text {
  color: var(--e-global-color-secondary, #fecd34);
  font-weight: 700;
}

.post-date {
  font-family: var(--e-global-typography-accent-font-family);
  font-size: 0.75rem;
  font-weight: 500;
  color: #000000;
  white-space: nowrap;
  padding: 2px 6px;
  background: rgba(142, 127, 145, 0.05);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.post-title-item:hover .post-date {
  background: rgba(103, 56, 114, 0.08);
}

/* Different date colors for special posts */
.category-accordion-item.current-post-category .post-date {
  background: rgba(103, 56, 114, 0.1);
  color: var(--e-global-color-primary, #673872);
}

.post-title-item.current-post .post-date {
  background: rgba(254, 205, 52, 0.1);
  color: var(--e-global-color-secondary, #fecd34);
}

/* View More Link */
.view-more-container {
  margin-top: 12px;
  text-align: center;
}

.view-more-link {
  display: inline-block;
  padding: 7px 16px;
  background: rgba(254, 205, 52, 0.1);
  color: var(--e-global-color-secondary, #fecd34);
  text-decoration: none;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.view-more-link:hover {
  background: var(--e-global-color-secondary, #fecd34);
  color: var(--e-global-color-text, #422447);
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(254, 205, 52, 0.2);
}

.view-more-link svg {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.view-more-link:hover svg {
  transform: translateX(3px);
}

/* Empty State */
.no-categories-message {
  text-align: center;
  padding: 35px 20px;
  color: var(--e-global-color-75d5d69, #8e7f91);
}

.no-categories-message svg {
  margin-bottom: 14px;
  color: var(--e-global-color-secondary, #fecd34);
  opacity: 0.7;
}

.no-categories-message p {
  margin: 0;
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
  .series-accordion-wrapper {
    margin: 18px auto;
    max-width: calc(100% - 16px);
  }

  .series-main-header {
    padding: 16px 20px;
  }

  .series-title {
    font-size: 1.2rem;
  }

  .series-main-content[aria-hidden="false"] {
    padding: 18px;
  }

  .category-header {
    padding: 14px 18px;
  }

  .category-title {
    font-size: 1.05rem;
  }

  .category-posts-list {
    padding: 0 18px 16px;
  }

  .post-title-item {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .post-title-item.current-post::before {
    position: relative;
    top: 0;
    right: 0;
    align-self: flex-end;
    margin-top: -20px;
    margin-bottom: 6px;
  }

  .post-date {
    align-self: flex-start;
    font-size: 0.7rem;
  }

  .post-bullet {
    position: absolute;
    left: 12px;
    top: 10px;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
  }

  .post-title-text {
    padding-left: 24px;
    font-size: 0.9rem;
  }

  .view-more-link {
    padding: 6px 14px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .series-header-content {
    gap: 10px;
  }

  .series-icon {
    width: 20px;
    height: 20px;
  }

  .series-title {
    font-size: 1.1rem;
  }

  .series-toggle-icon {
    font-size: 1.4rem;
  }

  .category-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .category-post-count {
    font-size: 0.75rem;
    padding: 2px 6px;
  }

  .post-title-item {
    padding: 8px 10px;
  }

  .post-title-item.current-post::before {
    font-size: 0.6rem;
    padding: 1px 4px;
  }
}
