/**
 * Clickable Video Thumbnails - стили для интерактивных превью
 */

/* Базовые стили для превью */
.videoItem-cover {
    position: relative;
    overflow: hidden;
}

.videoItem-cover .thumb {
    background-size: cover !important;
    background-position: center center !important;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Hover эффекты для превью */
.videoItem-cover:hover .thumb {
    transform: scale(1.05);
    filter: brightness(0.9);
}

/* Overlay эффект при наведении */
.thumb-overlay:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

.thumb-overlay:hover .play-icon {
    opacity: 1 !important;
}

/* Стили для иконки воспроизведения */
.play-icon {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transform: scale(0.9);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.thumb-overlay:hover .play-icon {
    transform: scale(1);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .play-icon {
        width: 40px;
        height: 40px;
    }
    
    .videoItem-cover:hover .thumb {
        transform: scale(1.02);
    }
}

/* Стили для превью в админ-панели */
.files-thumb {
    transition: all 0.3s ease;
    border-radius: 4px;
    flex-shrink: 0; /* Предотвращаем сжатие превью */
}

.files-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Стили для контейнера файлов в My Files */
.files-name {
    min-height: 80px; /* Минимальная высота для превью */
}

.files-name.d-flex {
    align-items: center;
}

.files-name.d-flex .text-truncate {
    flex: 1; /* Название занимает оставшееся пространство */
    min-width: 0; /* Позволяет text-truncate работать */
    line-height: 1.4;
}

.files-name.d-flex img.files-thumb {
    margin-right: 0.75rem !important; /* Consistent spacing */
}

/* Выравнивание ячеек таблицы в My Files */
#xfiles td {
    vertical-align: middle !important;
}

#xfiles td.left {
    vertical-align: middle !important;
    width: auto !important;
}

#xfiles .check-radio {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px; /* Минимальная высота, но не фиксированная */
    margin: 0;
}

.files-name.d-flex {
    align-items: center;
}

/* Выравнивание для папок (без d-flex) */
#xfiles .files-name:not(.d-flex) {
    display: flex;
    align-items: center;
    min-height: 80px;
}

#xfiles .files-name:not(.d-flex) a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .files-thumb {
        max-width: 60px !important;
        height: auto;
    }
    
    .files-name.d-flex {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
    }
    
    .files-name.d-flex .text-truncate {
        margin-top: 0.5rem;
        text-align: left;
    }
    
    #xfiles .check-radio {
        min-height: 60px;
    }
}

/* Стили для превью в связанных видео */
.relatedVideo-image img {
    transition: all 0.3s ease;
    border-radius: 4px;
}

.relatedVideo-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Прелоадер для превью */
.thumb {
    position: relative;
}

.thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
                linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.thumb.loading::before {
    opacity: 1;
}

/* Улучшенные стили для временной метки */
.videoItem-time {
    background: rgba(0,0,0,0.8) !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    backdrop-filter: blur(4px);
    z-index: 2;
    position: relative;
}

/* Анимация появления */
.videoItem {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
