/**
 * Nhatrang Tours - Embed Video Block Styles
 * Префикс: nhe- (Nhatrang Embed)
 * Все стили инкапсулированы для избежания конфликтов с внешними сайтами
 */

/* Контейнер блока */
.nhe-videos-block {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Заголовок с иконкой */
.nhe-videos-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.nhe-videos-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.nhe-videos-title {
    font-size: 1.1em;
    font-weight: 800;
    color: #2c3e50;
    margin: 0;
    line-height: 35px;
}

/* Скролл-контейнер для видео */
.nhe-videos-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.nhe-videos-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Карточка видео */
.nhe-video-card {
    position: relative;
    width: 160px;
    height: 290px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: transform 0.2s ease;
}

.nhe-video-card:hover {
    transform: translateY(-4px);
}

/* Превью видео */
.nhe-video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nhe-video-thumb-img {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Overlay при наведении */
.nhe-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nhe-video-card:hover .nhe-video-overlay {
    opacity: 1;
}

/* Кнопка Play */
.nhe-video-play-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nhe-video-play-btn::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 16px solid #E55A25;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    margin-left: 4px;
}

/* Badge платформы (внизу слева) */
.nhe-video-platform-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.5em;
    font-weight: 700;
    color: white;
    z-index: 2;
}

.nhe-video-card.youtube .nhe-video-platform-badge {
    background-color: #FF0000;
}

.nhe-video-card.tiktok .nhe-video-platform-badge {
    background-color: #000000;
}

.nhe-video-card.instagram .nhe-video-platform-badge {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
}

/* Drawer для видео */
.nhe-video-drawer {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 70%;
    background: #fff;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.nhe-video-drawer.active {
    display: block;
    transform: translateY(0);
}

.nhe-video-drawer-overlay {
    display: none;
    position: fixed;
    z-index: 999998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.nhe-video-drawer-overlay.active {
    display: block;
}

.nhe-video-drawer-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    position: relative;
}

.nhe-drawer-vietvibe-link {
    color: #E55A25 !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nhe-drawer-vietvibe-link:hover {
    color: #d14915 !important;
    text-decoration: underline !important;
}

.nhe-drawer-vietvibe-link:visited {
    color: #E55A25 !important;
}

.nhe-drawer-vietvibe-link:focus {
    outline: none !important;
    color: #E55A25 !important;
}

.nhe-drawer-vietvibe-link:active {
    color: #E55A25 !important;
}

.nhe-video-drawer-close {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: none;
    outline: none;
    background: transparent !important;
    box-shadow: none !important;
    color: #666;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
    position: absolute;
    right: 20px;
}

.nhe-video-drawer-close:hover {
    color: #333 !important;
    background: #e0e0e0 !important;
    border-radius: 4px;
}

.nhe-video-drawer-close:focus {
    outline: none !important;
    box-shadow: none !important;
}

.nhe-video-drawer-content {
    position: relative;
    height: calc(100% - 62px);
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #000;
    padding-top: 20px;
}

.nhe-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nhe-video-container iframe,
.nhe-video-container blockquote {
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    border: none !important;
}

/* Кнопки навигации */
.nhe-video-nav-btn {
    pointer-events: all;
    background: none;
    border: none;
    width: 0px;
    height: 0px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px;
    transition: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.nhe-video-nav-btn:hover {
    transform: translateY(-50%);
    box-shadow: none;
    background: #ffffff80;
}

.nhe-video-nav-btn:active,
.nhe-video-nav-btn:focus {
    transform: translateY(-50%);
    box-shadow: none;
    outline: none;
}

.nhe-video-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: none;
}

.nhe-video-nav-btn:disabled:hover {
    transform: translateY(-50%);
    box-shadow: none;
}

.nhe-nav-arrow {
    width: 68px !important;
    height: 68px !important;
    display: block !important;
    pointer-events: none !important;
    flex-shrink: 0 !important;
    object-fit: contain !important;
    filter: none;
}

.nhe-video-nav-prev {
    left: 20px;
}

.nhe-video-nav-next {
    right: 20px;
}

/* Footer со ссылкой на Vietvibe */
.nhe-videos-footer {
    margin-top: 20px;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.nhe-vietvibe-link {
    display: inline-block;
    color: #E55A25 !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nhe-vietvibe-link:hover {
    color: #d14915 !important;
    text-decoration: underline !important;
}

.nhe-vietvibe-link:visited {
    color: #E55A25 !important;
}

.nhe-vietvibe-link:focus {
    outline: none !important;
    color: #E55A25 !important;
}

.nhe-vietvibe-link:active {
    color: #E55A25 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .nhe-videos-block {
        padding: 16px;
        margin: 16px -16px; /* Убираем отступы по бокам на мобильных */
        border-radius: 0;
    }

    .nhe-videos-title {
        font-size: 1.1em;
    }

    .nhe-video-card {
        width: 110px;
        height: 200px;
    }

    .nhe-video-play-btn {
        width: 50px;
        height: 50px;
    }

    .nhe-video-play-btn::before {
        border-left-width: 14px;
        border-top-width: 9px;
        border-bottom-width: 9px;
    }

    .nhe-modal-content {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
    }

    .nhe-video-container {
        border-radius: 12px 12px 0 0;
    }

    .nhe-video-drawer {
        height: 80%;
    }

    .nhe-video-drawer-header {
        padding: 12px 15px;
    }

    .nhe-video-drawer-close {
        font-size: 28px;
        width: 28px;
        height: 28px;
    }

    .nhe-video-nav-btn {
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
    }

    .nhe-nav-arrow {
        width: 34px !important;
        height: 34px !important;
    }

    .nhe-video-nav-prev {
        left: 10px;
    }

    .nhe-video-nav-next {
        right: 10px;
    }
}
