/**
 * HOSTPN Carousel Component
 *
 * Custom carousel/slider component for the HOSTPN plugin
 *
 * @package    hostpn
 * @subpackage hostpn/assets/css
 */

.hostpn-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0 auto;
}

.hostpn-carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.hostpn-carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  width: 100%;
}

.hostpn-carousel-slide {
  min-width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hostpn-carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Navigation Arrows */
.hostpn-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.3s ease;
}

.hostpn-carousel-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.hostpn-carousel-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.hostpn-carousel-nav.hostpn-carousel-prev {
  left: 10px;
}

.hostpn-carousel-nav.hostpn-carousel-next {
  right: 10px;
}

.hostpn-carousel-nav i {
  font-size: 24px;
}

/* Dots Navigation */
.hostpn-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.hostpn-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.hostpn-carousel-dot:hover {
  background: #999;
  transform: scale(1.2);
}

.hostpn-carousel-dot.hostpn-carousel-dot-active {
  background: #d45500;
  transform: scale(1.3);
}

/* Counter */
.hostpn-carousel-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 10;
}

/* Loading state */
.hostpn-carousel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #f5f5f5;
}

.hostpn-carousel-loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top-color: #d45500;
  border-radius: 50%;
  animation: hostpn-carousel-spin 1s linear infinite;
}

@keyframes hostpn-carousel-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty state */
.hostpn-carousel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #f5f5f5;
  color: #666;
  padding: 20px;
  text-align: center;
}

.hostpn-carousel-empty i {
  font-size: 48px;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
  .hostpn-carousel-nav {
    width: 35px;
    height: 35px;
  }

  .hostpn-carousel-nav i {
    font-size: 20px;
  }

  .hostpn-carousel-nav.hostpn-carousel-prev {
    left: 5px;
  }

  .hostpn-carousel-nav.hostpn-carousel-next {
    right: 5px;
  }

  .hostpn-carousel-counter {
    font-size: 12px;
    padding: 4px 8px;
  }
}

/* Multiple items per slide */
.hostpn-carousel[data-items-desktop="2"] .hostpn-carousel-slide {
  min-width: 50%;
}

.hostpn-carousel[data-items-desktop="3"] .hostpn-carousel-slide {
  min-width: 33.333%;
}

.hostpn-carousel[data-items-desktop="4"] .hostpn-carousel-slide {
  min-width: 25%;
}

@media (max-width: 768px) {
  .hostpn-carousel[data-items-mobile="1"] .hostpn-carousel-slide {
    min-width: 100%;
  }

  .hostpn-carousel[data-items-mobile="2"] .hostpn-carousel-slide {
    min-width: 50%;
  }
}

/* Autoplay indicator */
.hostpn-carousel-autoplay-indicator {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hostpn-carousel-autoplay-indicator i {
  font-size: 16px;
}

.hostpn-carousel-autoplay-indicator:hover {
  background: rgba(0, 0, 0, 0.8);
}
