/**
 * AlifBee Part of Series - Styles
 * 
 * @package AlifBee_PartOfSeries
 * @version 2.1.0
 * @author Bal Elsada
 * @license GPL v2 or later
 */

/* Global Series Accordion */
.abps-v2-accordion-wrapper {
  max-width: 100% !important;
  margin: 0 auto !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
}

/* Main Series Header */
.abps-v2-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;
}

.abps-v2-main-header {
  width: 100%;
  padding: 20px 24px;
  background: linear-gradient(135deg, #673872, #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;
}

.abps-v2-main-header[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.abps-v2-main-header:hover {
  background: linear-gradient(135deg, #4c3451, #673872);
}

.abps-v2-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

/* Professional List Icon */
.abps-v2-icon {
  width: 24px;
  height: 24px;
  fill: #ffffff;
  transition: all 0.3s ease;
}

.abps-v2-main-header:hover .abps-v2-icon {
  transform: scale(1.1);
}

h2.abps-v2-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.2px;
  transition: transform 0.3s ease;
}

.abps-v2-main-header:hover .abps-v2-title {
  transform: translateX(3px);
}

.abps-v2-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;
}

.abps-v2-main-header[aria-expanded="false"] .abps-v2-toggle-icon {
  transform: rotate(180deg) scale(0.95);
}

/* Series Content */
.abps-v2-main-content {
  padding: 0;
  background: #f1f2f5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.abps-v2-main-content[aria-hidden="false"] {
  max-height: 5000px;
  padding: 8px;
}

/* Category Accordions */
.abps-v2-cat-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.abps-v2-cat-item {
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.abps-v2-cat-item:hover {
  box-shadow: 0 4px 14px rgba(103, 56, 114, 0.1);
  transform: translateY(-2px);
}

.abps-v2-cat-header {
  width: 100%;
  padding: 18px 22px;
  background: rgba(103, 56, 114, 0.03) !important;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border-left: 4px solid #4c3451;
  position: relative;
}

.abps-v2-cat-header:hover {
  color: #673872;
}

.abps-v2-cat-header[aria-expanded="true"] {
  background: rgba(103, 56, 114, 0.03);
}

.abps-v2-cat-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #673872;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.abps-v2-post-count {
  background: #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;
}

.abps-v2-cat-header:hover .abps-v2-post-count {
  transform: scale(1.05);
}

.abps-v2-cat-toggle {
  font-size: 1.4rem;
  font-weight: 300;
  color: #8e7f91;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.abps-v2-cat-header[aria-expanded="true"] .abps-v2-cat-toggle {
  transform: rotate(45deg);
  color: #673872;
}

/* Category Content */
.abps-v2-cat-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
}

.abps-v2-cat-content[aria-hidden="false"] {
  max-height: 2000px;
}

.abps-v2-cat-content[aria-hidden="false"] {
  max-height: 2000px;
}

.abps-v2-posts-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Category is current post's category - highlight entire category */
.abps-v2-cat-item.abps-v2-current-cat {
  box-shadow: 0 4px 16px rgba(103, 56, 114, 0.15);
}

.abps-v2-cat-item.abps-v2-current-cat .abps-v2-cat-header {
  background-color: #fecd34 !important;
  border-left-color: #422447;
}

.abps-v2-cat-item.abps-v2-current-cat .abps-v2-post-count {
  background: white;
  color: #422447;
}

/* Post Items - Default style for all posts */
.abps-v2-post-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 #4c3451;
  margin: 3px;
}

.abps-v2-post-item:hover {
  background: rgba(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 */
.abps-v2-cat-item.abps-v2-current-cat .abps-v2-post-item {
  background: #ffe28b;
  border-left: 3px solid #673872;
}

.abps-v2-cat-item.abps-v2-current-cat .abps-v2-post-item:hover {
  background: rgb(253, 212, 87);
  transform: translateX(5px);
  box-shadow: 0 3px 12px rgba(103, 56, 114, 0.15);
}

/* Current post itself - highlight with yellow */
.abps-v2-cat-item.abps-v2-current-cat .abps-v2-post-item.abps-v2-current-post {
  background: #673872;
  border-left: 3px solid #ffe28b;
}

.abps-v2-cat-item.abps-v2-current-cat
  .abps-v2-post-item.abps-v2-current-post:hover {
  background: #422a47;
  transform: translateX(5px);
  box-shadow: 0 3px 12px #422a47;
}

.abps-v2-post-item.abps-v2-current-post::before {
  content: "Current";
  position: absolute;
  top: 30% !important;
  right: 1% !important;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  background: #fecd34;
  color: #422447;
  border-radius: 10px;
  z-index: 1;
}

/* Different bullet colors for special posts */
.abps-v2-cat-item.abps-v2-current-cat .abps-v2-bullet {
  color: #673872;
}

.abps-v2-post-item.abps-v2-current-post .abps-v2-bullet {
  color: #fecd34;
}

.abps-v2-post-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: #422447;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.abps-v2-post-item:hover .abps-v2-post-text {
  font-weight: 600;
}

/* Different text colors for special posts */
.abps-v2-cat-item.abps-v2-current-cat .abps-v2-post-text {
  color: #673872;
  font-weight: 600;
}

.abps-v2-post-item.abps-v2-current-post .abps-v2-post-text {
  color: #fecd34;
  font-weight: 700;
}

.abps-v2-post-date {
  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;
}

.abps-v2-post-item:hover .abps-v2-post-date {
  background: rgba(103, 56, 114, 0.08);
}

/* Different date colors for special posts */
.abps-v2-cat-item.abps-v2-current-cat .abps-v2-post-date {
  background: rgba(103, 56, 114, 0.1);
  color: #673872;
}

.abps-v2-post-item.abps-v2-current-post .abps-v2-post-date {
  background: rgba(254, 205, 52, 0.1);
  color: #fecd34;
}

/* View More Link */
.abps-v2-more-container {
  margin-top: 12px;
  text-align: center;
}

.abps-v2-more-link {
  display: inline-block;
  padding: 7px 16px;
  background: rgba(254, 205, 52, 0.1);
  color: #fecd34;
  text-decoration: none;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.abps-v2-more-link:hover {
  background: #fecd34;
  color: #422447;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(254, 205, 52, 0.2);
}

.abps-v2-more-link svg {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.abps-v2-more-link:hover svg {
  transform: translateX(3px);
}

/* Empty State */
.abps-v2-no-cat-msg {
  text-align: center;
  padding: 35px 20px;
  color: #8e7f91;
}

.abps-v2-no-cat-msg svg {
  margin-bottom: 14px;
  color: #fecd34;
  opacity: 0.7;
}

.abps-v2-no-cat-msg p {
  margin: 0;
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
  .abps-v2-main-header {
    padding: 16px 20px;
  }

  .abps-v2-title {
    font-size: 1.2rem;
  }

  .abps-v2-main-content[aria-hidden="false"] {
    padding: 18px;
  }

  .abps-v2-cat-header {
    padding: 14px 18px;
  }

  .abps-v2-cat-title {
    font-size: 1.05rem;
  }

  .abps-v2-post-item {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .abps-v2-post-item.abps-v2-current-post::before {
    position: absolute !important;
    top: 30% !important;
    right: 1% !important;
  }

  .abps-v2-post-date {
    align-self: flex-start;
    font-size: 0.7rem;
  }

  .abps-v2-bullet {
    position: absolute;
    left: 12px;
    top: 10px;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
  }

  .abps-v2-post-text {
    padding-left: 24px;
    font-size: 0.9rem;
  }

  .abps-v2-more-link {
    padding: 6px 14px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .abps-v2-header-content {
    gap: 10px;
  }

  .abps-v2-icon {
    width: 20px;
    height: 20px;
  }

  .abps-v2-title {
    font-size: 1.1rem;
  }

  .abps-v2-toggle-icon {
    font-size: 1.4rem;
  }

  .abps-v2-cat-title {
    align-items: flex-start;
    gap: 4px;
  }

  .abps-v2-post-count {
    font-size: 0.75rem;
    padding: 2px 6px;
  }

  .abps-v2-post-item {
    padding: 8px 10px;
  }

  .abps-v2-post-item.abps-v2-current-post::before {
    font-size: 0.6rem;
    padding: 1px 4px;
  }
}
/* ===============================================
   AJAX Loading States & Skeleton Loader
   Prevents CLS during content loading
   =============================================== */

/* Loading skeleton container */
.abps-v2-loading-skeleton {
  padding: 16px;
  animation: abps-fadeIn 0.2s ease-in;
  display: block;
}

/* Individual skeleton items */
.abps-v2-skeleton-item {
  height: 52px;
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  border-radius: 8px;
  margin-bottom: 12px;
  animation: abps-shimmer 1.5s infinite ease-in-out;
  position: relative;
  overflow: hidden;
  border-left: 3px solid #ddd;
}

.abps-v2-skeleton-item:last-child {
  margin-bottom: 0;
}

/* Shimmer animation effect */
@keyframes abps-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Fade in animation */
@keyframes abps-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Loading state modifier */
.abps-v2-cat-posts.abps-v2-loading {
  min-height: 200px;
  position: relative;
  display: block;
}

/* Hide skeleton when content is loaded */
.abps-v2-cat-posts:not(.abps-v2-loading) .abps-v2-loading-skeleton {
  display: none;
}

/* Error message styling */
.abps-v2-error {
  padding: 16px;
  margin: 12px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  color: #856404;
  font-size: 0.9rem;
  text-align: center;
}
/* No posts message styling */
.abps-v2-no-posts {
  padding: 16px;
  margin: 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  color: #6c757d;
  font-size: 0.9rem;
  text-align: center;
  font-style: italic;
}
/* No posts message styling */
.abps-v2-no-posts {
  padding: 16px;
  margin: 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  color: #6c757d;
  font-size: 0.9rem;
  text-align: center;
  font-style: italic;
}

/* Content fade in after AJAX load */
.abps-v2-cat-posts > a,
.abps-v2-cat-posts > .abps-v2-more-container {
  animation: abps-slideIn 0.4s ease-out;
}

@keyframes abps-slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Prevent layout shift by reserving space */
.abps-v2-cat-content {
  min-height: 0;
  transition: min-height 0.3s ease;
}

.abps-v2-cat-content[aria-hidden="false"] {
  min-height: 54px;
}

/* Mobile responsive adjustments for skeleton */
@media (max-width: 768px) {
  .abps-v2-skeleton-item {
    height: 42px;
  }

  .abps-v2-loading-skeleton {
    padding: 10px 14px;
  }

  .abps-v2-cat-posts.abps-v2-loading {
    min-height: 160px;
  }
}
