/* VideoMate Module CSS */

/* General widget styles */
.kb-product-videos {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.kb-product-videos h3 {
    margin-bottom: 20px;
    color: #232323;
    font-size: 18px;
    font-weight: 600;
}

.kb-video-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.kb-video-item {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
    background: #f8f8f8;
    margin-bottom: 20px;
}

.video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.kb-video-item video {
    width: 100%;
    max-width: 100%;
    height: auto;
}

.kb-video-title {
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
}

/* Floating widget styles */
.kb-video-floating-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 300px;
}

/* Carousel widget styles */
.kb-video-carousel-widget {
    margin: 20px 0;
}

.kb-video-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.kb-video-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.kb-video-carousel .kb-video-item {
    flex: 0 0 auto;
    width: 300px;
    margin-right: 20px;
    scroll-snap-align: start;
}

/* Grid widget styles */
.kb-video-grid-widget {
    margin: 20px 0;
}

.kb-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .kb-video-container {
        grid-template-columns: 1fr;
    }
    
    .kb-product-videos {
        margin: 15px 0;
        padding: 10px;
    }
    
    .kb-video-floating-widget {
        max-width: 250px;
    }
    
    .kb-video-carousel .kb-video-item {
        width: 250px;
    }
    
    .kb-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Floating widget position */
.kbvideomate-floating-left {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9999;
  max-width: 340px;
}
.kbvideomate-floating-right {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  max-width: 340px;
}
.kbvideomate-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
}
.kbvideomate-close:hover {
  color: #d00;
}

/* Responsive styles */
@media (max-width: 767px) {
  .kbvideomate-carousel-item,
  .kbvideomate-floating-item {
    margin-bottom: 12px;
  }
  .kbvideomate-floating-left,
  .kbvideomate-floating-right {
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 100vw;
    border-radius: 0;
  }
}

/* RTL support */
html[dir="rtl"] .kbvideomate-floating-left {
  left: auto;
  right: 20px;
}
html[dir="rtl"] .kbvideomate-floating-right {
  right: auto;
  left: 20px;
}
html[dir="rtl"] .kbvideomate-close {
  right: auto;
  left: 12px;
} 