/* Video Carousel Handler Styles */

/* Loading Spinner */
.video-loading {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 20px 30px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    font-family: 'IBM Plex Sans Thai', sans-serif !important;
    color: #333 !important;
    font-size: 14px !important;
    text-align: center !important;
    min-width: 200px !important;
    backdrop-filter: blur(5px) !important;
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 1.5px solid #f0f0f0;
    border-top: 1.5px solid #000000;
    border-radius: 50%;
    animation: video-spinner 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes video-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Active Video Item */
.active-video {
    /* opacity: 0.8 !important; */
    border: 1.5px solid #0c0c0c !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    /* transform: scale(0.95) !important; */
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.3) !important;
}

.active-video:hover {
    /* transform: scale(0.98) !important; */
    box-shadow: 0 12px 35px rgba(0, 124, 186, 0.4) !important;
}

/* Hover Effects for Carousel Items */
.swiper-slide .elementor-post,
.loop-item,
.e-loop-item {
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.swiper-slide .elementor-post:hover,
.loop-item:hover,
.e-loop-item:hover {
    /* transform: translateY(-2px) !important; */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Notification Styles */
.video-notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 10000 !important;
    padding: 15px 25px !important;
    border-radius: 8px !important;
    font-family: 'IBM Plex Sans Thai', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    max-width: 350px !important;
    opacity: 0 !important;
    transform: translateX(100%) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.video-notification.show {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.video-notification-success {
    background: rgba(76, 175, 80, 0.95) !important;
    color: white !important;
    border-left: 4px solid #4caf50 !important;
}

.video-notification-error {
    background: rgba(244, 67, 54, 0.95) !important;
    color: white !important;
    border-left: 4px solid #f44336 !important;
}

.video-notification-warning {
    background: rgba(255, 193, 7, 0.95) !important;
    color: #333 !important;
    border-left: 4px solid #ffc107 !important;
}

.video-notification-info {
    background: rgba(33, 150, 243, 0.95) !important;
    color: white !important;
    border-left: 4px solid #2196f3 !important;
}

/* Video Container Enhancement */
.elementor-widget-video {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 12px !important;
}

.elementor-widget-video iframe {
    transition: all 0.3s ease !important;
    border-radius: 12px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .video-notification {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
        font-size: 13px !important;
        padding: 12px 20px !important;
    }
    
    .video-loading {
        min-width: 180px !important;
        padding: 15px 20px !important;
        font-size: 13px !important;
    }
    
    .loading-spinner {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }
}

@media (max-width: 480px) {
    .video-notification {
        font-size: 12px !important;
        padding: 10px 15px !important;
    }
    
    .video-loading {
        min-width: 150px !important;
        padding: 12px 15px !important;
        font-size: 12px !important;
    }
    
    .loading-spinner {
        width: 18px;
        height: 18px;
        margin-bottom: 8px;
    }
}

/* Animation for Video Updates */
@keyframes videoFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.elementor-widget-video iframe.updating {
    animation: videoFadeIn 0.5s ease-out;
}

/* Focus States for Accessibility */
.swiper-slide .elementor-post:focus,
.loop-item:focus,
.e-loop-item:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
}

/* Prevent Text Selection during Click */
.swiper-slide .elementor-post,
.loop-item,
.e-loop-item {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Loading State for Video Container */
.video-container-loading {
    pointer-events: none !important;
    opacity: 0.7 !important;
}

.video-container-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 998;
}