/**
 * BDE Carousel4 - Navigation Center Outside Cards
 * Updated layout with centered navigation buttons outside carousel
 */

/* Main Container - Flexbox layout for centered navigation */
.bde-carousel-container-xyz789 {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 3rem auto;
  padding: 0 80px; /* เพิ่ม padding สำหรับปุ่มที่อยู่ด้านนอก */
}

/* Carousel Wrapper - พื้นที่แสดง cards */
.bde-carousel-wrapper-xyz789 {
  flex: 1;
  overflow: hidden;
  position: relative;
  margin: 0 15px; /* ระยะห่างจากปุ่ม */
}

/* Carousel Track */
.bde-carousel-track-xyz789 {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  padding: 5px 0;
}

/* Navigation Buttons - ปุ่มอยู่ข้างนอกและกึ่งกลาง */
.bde-carousel-btn-xyz789 {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid #0f9d0f;
  color: #0f9d0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  flex-shrink: 0;
}

/* Previous Button Position */
.bde-prev-xyz789 {
  left: 10px;
}

/* Next Button Position */
.bde-next-xyz789 {
  right: 10px;
}

/* Button Hover Effects */
.bde-carousel-btn-xyz789:hover {
  background: rgba(15, 157, 15, 0.1);
  transform: translateY(-50%) scale(1.1);
  border-width: 3px;
}

.bde-carousel-btn-xyz789:hover svg {
  transform: scale(1.1);
}

/* Button Active State */
.bde-carousel-btn-xyz789:active {
  transform: translateY(-50%) scale(0.95);
}

/* Button Disabled State */
.bde-carousel-btn-xyz789:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #ccc;
}

.bde-carousel-btn-xyz789:disabled:hover {
  transform: translateY(-50%);
  background: transparent;
  border-width: 2px;
}

/* Button SVG Styling - ลูกศรภายในวง */
.bde-carousel-btn-xyz789 svg {
  width: 24px;
  height: 24px;
  color: #0f9d0f;
  transition: all 0.3s ease;
}

/* Focus Styles for Accessibility */
.bde-carousel-btn-xyz789:focus-visible {
  outline: 3px solid #0f9d0f;
  outline-offset: 3px;
}

/* Card Styling */
.bde-carousel-card-xyz789 {
  flex: 0 0 calc(25% - 1.125rem);
  min-width: 260px;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.bde-carousel-card-xyz789:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(15, 157, 15, 0.12);
}

/* Card Link */
.bde-card-link-xyz789 {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.bde-card-link-xyz789:focus-visible {
  outline: 3px solid #0f9d0f;
  outline-offset: 2px;
  border-radius: 16px;
}

/* Card Image */
.bde-card-image-xyz789 {
  position: relative;
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  overflow: hidden;
}

.bde-card-image-xyz789 img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bde-carousel-card-xyz789:hover .bde-card-image-xyz789 img {
  transform: scale(1.08);
}

/* Placeholder for missing images */
.bde-card-placeholder-xyz789 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.bde-card-placeholder-xyz789 svg {
  width: 60px;
  height: 60px;
  opacity: 0.3;
}

/* Bookmark Icon */
.bde-card-bookmark-xyz789 {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  opacity: 0;
}

.bde-carousel-card-xyz789:hover .bde-card-bookmark-xyz789 {
  opacity: 1;
  transform: scale(1.1);
}

.bde-card-bookmark-xyz789 svg {
  width: 18px;
  height: 18px;
  color: #0f9d0f;
}

/* Card Content */
.bde-card-content-xyz789 {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bde-card-title-xyz789 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bde-card-excerpt-xyz789 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Meta */
.bde-card-meta-xyz789 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
  color: #767676; /* WCAG AA compliant - contrast ratio 4.54:1 */
  font-size: 0.813rem;
}

.bde-card-meta-xyz789 svg {
  width: 16px;
  height: 16px;
  color: #0f9d0f;
}

/* Empty State */
.bde-carousel-empty-xyz789 {
  width: 100%;
  padding: 4rem 2rem;
  text-align: center;
  background: #f9f9f9;
  border-radius: 16px;
  color: #666;
  font-size: 1.125rem;
}

/* Skeleton Loading */
.bde-skeleton-xyz789 {
  pointer-events: none;
  cursor: default;
}

.bde-skeleton-img-xyz789,
.bde-skeleton-line-xyz789,
.bde-skeleton-meta-xyz789 {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 50%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.bde-skeleton-img-xyz789 {
  width: 100%;
  height: 200px;
}

.bde-skeleton-line-xyz789 {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.bde-skeleton-title-xyz789 {
  height: 18px;
  width: 70%;
}

.bde-skeleton-line-xyz789:nth-child(2) {
  width: 100%;
}

.bde-skeleton-line-xyz789:nth-child(3) {
  width: 80%;
}

.bde-skeleton-meta-xyz789 {
  height: 20px;
  width: 100px;
  border-radius: 4px;
  margin-top: auto;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Responsive Design */

/* Large Tablets - 3 cards */
@media (max-width: 1200px) {
  .bde-carousel-container-xyz789 {
    padding: 0 70px;
  }

  .bde-carousel-card-xyz789 {
    flex: 0 0 calc(33.333% - 1rem);
  }
}

/* Tablets - 2 cards */
@media (max-width: 768px) {
  .bde-carousel-container-xyz789 {
    padding: 0 60px;
    margin: 2rem auto;
  }

  .bde-carousel-card-xyz789 {
    flex: 0 0 calc(50% - 0.75rem);
    min-width: 240px;
  }

  .bde-carousel-track-xyz789 {
    gap: 1rem;
  }

  .bde-carousel-btn-xyz789 {
    width: 44px;
    height: 44px;
  }

  .bde-carousel-btn-xyz789 svg {
    width: 20px;
    height: 20px;
  }

  .bde-prev-xyz789 {
    left: 8px;
  }

  .bde-next-xyz789 {
    right: 8px;
  }

  .bde-card-image-xyz789 {
    height: 180px;
  }

  .bde-skeleton-img-xyz789 {
    height: 180px;
  }
}

/* Mobile - 1 card */
@media (max-width: 480px) {
  .bde-carousel-container-xyz789 {
    padding: 0 50px;
    margin: 1.5rem auto;
  }

  .bde-carousel-card-xyz789 {
    flex: 0 0 100%;
    min-width: 260px;
  }

  .bde-carousel-wrapper-xyz789 {
    margin: 0 10px;
  }

  .bde-carousel-btn-xyz789 {
    width: 40px;
    height: 40px;
  }

  .bde-carousel-btn-xyz789 svg {
    width: 18px;
    height: 18px;
  }

  .bde-prev-xyz789 {
    left: 5px;
  }

  .bde-next-xyz789 {
    right: 5px;
  }

  .bde-card-content-xyz789 {
    padding: 1rem;
  }

  .bde-card-title-xyz789 {
    font-size: 1rem;
  }

  .bde-card-excerpt-xyz789 {
    font-size: 0.813rem;
  }

  .bde-card-meta-xyz789 {
    font-size: 0.75rem;
  }
}

/* Very Small Mobile */
@media (max-width: 360px) {
  .bde-carousel-container-xyz789 {
    padding: 0 45px;
  }

  .bde-carousel-btn-xyz789 {
    width: 36px;
    height: 36px;
  }

  .bde-carousel-btn-xyz789 svg {
    width: 16px;
    height: 16px;
  }

  .bde-prev-xyz789 {
    left: 3px;
  }

  .bde-next-xyz789 {
    right: 3px;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .bde-carousel-track-xyz789,
  .bde-carousel-card-xyz789,
  .bde-carousel-btn-xyz789,
  .bde-card-image-xyz789 img,
  .bde-card-bookmark-xyz789,
  .bde-carousel-btn-xyz789 svg,
  .bde-carousel-btn-xyz789 svg circle {
    transition: none;
    animation: none;
  }

  .bde-skeleton-img-xyz789,
  .bde-skeleton-line-xyz789,
  .bde-skeleton-meta-xyz789 {
    animation: none;
    background: #e8e8e8;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .bde-carousel-card-xyz789 {
    border: 2px solid #000;
  }

  .bde-carousel-btn-xyz789 {
    border-width: 3px;
    border-color: #000;
  }

  .bde-carousel-btn-xyz789:hover {
    border-color: #0f9d0f;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .bde-carousel-container-xyz789 {
    background: transparent;
  }

  .bde-carousel-card-xyz789 {
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .bde-carousel-card-xyz789:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  }

  .bde-card-title-xyz789 {
    color: #f0f0f0;
  }

  .bde-card-excerpt-xyz789 {
    color: #b0b0b0;
  }

  .bde-card-meta-xyz789 {
    color: #a0a0a0; /* WCAG AA compliant for dark mode */
    border-top-color: #444;
  }

  .bde-carousel-btn-xyz789 {
    background: transparent;
    border-color: #0f9d0f;
  }

  .bde-carousel-btn-xyz789 svg {
    color: #0f9d0f;
  }

  .bde-carousel-btn-xyz789:hover {
    background: rgba(15, 157, 15, 0.15);
    border-width: 3px;
  }

  .bde-carousel-btn-xyz789:hover svg {
    color: #1aff1a;
    transform: scale(1.1);
  }

  .bde-card-placeholder-xyz789 {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
  }

  .bde-carousel-empty-xyz789 {
    background: #2a2a2a;
    color: #999;
  }
}