/**
 * KB Product Video - Frontend Styles
 */

/* Container */
.kbpv-product-videos {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kbpv-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Video Container */
.kbpv-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
}

.kbpv-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Layout 1: Standard */
.kbpv-layout-standard .kbpv-main-video {
    margin-bottom: 20px;
}

.kbpv-layout-standard .kbpv-video-title {
    margin-top: 10px;
    font-size: 16px;
    font-weight: 500;
}

.kbpv-layout-standard .kbpv-video-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.kbpv-layout-standard .kbpv-video-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 0 calc(33.333% - 10px);
}

.kbpv-layout-standard .kbpv-video-item:hover,
.kbpv-layout-standard .kbpv-video-item.active {
    background: #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kbpv-layout-standard .kbpv-thumbnail {
    width: 80px;
    height: 45px;
    margin-right: 10px;
    overflow: hidden;
    border-radius: 4px;
    flex-shrink: 0;
}

.kbpv-layout-standard .kbpv-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kbpv-layout-standard .kbpv-item-name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Layout 2: Grid */
.kbpv-layout-grid .kbpv-grid-item {
    cursor: pointer;
}

.kbpv-layout-grid .kbpv-thumb-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.kbpv-layout-grid .kbpv-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kbpv-layout-grid .kbpv-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.2s ease;
}

.kbpv-layout-grid .kbpv-grid-item:hover .kbpv-play-overlay {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.kbpv-layout-grid .kbpv-play-overlay i {
    font-size: 30px;
}

.kbpv-layout-grid .kbpv-default-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4caf50;
    color: #fff;
    padding: 2px 8px;
    font-size: 10px;
    border-radius: 3px;
    text-transform: uppercase;
}

.kbpv-layout-grid .kbpv-grid-title {
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

/* Layout 3: Carousel */
.kbpv-layout-carousel {
    position: relative;
}

.kbpv-carousel {
    overflow: hidden;
}

.kbpv-carousel-item {
    display: none;
}

.kbpv-carousel-item.active {
    display: block;
}

.kbpv-carousel-title {
    margin-top: 10px;
    font-size: 16px;
    text-align: center;
}

.kbpv-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    gap: 15px;
}

.kbpv-carousel-prev,
.kbpv-carousel-next {
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kbpv-carousel-prev:hover,
.kbpv-carousel-next:hover {
    background: #e0e0e0;
}

.kbpv-carousel-indicators {
    display: flex;
    gap: 8px;
}

.kbpv-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kbpv-indicator.active,
.kbpv-indicator:hover {
    background: #333;
}

/* Placeholder */
.kbpv-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    color: #666;
}

.kbpv-thumb-placeholder i {
    font-size: 30px;
}

/* Lazy Load Video Placeholder */
.kbpv-lazy-video .kbpv-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kbpv-lazy-video .kbpv-video-placeholder img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kbpv-lazy-video .kbpv-thumb-placeholder-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.kbpv-lazy-video .kbpv-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.kbpv-lazy-video .kbpv-play-button i {
    font-size: 72px;
    opacity: 0.9;
}

.kbpv-lazy-video .kbpv-video-placeholder:hover .kbpv-play-button {
    transform: translate(-50%, -50%) scale(1.15);
}

.kbpv-lazy-video .kbpv-video-placeholder:hover .kbpv-play-button i {
    opacity: 1;
    color: #ff0000;
}

/* Dark overlay on hover */
.kbpv-lazy-video .kbpv-video-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

.kbpv-lazy-video .kbpv-video-placeholder:hover::after {
    background: rgba(0, 0, 0, 0.4);
}

/* Modal */
.kbpv-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.kbpv-modal.active {
    display: block;
}

.kbpv-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.kbpv-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
}

.kbpv-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #fff;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.kbpv-modal-close:hover {
    background: #f0f0f0;
}

.kbpv-modal-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.kbpv-modal-video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.kbpv-modal-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

body.kbpv-modal-open {
    overflow: hidden;
}

/* Right Column Position */
.kbpv-position-right_column {
    max-width: 100%;
}

.kbpv-position-right_column .kbpv-video-container {
    padding-bottom: 75%; /* Taller aspect ratio for sidebar */
}

.kbpv-position-right_column .kbpv-layout-standard .kbpv-video-item {
    flex: 0 0 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .kbpv-layout-standard .kbpv-video-item {
        flex: 0 0 100%;
    }

    .kbpv-layout-grid .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 480px) {
    .kbpv-layout-grid .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
