@charset "utf-8";

/* 1. БАЗА */
* { 
    /* Твои базовые правки */
    -webkit-tap-highlight-color: transparent; 
    outline: none; 
    box-sizing: border-box; 

    /* Запрет выделения текста и системных меню */
    -webkit-user-select: none; /* Safari/Chrome */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE/Edge */
    user-select: none;         /* Стандарт */
    
    /* Убираем синее выделение при клике на ссылки в мобилках */
    -webkit-touch-callout: none; 
}

/* ВАЖНО: Разрешаем выделение только в полях ввода, иначе админ не сможет писать */
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}

/* Чтобы картинки нельзя было "сохранить как" долгим тапом в приложении */
img {
    -webkit-user-drag: none;
    pointer-events: none; /* Если на картинке нет ссылок */
}

/* Плавный скролл для WebView */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}



body, html { margin: 0; padding: 0; width: 100%; height: 100%; background-color: #000; font-family: sans-serif; overflow: hidden; }

/* 2. MAIN И КОНТЕЙНЕРЫ */
/* Убираем position: fixed, используем абсолютное позиционирование или обычный поток */
main, .reels-container, #reels-main { 
    position: absolute; /* Вместо fixed для лучшей работы скролла */
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    z-index: 1; 
    overflow-y: auto; 
    background-color: #000;
    
    /* ВКЛЮЧАЕМ ЖЕСТКИЙ СКРОЛЛ */
    scroll-snap-type: y mandatory; 
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Плавность для iOS WebView */
}

/* Убираем лишние стили, оставляем только блокировку прокрутки нескольких штук */
.reels-container { 
    display: block; 
}

.reel-item { 
    position: relative; 
    width: 100%; 
    height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    
    /* ПРИВЯЗКА */
    scroll-snap-align: start; 
    /* ГЛАВНЫЙ ТОРМОЗ: не дает пролететь 2-3 серии за раз */
    scroll-snap-stop: always; 
    
    background: #000; 
    overflow: hidden; 
}

/* Скрываем скроллбар, чтобы не мешал в WebView */
#reels-main::-webkit-scrollbar {
    display: none;
}






/* 3. ВИДЕО */
.video-wrapper { 
    position: absolute !important; inset: 0; 
    display: flex; justify-content: center; align-items: center; 
    z-index: 10 !important; 
    pointer-events: auto !important;
}
.drama-video { height: 100% !important; width: auto !important; aspect-ratio: 9/16; object-fit: contain !important; cursor: pointer; }

/* 4. ИКОНКИ В ЦЕНТРЕ */
.video-overlay-ui { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 100; pointer-events: none; }
.ui-icon { 
    width: 80px; height: 80px; background: rgba(0,0,0,0.5); border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    opacity: 0; transform: scale(0.5); position: absolute; z-index: 101;
}

/* Стили для всех типов иконок в центре */
.play-ui, .play-pause-ui, .backward-ui, .forward-ui { opacity: 0; }

.ui-icon svg { fill: white !important; width: 40px; height: 40px; }
.ui-icon.animate { animation: icon-pop 0.5s ease-out forwards; }

/* 5. ИНТЕРФЕЙС ПЛЕЕРА */
.reels-actions { position: absolute; right: 15px; bottom: 120px; z-index: 2000; display: flex; flex-direction: column; gap: 15px; pointer-events: auto; }
.reel-info { position: absolute; left: 20px; bottom: 120px; z-index: 2000; pointer-events: none; text-shadow: 0 2px 10px #000; color: white; }
.video-progress-wrapper { position: absolute; bottom: 75px; left: 0; right: 0; height: 10px; background: rgba(255,255,255,0.2); z-index: 3000; cursor: pointer; pointer-events: auto; }
.video-progress-filled { background: #ff0000; height: 100%; width: 0; }

/* 6. МЕНЮ САЙТА */
header, .navbar, footer, .bottom-nav { 
    position: fixed; left: 0; width: 100%; z-index: 1000; 
    display: flex; align-items: center; justify-content: space-between; 
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); 
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); 
}
header, .navbar { 
    top: 0; 
    height: 65px; /* Оптимально для чистого экрана */
    padding: 15px 16px 0 16px; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(0,0,0,0)); 
}

/* Шапка внутри поиска тоже должна быть пониже */
#fullSearchOverlay > div:first-child {
    padding-top: 15px !important;
}

/* Если открыто в приложении, добавляем отступ снизу для полей ввода */
 
textarea {
    max-height: 150px !important;
}


footer, .bottom-nav { bottom: 0; height: 70px; padding: 0 24px; background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0)); padding-bottom: env(safe-area-inset-bottom); }


 

/* 7. СКРЫТИЕ UI */
body.hide-ui header, body.hide-ui .navbar { transform: translateY(-100%); opacity: 0; }
body.hide-ui footer, body.hide-ui .bottom-nav { transform: translateY(100%); opacity: 0; }
body.hide-ui .reels-actions { opacity: 0; transform: translateX(20px); }
body.hide-ui .reel-info { opacity: 0; transform: translateY(20px); }
body.hide-ui .video-progress-wrapper { bottom: 0 !important; height: 4px; }

/* 8. АНИМАЦИЯ */
@keyframes icon-pop { 
    0% { opacity: 0; transform: scale(0.5); } 
    50% { opacity: 1; transform: scale(1.1); } 
    100% { opacity: 0; transform: scale(1); } 
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.hidden { display: none !important; }

 
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}



/* Начальное состояние: блок виден (display: flex), но прозрачный и сдвинут вниз */
/* Фоновая подложка */
#comments-section {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0); /* Прозрачный фон */
    z-index: 9999;
    visibility: hidden; /* Элемент есть, но он не кликабелен */
    transition: background-color 0.4s ease, visibility 0.4s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Когда активен — затемняем фон */
#comments-section.active {
    visibility: visible;
    background-color: rgba(0, 0, 0, 0.8);
}

/* Сама шторка с контентом */
.comments-content {
    width: 100%;
    height: 80vh;
    background: #09090b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%); /* Прячем вниз за экран */
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1); /* Плавный выезд */
}

/* Выезжаем вверх */
#comments-section.active .comments-content {
    transform: translateY(0);
}

/* Состояние по умолчанию (когда убрали hidden) */
.comments-modal {
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none; /* Будет переключено на flex скриптом */
}

/* Когда JS добавил класс .active */
.comments-modal.active {
    opacity: 1;
}

/* Сама плашка с контентом */
.comments-modal .comments-content {
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.comments-modal.active .comments-content {
    transform: translateY(0);
}