/**
 * @file
 * Views Vanilla JavaScript Basic Carousel.
 *
 * Filename:     vvjb.css
 * Website:      https://www.flashwebcenter.com
 * Developer:    Alaa Haddad https://www.alaahaddad.com.
 */
:root {
  --vvjb-progress-size: 32px;
  --vvjb-progress-thickness: 6px;  /* Colors */
  --vvjb-progress-color: #3b82f6;              /* Active progress color */
  --vvjb-progress-track: rgba(255, 255, 255, 0.3);  /* Background track */
  --vvjb-progress-inner-bg: #fff;              /* Inner circle background */
  --vvjb-progress-text-color: #3b82f6;         /* Percentage text color */
  --vvjb-progress-complete-color: #22c55e;     /* Color at 100% */
  --vvjb-progress-complete-text: #22c55e;      /* Text color at 100% */
  --vvjb-progress-font-size: 0.625rem;
}

/* Base Carousel Styles */
.vvjb-carousel .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.vvjb-carousel,
.vvjb-carousel * {
  box-sizing: border-box;
}

.vvjb {
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  margin: 0 auto;
  padding: 1rem;
}

.vvjb .vvjb-carousel-outer {
  position: relative;
  display: block;
  max-width: 100%;
  width: 100%;
  height: 100%;
}

.vvjb .vvjb-carousel-wrapper {
  max-width: 100%;
  width: 100%;
}

.vvjb .vvjb-items,
.vvjb .vvjb-item {
  max-width: 100%;
  min-width: 0;
}

.vvjb.vvjb-orientation-vertical .vvjb-carousel-outer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.vvjb.vvjb-nav-dots .vvjb-carousel-outer,
.vvjb.vvjb-nav-none .vvjb-carousel-outer {
  padding: 0;
}

.vvjb .vvjb-carousel-wrapper {
  position: relative;
  overflow: hidden;
  width: auto;
  height: auto;
  margin: 0 auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.vvjb .vvjb-carousel-wrapper.is-visible {
  opacity: 1;
  visibility: visible;
}

.vvjb .vvjb-items {
  display: flex;
  will-change: transform;
  transition: transform 0.5s ease-in-out;
  transform: translateX(0);
}

.vvjb .vvjb-item {
  flex: 0 0 auto;
  transition: transform 0.5s ease, opacity 0.5s ease;
  scroll-snap-align: start;
}

.vvjb .vvjb-item.active-slide {
  opacity: 1;
  pointer-events: auto;
}

.vvjb .vvjb-item.non-active-slide {
  opacity: 0.15;
  pointer-events: none;
}

/* Horizontal and Hybrid Layout */
.vvjb.vvjb-orientation-hybrid .vvjb-items,
.vvjb.vvjb-orientation-horizontal .vvjb-items {
  flex-direction: row;
  min-height: 0;
  min-width: 0;
}

.vvjb.vvjb-orientation-hybrid.vvjb-nav-arrows .vvjb-carousel-outer,
.vvjb.vvjb-orientation-hybrid.vvjb-nav-both .vvjb-carousel-outer,
.vvjb.vvjb-orientation-horizontal.vvjb-nav-arrows .vvjb-carousel-outer,
.vvjb.vvjb-orientation-horizontal.vvjb-nav-both .vvjb-carousel-outer {
  padding: 0 50px;
}

.vvjb.vvjb-orientation-hybrid .vvjb-carousel-options,
.vvjb.vvjb-orientation-horizontal .vvjb-carousel-options {
  position: absolute;
  top: 50%;
  inset-inline-start: 0;
  inset-inline-end: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  padding: 0;
  margin: 0;
  z-index: 1;
}

.vvjb.vvjb-orientation-hybrid.vvjb-bottom .vvjb-carousel-options,
.vvjb.vvjb-orientation-horizontal.vvjb-bottom .vvjb-carousel-options {
  transform: translateY(calc(-50% - 26px));
}

.vvjb.vvjb-orientation-hybrid .vvjb-carousel-options .vvjb-button,
.vvjb.vvjb-orientation-horizontal .vvjb-carousel-options .vvjb-button {
  pointer-events: all;
}

/* Vertical Layout */
.vvjb.vvjb-orientation-vertical .vvjb-items {
  flex-direction: column;
  transform: translateY(0);
}

.vvjb.vvjb-orientation-vertical.vvjb-nav-arrows .vvjb-carousel-outer,
.vvjb.vvjb-orientation-vertical.vvjb-nav-both .vvjb-carousel-outer {
  padding: 50px 0;
}

.vvjb.vvjb-orientation-vertical .vvjb-item {
  width: 100%;
}

.vvjb.vvjb-orientation-vertical .vvjb-carousel-options {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  padding: 0;
  margin: 0;
  z-index: 1;
}

.vvjb.vvjb-orientation-vertical .vvjb-carousel-options .vvjb-button {
  pointer-events: all;
}

.vvjb.vvjb-orientation-vertical .vvjb-carousel-options button svg {
  transform: rotate(-90deg);
}

.vvjb-carousel-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-block-start: 1rem;
}

/* Carousel Arrow Button Styles */
.vvjb .vvjb-play-pause-button,
.vvjb .vvjb-carousel-options .vvjb-button {
  all: unset;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  transition: all 0.3s ease;
  color: #fff;
  backdrop-filter: blur(4px);
}

.vvjb .vvjb-play-pause-button:hover,
.vvjb .vvjb-carousel-options .vvjb-button:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: #fff;
  transform: scale(1.05);
}

.vvjb .vvjb-play-pause-button:focus-visible,
.vvjb .vvjb-carousel-options .vvjb-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.vvjb .vvjb-play-pause-button:active,
.vvjb .vvjb-carousel-options .vvjb-button:active {
  transform: scale(0.95);
}

.vvjb .vvjb-carousel-options .vvjb-button[style*='visibility:hidden'] {
  opacity: 0;
  pointer-events: none;
}

.vvjb .vvjb-play-pause-button svg,
.vvjb .vvjb-carousel-options .vvjb-button svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

/* Carousel Dots Navigation Styles */
.vvjb .vvjb-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0 0.75rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.vvjb .vvjb-carousel-dot {
  all: unset;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background-color: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
  opacity: 0.5;
  transition: all 0.3s ease;
}

/* Elegant, modern pulse animation */
@keyframes vvjb-heartbeat {
  0%,
  100% {
    transform: scale(1.2);
  }

  50% {
    transform: scale(1.35);
  }

}

.vvjb .vvjb-carousel-dot.active-slide {
  background-color: currentColor;
  opacity: 1;
  animation: vvjb-heartbeat 2s ease-in-out infinite;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion:reduce) {
  .vvjb .vvjb-carousel-dot.active-slide {
    animation: none;
    transform: scale(1.2);
  }

}

.vvjb-carousel-dots > a,
.vvjb-carousel-dots > button {
  padding: 0 !important;
  margin: 0.75rem 0 !important;
}

/* Hover and focus states */
.vvjb .vvjb-carousel-dot:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.vvjb .vvjb-carousel-dot:focus-visible {
  opacity: 1;
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Pressed/active interaction state */
.vvjb .vvjb-carousel-dot:active {
  transform: scale(0.9);
}

/* Alternative square dot style */
.square-dots .vvjb .vvjb-carousel-dots .vvjb-carousel-dot {
  border-radius: 2px;
  width: 10px;
  height: 10px;
}

/* Alternative bar/line indicator style */
.bar-dots .vvjb .vvjb-carousel-dots .vvjb-carousel-dot {
  border-radius: 2px;
  width: 24px;
  height: 4px;
}

.bar-dots .vvjb .vvjb-carousel-dots .vvjb-carousel-dot.active-slide {
  transform: scaleX(1.5);
}

/* Accessibility and Motion Support */
.vvjb .reduced-motion .vvjb-item {
  transition: none !important;
}

/* High contrast mode support */
@media (prefers-contrast:high) {
  .vvjb .vvjb-carousel-dot {
    border-width: 3px;
    opacity: 0.7;
  }

  .vvjb .vvjb-carousel-dot.active-slide {
    opacity: 1;
    background-color: currentColor;
  }

}

/* Reduced motion support */
@media (prefers-reduced-motion:reduce) {
  .vvjb .vvjb-carousel-dot {
    transition: opacity 0.2s ease;
    transform: none;
  }

  .vvjb .vvjb-carousel-dot.active-slide {
    transform: none;
  }

  .vvjb .vvjb-carousel-dot:hover,
  .vvjb .vvjb-carousel-dot:active {
    transform: none;
  }

}

/* Hide scrollbars */
.vvjb .vvjb-carousel-wrapper::-webkit-scrollbar {
  display: none;
}

/* Circular Progress Indicator */
.vvjb .vvjb-progress-bar {
  grid-area: 1 / 1;
  width: var(--vvjb-progress-size, 32px);
  height: var(--vvjb-progress-size, 32px);
  border-radius: 50%;
  background: conic-gradient(var(--vvjb-progress-color, #3b82f6) var(--progress, 0%), var(--vvjb-progress-track, rgba(255, 255, 255, 0.3)) 0%);
  display: grid;
  place-items: center;
  position: relative;
  opacity: 1;
  visibility: visible;
  transition: background 0.05s linear, opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

/* Inner circle with percentage text */
.vvjb .vvjb-progress-bar::after {
  content: attr(aria-valuenow) "%";
  width: calc(100% - var(--vvjb-progress-thickness, 6px));
  height: calc(100% - var(--vvjb-progress-thickness, 6px));
  border-radius: inherit;
  background: var(--vvjb-progress-inner-bg, #fff);
  display: grid;
  place-items: center;
  font-size: var(--vvjb-progress-font-size, 0.625rem);
  font-weight: bold;
  color: var(--vvjb-progress-text-color, #3b82f6);
  position: absolute;
  transition: color 0.3s ease;
}

/* Completion state - Scale up and change color */
.vvjb .vvjb-progress-bar[aria-valuenow="100"] {
  background: conic-gradient(var(--vvjb-progress-complete-color, #22c55e) 100%, var(--vvjb-progress-complete-color, #22c55e) 0%);
  transform: scale(1.05);
}

.vvjb .vvjb-progress-bar[aria-valuenow="100"]::after {
  color: var(--vvjb-progress-complete-text, #22c55e);
}

/* Reduced motion support */
@media (prefers-reduced-motion:reduce) {
  .vvjb .vvjb-progress-bar {
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .vvjb .vvjb-progress-bar[aria-valuenow="100"] {
    transform: none;
  }

}

/* Reduced motion support */
@media (prefers-reduced-motion:reduce) {
  .vvjb .vvjb-progress-bar::before {
    transition: none;
  }

}

/* Page Counter Styles */
.vvjb .vvjb-page-counter {
  padding: 0 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 999px;
  font-size: 0.875rem;
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: all 0.3s ease;
  height: 32px;
}

.vvjb .vvjb-page-counter > * {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

.vvjb .vvjb-current-page {
  font-weight: 700;
}

.vvjb .vvjb-counter-separator {
  opacity: 0.7;
  padding: 0 0.125rem;
}

.vvjb .vvjb-total-pages {
  opacity: 0.9;
}

.vvjb.vvjb-orientation-vertical .vvjb-progress-bar::before {
  width: 100%;
  height: var(--progress, 0%);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.8) 0%, rgba(96, 165, 250, 0.9) 50%, rgba(147, 197, 253, 1) 100%);
}

.vvjb .vvjb-carousel-options .vvjb-next,
.vvjb .vvjb-carousel-options .vvjb-prev {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.vvjb .vvjb-carousel-options .vvjb-next.vvjb-hidden,
.vvjb .vvjb-carousel-options .vvjb-prev.vvjb-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.vvjb .vvjb-carousel-options .vvjb-prev.vvjb-hidden {
  transform: translateX(-20px);
}

.vvjb .vvjb-carousel-options .vvjb-next.vvjb-hidden {
  transform: translateX(20px);
}

.vvjb.vvjb-orientation-vertical .vvjb-carousel-options .vvjb-prev.vvjb-hidden {
  transform: translateY(-20px);
}

.vvjb.vvjb-orientation-vertical .vvjb-carousel-options .vvjb-next.vvjb-hidden {
  transform: translateY(20px);
}

/* Reduced Motion Support for New Features */
@media (prefers-reduced-motion:reduce) {
  .vvjb .vvjb-play-pause-button {
    transition: none;
  }

  .vvjb .vvjb-play-pause-button:hover,
  .vvjb .vvjb-play-pause-button:active {
    transform: none;
  }

  .vvjb .vvjb-progress-bar::before {
    transition: none;
  }

  .vvjb .vvjb-page-counter {
    transition: none;
  }

}

/* High Contrast Mode Support for New Features */
@media (prefers-contrast:high) {
  .vvjb .vvjb-play-pause-button {
    background: #000;
    border-width: 3px;
  }

  .vvjb .vvjb-page-counter {
    background: #000;
    border: 2px solid #fff;
  }

  .vvjb .vvjb-progress-bar {
    background: rgba(255, 255, 255, 0.5);
  }

  .vvjb .vvjb-progress-bar::before {
    background: #fff;
  }

}

/* Hide features when data attributes indicate they're disabled */
.vvjb-inner[data-show-play-pause="false"] .vvjb-play-pause-wrapper {
  display: none;
}

.vvjb-inner[data-show-progress-bar="false"] .vvjb-progress-bar {
  display: none;
}

.vvjb-inner[data-show-page-counter="false"] .vvjb-page-counter {
  display: none;
}

/* Responsive Adjustments for Small Screens */
@media (max-width:576px) {
  .vvjb .vvjb-play-pause-button {
    width: 40px;
    height: 40px;
  }

  .vvjb .vvjb-play-pause-button svg {
    width: 20px;
    height: 20px;
  }

  .vvjb .vvjb-page-counter {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }

  .vvjb .vvjb-play-pause-wrapper {
    bottom: 0.5rem;
    inset-inline-end: 0.5rem;
  }

  .vvjb .vvjb-page-counter {
    bottom: 0.5rem;
    inset-inline-start: 0.5rem;
  }

}

/* Focus Management and Keyboard Navigation Indicators */
.vvjb[tabindex]:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.6);
  outline-offset: 4px;
}

/* Ensure inert items are truly non-interactive */
.vvjb .vvjb-item[inert] {
  user-select: none;
  -webkit-user-select: none;
}

.vvjb .vvjb-item[inert] * {
  pointer-events: none !important;
}

/* Loading State - Initial Hidden */
.vvjb-inner[hidden] {
  opacity: 0;
  visibility: hidden;
}

/* Smooth Fade-In After Initialization */
.vvjb-inner[data-vvjb-initialized="true"] {
  animation: vvjb-fade-in 0.4s ease-in-out;
}

@keyframes vvjb-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }

}

/* Hide when paused */
.vvjb-inneris-paused .vvjb-progress-bar::after,
.vvjb-inner.is-paused .vvjb-progress-bar {
  opacity: 0;
  visibility: hidden;
  height: 0;
}

[dir="rtl"] .vvjb-carousel-options {
  flex-direction: row-reverse;
}
