/* Video Preview Addon Styles */

/* Play icon overlay on thumbnails */
.visolix-thumb,
.visolix-media-box {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.visolix-thumb:hover,
.visolix-media-box:hover {
    transform: scale(1.02);
}

.visolix-media-box img {
    display: block;
    width: 100%;
    transition: filter 0.3s ease;
}

.visolix-thumb:hover img,
.visolix-media-box:hover img {
    filter: brightness(0.9);
}

.visolix-thumb .play-overlay,
.visolix-media-box .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.visolix-thumb:hover .play-overlay,
.visolix-media-box:hover .play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Video play icon (triangle) */
.play-overlay::before {
    content: '';
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='5,3 19,12 5,21 5,3'%3E%3C/polygon%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Image preview icon (fullscreen expand icon) */
.visolix-thumb[data-media-type="image"] .play-overlay::before,
.visolix-media-box[data-media-type="image"] .play-overlay::before,
.play-overlay.image-preview::before {
    content: '';
    width: 20px;
    height: 20px;
    border: none;
    margin: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3Cpath d='M21 3l-7 7'/%3E%3Cpath d='M3 21l7-7'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Video Preview Modal */
.video-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.98));
    backdrop-filter: blur(20px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-preview-modal.active {
    display: flex;
    opacity: 1;
}

.video-preview-modal .modal-content {
    position: relative;
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-preview-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.video-preview-modal video,
.video-preview-modal img {
    width: 100%;
    height: auto;
    max-height: calc(90vh - 60px);
    display: block;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.video-preview-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-preview-modal .close-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.video-preview-modal .close-btn:active {
    transform: scale(0.95) rotate(90deg);
}

/* Navigation buttons */
.video-preview-modal .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
}

.video-preview-modal .nav-btn.active {
    opacity: 1;
    pointer-events: auto;
}

.video-preview-modal .nav-btn.prev {
    left: 20px;
}

.video-preview-modal .nav-btn.next {
    right: 20px;
}

.video-preview-modal .nav-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.video-preview-modal .nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.video-preview-modal .nav-btn::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.video-preview-modal .nav-btn.next::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

/* Fullscreen toggle button */
/* Fullscreen button removed from modal */

/* Loading spinner */
.video-preview-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    color: white;
    font-size: 16px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
    margin-bottom: 20px;
    position: relative;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: spin-reverse 1.5s linear infinite;
}

.video-preview-loading p {
    margin: 0;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.5s ease 0.2s both;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Error message */
.video-preview-error {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    color: white;
    text-align: center;
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

.video-preview-error .error-icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #ff6b6b;
    text-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
    animation: bounceIn 0.6s ease;
}

.video-preview-error h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.5s ease 0.1s both;
}

.video-preview-error p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.5;
    max-width: 400px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.5s ease 0.2s both;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Fullscreen mode removed */

/* Responsive design */
@media (max-width: 768px) {
    .video-preview-modal {
        padding: 10px;
    }

    .video-preview-modal .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 0;
    }

    .video-preview-modal video,
    .video-preview-modal img {
        max-height: calc(95vh - 80px);
        border-radius: 6px;
    }

    .video-preview-modal .close-btn {
        width: 45px;
        height: 45px;
        font-size: 22px;
        top: 10px;
        right: 10px;
    }

    .video-preview-modal .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .video-preview-modal .nav-btn.prev {
        left: 10px;
    }

    .video-preview-modal .nav-btn.next {
        right: 10px;
    }

/* Fullscreen button removed from responsive styles */

    .play-overlay {
        width: 65px;
        height: 65px;
    }

    .play-overlay::before {
        border-left-width: 16px;
        border-top-width: 8px;
        border-bottom-width: 8px;
    }

    .video-preview-loading {
        min-height: 250px;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
    }

    .video-preview-error {
        min-height: 250px;
        padding: 20px;
    }

    .video-preview-error .error-icon {
        font-size: 48px;
    }

    .video-preview-error h3 {
        font-size: 18px;
    }

    .video-preview-error p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .video-preview-modal {
        padding: 5px;
    }

    .video-preview-modal .modal-content {
        border-radius: 0;
    }

    .video-preview-modal video,
    .video-preview-modal img {
        max-height: calc(95vh - 70px);
        border-radius: 4px;
    }

    .video-preview-modal .close-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 5px;
        right: 5px;
    }

    .video-preview-modal .nav-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .video-preview-modal .nav-btn.prev {
        left: 5px;
    }

    .video-preview-modal .nav-btn.next {
        right: 5px;
    }

/* Fullscreen button removed from mobile responsive styles */

    .play-overlay {
        width: 60px;
        height: 60px;
    }

    .play-overlay::before {
        border-left-width: 14px;
        border-top-width: 7px;
        border-bottom-width: 7px;
    }

    .video-preview-loading {
        min-height: 200px;
    }

    .loading-spinner {
        width: 45px;
        height: 45px;
    }

    .video-preview-error {
        min-height: 200px;
        padding: 15px;
    }

    .video-preview-error .error-icon {
        font-size: 40px;
    }

    .video-preview-error h3 {
        font-size: 16px;
    }

    .video-preview-error p {
        font-size: 13px;
    }
}