/* ===== Modern Carousel Container ===== */
.modern-carousel {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 
    0 32px 64px -12px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  background: #ffffff;
}

/* ===== Image Wrapper - รักษาขนาดรูปภาพเต็ม ===== */
.carousel-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  padding: 30px;
  min-height: 450px;
}

.modern-carousel .carousel-item img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.6s ease;
}

.modern-carousel:hover .carousel-item img {
  transform: scale(1.02);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.15),
    0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ===== Modern Inner Container ===== */
.modern-inner {
  border-radius: 24px;
  overflow: hidden;
}

/* ===== Smooth Slide Transition ===== */
.modern-carousel .carousel-item {
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== Modern Indicators ===== */
.modern-indicators {
  bottom: 24px;
  margin-bottom: 0;
  z-index: 15;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  margin-left: 0;
  margin-right: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.modern-indicators li {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a7f3d0;
  border: none;
  margin: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  opacity: 1;
}

.modern-indicators li.active {
  width: 32px;
  border-radius: 20px;
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.4);
}

.modern-indicators li:hover:not(.active) {
  background: #6ee7b7;
  transform: scale(1.3);
}

/* ===== Modern Control Arrows ===== */
.modern-control {
  width: 70px;
  opacity: 0;
  transition: all 0.4s ease;
}

.modern-carousel:hover .modern-control {
  opacity: 1;
}

.modern-control-prev {
  left: 20px;
}

.modern-control-next {
  right: 20px;
}

.control-icon-wrapper {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modern-control:hover .control-icon-wrapper {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: scale(1.12);
  box-shadow: 0 12px 35px rgba(4, 120, 87, 0.35);
}

.modern-control .carousel-control-prev-icon,
.modern-control .carousel-control-next-icon {
  width: 22px;
  height: 22px;
  background-size: 100%;
  filter: brightness(0) saturate(100%) invert(30%) sepia(10%) saturate(500%) hue-rotate(180deg);
  transition: filter 0.35s ease;
}

.modern-control:hover .carousel-control-prev-icon,
.modern-control:hover .carousel-control-next-icon {
  filter: brightness(0) invert(1);
}

/* ===== Decorative Elements ===== */
.modern-carousel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #047857, #059669, #10b981, #047857);
  background-size: 300% 100%;
  animation: gradientMove 4s ease infinite;
  z-index: 20;
}

@keyframes gradientMove {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== Bottom Accent Line ===== */
.modern-carousel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    #047857 20%, 
    #059669 50%, 
    #047857 80%, 
    transparent 100%);
  z-index: 20;
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
  .modern-carousel {
    border-radius: 20px;
  }
  
  .carousel-image-wrapper {
    padding: 25px;
    min-height: 380px;
  }
  
  .modern-carousel .carousel-item img {
    max-height: 60vh;
    border-radius: 12px;
  }
}

@media (max-width: 768px) {
  .modern-carousel {
    border-radius: 16px;
  }
  
  .carousel-image-wrapper {
    padding: 20px;
    min-height: 300px;
  }
  
  .modern-carousel .carousel-item img {
    max-height: 50vh;
    border-radius: 10px;
  }
  
  .control-icon-wrapper {
    width: 46px;
    height: 46px;
  }
  
  .modern-control .carousel-control-prev-icon,
  .modern-control .carousel-control-next-icon {
    width: 18px;
    height: 18px;
  }
  
  .modern-indicators {
    padding: 8px 16px;
    bottom: 18px;
  }
  
  .modern-indicators li {
    width: 8px;
    height: 8px;
  }
  
  .modern-indicators li.active {
    width: 26px;
  }
  
  .modern-control {
    opacity: 1;
    width: 55px;
  }
  
  .modern-control-prev {
    left: 10px;
  }
  
  .modern-control-next {
    right: 10px;
  }
}

@media (max-width: 576px) {
  .modern-carousel {
    border-radius: 12px;
  }
  
  .carousel-image-wrapper {
    padding: 15px;
    min-height: 240px;
  }
  
  .modern-carousel .carousel-item img {
    max-height: 42vh;
    border-radius: 8px;
  }
  
  .control-icon-wrapper {
    width: 40px;
    height: 40px;
  }
  
  .modern-control .carousel-control-prev-icon,
  .modern-control .carousel-control-next-icon {
    width: 14px;
    height: 14px;
  }
  
  .modern-indicators {
    padding: 6px 12px;
    bottom: 12px;
    gap: 8px;
  }
  
  .modern-indicators li {
    width: 6px;
    height: 6px;
  }
  
  .modern-indicators li.active {
    width: 20px;
  }
  
  .modern-control-prev {
    left: 6px;
  }
  
  .modern-control-next {
    right: 6px;
  }
}

/* ===== Focus States for Accessibility ===== */
.modern-control:focus .control-icon-wrapper {
  outline: 3px solid rgba(4, 120, 87, 0.5);
  outline-offset: 3px;
}

.modern-indicators li:focus {
  outline: 2px solid rgba(4, 120, 87, 0.5);
  outline-offset: 2px;
}

/* ===== Optional: Dark Theme Variant ===== */
@media (prefers-color-scheme: dark) {
  .carousel-image-wrapper {
    background: linear-gradient(180deg, #064e3b 0%, #022c22 100%);
  }
  
  .modern-carousel {
    background: #022c22;
    box-shadow: 
      0 32px 64px -12px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(255, 255, 255, 0.05);
  }
  
  .modern-carousel .carousel-item img {
    box-shadow: 
      0 20px 50px rgba(0, 0, 0, 0.4),
      0 8px 20px rgba(0, 0, 0, 0.3);
  }
  
  .modern-indicators {
    background: rgba(6, 78, 59, 0.9);
  }
  
  .modern-indicators li {
    background: #065f46;
  }
  
  .modern-indicators li:hover:not(.active) {
    background: #059669;
  }
  
  .control-icon-wrapper {
    background: rgba(6, 78, 59, 0.95);
  }
  
  .modern-control .carousel-control-prev-icon,
  .modern-control .carousel-control-next-icon {
    filter: brightness(0) invert(0.7);
  }
}
