/* Base reelpop styles */
.reelpop-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-origin: center center;
  -webkit-transform-origin: center center;
  -webkit-transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  will-change: transform, opacity;
}

.reelpop-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px;
  background: #000;
  color: #fff;
}

.reelpop-minimize {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.reelpop-minimize:hover {
  transform: scale(1.1);
  color: #ddd;
}

.reelpop-minimize:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.reelpop-content {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  background: #000;
}

/* Swiper specific styles */
.reelpop-swiper {
  width: 100%;
  height: 100%;
  background: #000;
}

.swiper-wrapper {
  width: 100%;
  height: 100%;
}

.reelpop-slide {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.reelpop-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  background: #000;
}

/* Video controls override */
.reelpop-video::-webkit-media-controls {
  display: none !important;
}

.reelpop-video::-webkit-media-controls-panel {
  display: none !important;
}

.reelpop-video::-webkit-media-controls-play-button {
  display: none !important;
}

.reelpop-video::-webkit-media-controls-timeline {
  display: none !important;
}

.reelpop-video::-webkit-media-controls-current-time-display {
  display: none !important;
}

.reelpop-video::-webkit-media-controls-time-remaining-display {
  display: none !important;
}

.reelpop-video::-webkit-media-controls-mute-button {
  display: none !important;
}

.reelpop-video::-webkit-media-controls-volume-slider {
  display: none !important;
}

.reelpop-video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

/* Loading and error states */
.reelpop-loading {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.8);
  animation: pulse 1.5s ease-in-out infinite;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.reelpop-error {
  text-align: center;
  padding: 20px;
  color: #ff4444;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reelpop-no-products {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Touch interaction improvements */
.reelpop-container,
.reelpop-minimize,
.reelpop-video {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.reelpop-container *:focus {
  outline: none;
}

.reelpop-container *:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Swiper effects */
.swiper-fade .swiper-slide {
  pointer-events: none;
  transition-property: opacity;
}

.swiper-fade .swiper-slide-active {
  pointer-events: auto;
}

/* Swiper fade effect improvement */
.swiper-fade .swiper-slide-active .reelpop-video {
  opacity: 1;
}

.swiper-fade .swiper-slide:not(.swiper-slide-active) .reelpop-video {
  opacity: 0;
}

/* Small mobile styles */
@media (max-width: 480px) {
  .reelpop-container {
    width: 120px !important;
    bottom: 10px;
    right: 10px;
  }

  .reelpop-header {
    padding: 4px;
  }

  .reelpop-minimize {
    font-size: 16px;
    width: 20px;
    height: 20px;
  }
}

/* Animations */
@keyframes bounceIn {
  0% {
    transform: scale(0.3) translateZ(-100px);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) translateZ(20px);
    opacity: 0.8;
  }
  70% {
    transform: scale(0.9) translateZ(10px);
    opacity: 0.9;
  }
  100% {
    transform: scale(1) translateZ(0);
    opacity: 1;
  }
}

@keyframes bounceOut {
  0% {
    transform: scale(1) translateZ(0);
    opacity: 1;
  }
  20% {
    transform: scale(1.1) translateZ(20px);
    opacity: 0.8;
  }
  100% {
    transform: scale(0.3) translateZ(-100px);
    opacity: 0;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .reelpop-container {
    transition: opacity 0.3s ease !important;
  }

  .reelpop-minimize {
    transition: none !important;
  }

  @keyframes bounceIn {
    0% {
      transform: scale(0.9);
      opacity: 0;
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }

  @keyframes bounceOut {
    0% {
      transform: scale(1);
      opacity: 1;
    }
    100% {
      transform: scale(0.9);
      opacity: 0;
    }
  }

  @keyframes pulse {
    0%,
    50%,
    100% {
      opacity: 0.8;
    }
  }

  .swiper-wrapper {
    transition-duration: 0ms !important;
  }
}
