* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, #7C0C62 0%, #0E080A 100%);
    color: #FFFFFF;
    min-height: 100vh;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    position: relative;
    padding-bottom: 78px;
    overflow-x: hidden;
}

/* Search Bar */
.search-container {
    padding: 20px 20px 20px;
    position: relative;
    width: 100%;
}

.search-bar {
    width: 100%;
    max-width: 100%;
    height: 70px;
    background: rgba(242, 242, 242, 0.32);
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 0 72px; /* больше отступ слева под иконку */
    position: relative;
    box-sizing: border-box;
}

.search-icon {
    width: 24px;
    height: 24.35px;
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
}

.search-input {
    color: #FFFFFF;
    font-size: 24px;
    font-weight: 400;
    line-height: 28px;
    font-family: 'Roboto Flex', sans-serif;
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0;
}

.search-input::placeholder {
    color: #FFFFFF;
    opacity: 1;
}

.search-icon {
    cursor: pointer;
}

/* Main Content */
.main-content {
    padding: 0 24px;
    position: relative;
    margin-top: 0px;
}

/* Section Titles */
.section-title {
    font-size: 26px;
    font-weight: 600;
    line-height: 30px;
    color: #FFFFFF;
    margin-bottom: 15px;
    font-family: 'Roboto Flex', sans-serif;
    text-align: left;
}

/* Stories Section */
.stories-section {
    margin-top: 0px;
    margin-bottom: 15px;
}

.stories-section .section-title {
    margin-bottom: 16px;
    text-align: left;
}

.stories-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 10px 0;
    padding-right: 20px; /* Отступ справа для последнего элемента */
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    cursor: grab;
}

.stories-container:active {
    cursor: grabbing;
}

.stories-container::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* Не сжимаем элементы */
    min-width: 87px; /* Минимальная ширина для аватара */
    position: relative;
}

.clickable-redirect {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.clickable-redirect:active {
    opacity: 0.7;
}

.story-avatar {
    width: 100%;
    max-width: 80px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 3px solid #F300CE;
    padding: 0;
    background-color: transparent;
    overflow: visible;
    position: relative;
    box-sizing: border-box;
}

@media (min-width: 375px) {
    .story-avatar {
        max-width: 85px;
    }
}

@media (min-width: 414px) {
    .story-avatar {
        max-width: 87px;
    }
}

.story-avatar::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #D9D9D9;
    z-index: -1;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

.story-name {
    font-size: 26px;
    font-weight: 400;
    line-height: 30px;
    color: #FFFFFF;
    text-align: center;
    white-space: nowrap;
    font-family: 'Roboto Flex', sans-serif;
    margin-top: 8px;
}

/* Video Links */
.video-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    /* Увеличиваем кликабельную область */
    padding: 2px;
    margin: -2px;
}

.video-link:active {
    transform: scale(0.98);
}

/* Улучшенный hover эффект для видео */
.video-link:hover {
    transform: translateY(-4px);
    z-index: 100;
    position: relative;
}

/* Визуальный индикатор кликабельности */
.video-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: rgba(243, 0, 206, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.video-link:hover::before {
    background: rgba(243, 0, 206, 0.1);
    box-shadow: inset 0 0 50px rgba(243, 0, 206, 0.2);
}

/* Featured Video */
.featured-video-section {
    margin-bottom: 15px;
}

.featured-video {
    position: relative;
    width: 393px;
    height: 173px;
    border-radius: 20px;
    overflow: hidden;
    background: #D9D9D9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    animation: pulseGlow 2s ease-in-out infinite;
    border: 3px solid rgba(243, 0, 206, 0.5);
}

.video-link:hover .featured-video {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(243, 0, 206, 0.8),
                0 0 60px rgba(243, 0, 206, 0.6),
                0 0 80px rgba(243, 0, 206, 0.4),
                0 15px 40px rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(243, 0, 206, 1);
    animation: aggressivePulse 0.6s ease-in-out infinite;
}

/* При hover border остается 3px, поэтому внутренние элементы остаются с border-radius: 17px */
.video-link:hover .featured-video .video-preview-container {
    border-radius: 17px; /* 20px - 3px border = 17px */
}

.video-link:hover .featured-video .video-poster,
.video-link:hover .featured-video .video-preview-container .video-preview,
.video-link:hover .featured-video .video-overlay {
    border-radius: 17px !important;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(243, 0, 206, 0.4),
                    0 0 40px rgba(243, 0, 206, 0.2),
                    inset 0 0 20px rgba(243, 0, 206, 0.1);
        border-color: rgba(243, 0, 206, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(243, 0, 206, 0.6),
                    0 0 60px rgba(243, 0, 206, 0.4),
                    inset 0 0 30px rgba(243, 0, 206, 0.2);
        border-color: rgba(243, 0, 206, 0.8);
    }
}

@keyframes aggressivePulse {
    0%, 100% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(243, 0, 206, 0.8),
                    0 0 60px rgba(243, 0, 206, 0.6),
                    0 0 80px rgba(243, 0, 206, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 50px rgba(243, 0, 206, 1),
                    0 0 80px rgba(243, 0, 206, 0.8),
                    0 0 100px rgba(243, 0, 206, 0.6);
    }
}

/* Неоновая подсветка для активного видео */
.video-link.video-playing .featured-video,
.video-link.video-playing .video-item {
    box-shadow: 0 0 15px rgba(243, 0, 206, 0.5),
                0 0 30px rgba(243, 0, 206, 0.3),
                0 0 45px rgba(243, 0, 206, 0.2) !important;
    border: 2px solid rgba(243, 0, 206, 0.4);
    animation: neonGlow 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 1;
}

.video-link.video-playing .featured-video {
    border-radius: 20px;
}

.video-link.video-playing .video-item {
    border-radius: 10px;
}

@keyframes neonGlow {
    from {
        box-shadow: 0 0 15px rgba(243, 0, 206, 0.5),
                    0 0 30px rgba(243, 0, 206, 0.3),
                    0 0 45px rgba(243, 0, 206, 0.2) !important;
    }
    to {
        box-shadow: 0 0 20px rgba(243, 0, 206, 0.7),
                    0 0 35px rgba(243, 0, 206, 0.5),
                    0 0 50px rgba(243, 0, 206, 0.3) !important;
    }
}

.video-preview-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: transparent; /* Убрали серый фон, чтобы постер был виден сразу */
    border-radius: inherit; /* Наследуем закругления от родителя */
}

/* Прогресс-бар загрузки видео */
.video-loading-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 15;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-top-left-radius: inherit; /* Закругляем только верхние углы */
    border-top-right-radius: inherit;
}

.video-loading-progress.active {
    display: block;
    opacity: 1;
}

.video-loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #F300CE 0%, #8A0588 100%);
    width: 0%;
    transition: width 0.15s linear;
    box-shadow: 0 0 15px rgba(243, 0, 206, 0.8);
    border-radius: 0;
}

.video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    display: block;
    opacity: 1;
    background: transparent; /* Убираем любой фон */
    pointer-events: none; /* Не блокируем клики */
    border-radius: inherit; /* Наследуем закругления от контейнера */
}

/* Убеждаемся что постер всегда виден по умолчанию */
.video-preview-container .video-poster {
    display: block !important;
    opacity: 1 !important;
    z-index: 2 !important;
    border-radius: inherit !important; /* Наследуем закругления от контейнера */
}

/* Специфичные закругления для featured-video */
.featured-video .video-preview-container {
    border-radius: 17px; /* 20px - 3px border = 17px */
}

.featured-video .video-poster,
.featured-video .video-preview-container .video-preview {
    border-radius: 17px !important;
}

.featured-video .video-preview-container {
    width: 100%;
    height: 100%;
    border-radius: 17px; /* 20px - 3px border = 17px для featured-video */
    overflow: hidden;
}

.video-preview-container .video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1; /* По умолчанию под постером */
    border-radius: inherit; /* Наследуем закругления от контейнера */
}

/* Когда видео показывается, оно должно быть поверх постера */
.video-preview-container .video-preview[style*="z-index: 3"] {
    z-index: 3 !important;
}

.featured-video .video-preview-container .video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 17px; /* 20px - 3px border = 17px */
}

.video-link:hover .featured-video .video-preview-container .video-preview {
    transform: scale(1.08);
    filter: brightness(1.15) contrast(1.1) saturate(1.2);
}

.featured-video .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 5;
    pointer-events: none;
    border-radius: 17px; /* Соответствует внутреннему размеру */
}

.video-link:hover .featured-video .video-overlay {
    background: rgba(0, 0, 0, 0.2);
}

.featured-video .play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: transform 0.2s ease;
    pointer-events: none;
    animation: playButtonPulse 2s ease-in-out infinite;
}

.video-link:hover .featured-video .play-button-overlay {
    transform: translate(-50%, -50%) scale(1.3);
    animation: playButtonAggressive 0.5s ease-in-out infinite;
}

@keyframes playButtonPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes playButtonAggressive {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
    }
}

.featured-video .play-button-circle {
    width: 67.23px;
    height: 67.23px;
    border-radius: 50%;
    border: 4px solid #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(243, 0, 206, 0.4), rgba(138, 5, 136, 0.4));
    box-sizing: border-box;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(243, 0, 206, 0.6),
                0 0 40px rgba(243, 0, 206, 0.3),
                inset 0 0 20px rgba(255, 255, 255, 0.2);
    animation: circleGlow 2s ease-in-out infinite;
}

.video-link:hover .featured-video .play-button-circle {
    background: linear-gradient(135deg, rgba(243, 0, 206, 0.9), rgba(138, 5, 136, 0.9));
    border-width: 5px;
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 40px rgba(243, 0, 206, 1),
                0 0 60px rgba(243, 0, 206, 0.8),
                0 0 80px rgba(243, 0, 206, 0.6),
                inset 0 0 30px rgba(255, 255, 255, 0.4);
    transform: scale(1.2);
    animation: circleAggressive 0.4s ease-in-out infinite;
}

@keyframes circleGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(243, 0, 206, 0.6),
                    0 0 40px rgba(243, 0, 206, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(243, 0, 206, 0.8),
                    0 0 60px rgba(243, 0, 206, 0.5);
    }
}

@keyframes circleAggressive {
    0%, 100% {
        box-shadow: 0 0 40px rgba(243, 0, 206, 1),
                    0 0 60px rgba(243, 0, 206, 0.8),
                    0 0 80px rgba(243, 0, 206, 0.6);
    }
    50% {
        box-shadow: 0 0 50px rgba(243, 0, 206, 1),
                    0 0 80px rgba(243, 0, 206, 1),
                    0 0 100px rgba(243, 0, 206, 0.8);
    }
}

.featured-video .play-icon {
    width: 35.81px;
    height: 35.81px;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.video-link:hover .featured-video .play-icon {
    transform: scale(1.25);
    filter: drop-shadow(0 0 10px rgba(243, 0, 206, 1))
            drop-shadow(0 0 20px rgba(243, 0, 206, 0.8))
            drop-shadow(0 0 30px rgba(243, 0, 206, 0.6));
    animation: iconShake 0.3s ease-in-out infinite;
}

@keyframes iconShake {
    0%, 100% {
        transform: scale(1.25) rotate(0deg);
    }
    25% {
        transform: scale(1.3) rotate(-2deg);
    }
    75% {
        transform: scale(1.3) rotate(2deg);
    }
}

/* New Videos Section */
.new-videos-section {
    margin-bottom: 20px;
}

.new-videos-section .section-title {
    margin-bottom: 15px;
    text-align: left;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(2, 186px);
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* More Videos Button */
.more-videos-button {
    width: 100%;
    max-width: 393px;
    height: 50px;
    background: linear-gradient(135deg, rgba(243, 0, 206, 0.3), rgba(138, 5, 136, 0.3));
    border: 2px solid rgba(243, 0, 206, 0.5);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px auto 0;
    box-shadow: 0 0 15px rgba(243, 0, 206, 0.2);
    animation: moreVideosPulse 2s ease-in-out infinite;
}

.more-videos-button:hover,
.more-videos-button:active {
    background: linear-gradient(135deg, rgba(243, 0, 206, 0.5), rgba(138, 5, 136, 0.5));
    border-color: rgba(243, 0, 206, 0.9);
    box-shadow: 0 0 25px rgba(243, 0, 206, 0.5),
                0 0 40px rgba(243, 0, 206, 0.3);
    transform: translateY(-2px);
    animation: moreVideosAggressive 0.6s ease-in-out infinite;
}

@keyframes moreVideosPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(243, 0, 206, 0.2);
        border-color: rgba(243, 0, 206, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(243, 0, 206, 0.4);
        border-color: rgba(243, 0, 206, 0.7);
    }
}

@keyframes moreVideosAggressive {
    0%, 100% {
        box-shadow: 0 0 25px rgba(243, 0, 206, 0.5),
                    0 0 40px rgba(243, 0, 206, 0.3);
        transform: translateY(-2px);
    }
    50% {
        box-shadow: 0 0 35px rgba(243, 0, 206, 0.7),
                    0 0 50px rgba(243, 0, 206, 0.5);
        transform: translateY(-3px);
    }
}

.more-videos-text {
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 600;
    font-family: 'Roboto Flex', sans-serif;
    line-height: 1;
    letter-spacing: 0.5px;
}

.more-videos-arrow {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(243, 0, 206, 0.5));
}

.more-videos-button:hover .more-videos-arrow,
.more-videos-button:active .more-videos-arrow {
    transform: translateX(5px);
    filter: drop-shadow(0 0 10px rgba(243, 0, 206, 0.8));
}

.video-item {
    position: relative;
    width: 186px;
    height: 116px;
    border-radius: 10px;
    overflow: hidden;
    background: #D9D9D9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    animation: itemPulse 2.5s ease-in-out infinite;
    border: 2px solid rgba(243, 0, 206, 0.4);
}

@keyframes itemPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(243, 0, 206, 0.3),
                    0 0 30px rgba(243, 0, 206, 0.15);
        border-color: rgba(243, 0, 206, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(243, 0, 206, 0.5),
                    0 0 50px rgba(243, 0, 206, 0.3);
        border-color: rgba(243, 0, 206, 0.7);
    }
}

.video-link:hover .video-item {
    transform: scale(1.1);
    box-shadow: 0 0 35px rgba(243, 0, 206, 0.9),
                0 0 55px rgba(243, 0, 206, 0.7),
                0 0 75px rgba(243, 0, 206, 0.5),
                0 12px 30px rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(243, 0, 206, 1);
    animation: itemAggressive 0.7s ease-in-out infinite;
    z-index: 5;
}

/* При hover border увеличивается до 3px, поэтому внутренние элементы должны иметь border-radius: 7px (10px - 3px) */
.video-link:hover .video-item .video-preview-container {
    border-radius: 7px; /* 10px - 3px border = 7px */
}

.video-link:hover .video-item .video-poster,
.video-link:hover .video-item .video-preview-container .video-preview,
.video-link:hover .video-item .video-overlay {
    border-radius: 7px !important;
}

@keyframes itemAggressive {
    0%, 100% {
        transform: scale(1.1);
        box-shadow: 0 0 35px rgba(243, 0, 206, 0.9),
                    0 0 55px rgba(243, 0, 206, 0.7);
    }
    50% {
        transform: scale(1.13);
        box-shadow: 0 0 45px rgba(243, 0, 206, 1),
                    0 0 70px rgba(243, 0, 206, 0.9);
    }
}

.video-item .video-preview-container {
    width: 100%;
    height: 100%;
    border-radius: 8px; /* 10px - 2px border = 8px для video-item */
    overflow: hidden;
}

.video-item .video-preview-container .video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 8px; /* Соответствует внутреннему размеру */
}

.video-item .video-poster {
    border-radius: 8px !important; /* Соответствует внутреннему размеру */
}

.video-link:hover .video-item .video-preview-container .video-preview {
    transform: scale(1.12);
    filter: brightness(1.15) contrast(1.1) saturate(1.2);
}

.video-item .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 5;
    pointer-events: none;
    border-radius: 8px; /* Соответствует внутреннему размеру */
}

.video-link:hover .video-item .video-overlay {
    background: rgba(0, 0, 0, 0.25);
}

.video-item .play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: transform 0.2s ease;
    pointer-events: none;
    animation: itemPlayPulse 2.5s ease-in-out infinite;
}

@keyframes itemPlayPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
    }
}

.video-link:hover .video-item .play-button-overlay {
    transform: translate(-50%, -50%) scale(1.4);
    animation: itemPlayAggressive 0.5s ease-in-out infinite;
}

@keyframes itemPlayAggressive {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.6);
    }
}

.video-item .play-button-circle {
    width: 67.23px;
    height: 67.23px;
    border-radius: 50%;
    border: 4px solid #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(243, 0, 206, 0.4), rgba(138, 5, 136, 0.4));
    box-sizing: border-box;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(243, 0, 206, 0.6),
                0 0 40px rgba(243, 0, 206, 0.3),
                inset 0 0 20px rgba(255, 255, 255, 0.2);
    animation: itemCircleGlow 2.5s ease-in-out infinite;
}

@keyframes itemCircleGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(243, 0, 206, 0.6),
                    0 0 40px rgba(243, 0, 206, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(243, 0, 206, 0.8),
                    0 0 60px rgba(243, 0, 206, 0.5);
    }
}

.video-link:hover .video-item .play-button-circle {
    background: linear-gradient(135deg, rgba(243, 0, 206, 0.9), rgba(138, 5, 136, 0.9));
    border-width: 5px;
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 40px rgba(243, 0, 206, 1),
                0 0 60px rgba(243, 0, 206, 0.8),
                0 0 80px rgba(243, 0, 206, 0.6),
                inset 0 0 30px rgba(255, 255, 255, 0.4);
    transform: scale(1.2);
    animation: itemCircleAggressive 0.4s ease-in-out infinite;
}

@keyframes itemCircleAggressive {
    0%, 100% {
        box-shadow: 0 0 40px rgba(243, 0, 206, 1),
                    0 0 60px rgba(243, 0, 206, 0.8),
                    0 0 80px rgba(243, 0, 206, 0.6);
    }
    50% {
        box-shadow: 0 0 50px rgba(243, 0, 206, 1),
                    0 0 80px rgba(243, 0, 206, 1),
                    0 0 100px rgba(243, 0, 206, 0.8);
    }
}

.video-item .play-icon {
    width: 35.81px;
    height: 35.81px;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.video-link:hover .video-item .play-icon {
    transform: scale(1.3);
    filter: drop-shadow(0 0 10px rgba(243, 0, 206, 1))
            drop-shadow(0 0 20px rgba(243, 0, 206, 0.8))
            drop-shadow(0 0 30px rgba(243, 0, 206, 0.6));
    animation: itemIconShake 0.3s ease-in-out infinite;
}

@keyframes itemIconShake {
    0%, 100% {
        transform: scale(1.3) rotate(0deg);
    }
    25% {
        transform: scale(1.35) rotate(-2deg);
    }
    75% {
        transform: scale(1.35) rotate(2deg);
    }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 440px;
    height: 78px;
    background-color: rgba(54, 54, 54, 0); /* изначально прозрачное */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0;
    z-index: 1000;
    border-top: none;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    opacity: 0; /* появление по скроллу */
    pointer-events: none; /* чтобы не перекрывать контент, пока невидимо */
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
    flex: 1;
    height: 100%;
}

.nav-item:active {
    opacity: 0.7;
}

.nav-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.nav-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

/* Responsive Design */
@media (max-width: 440px) {
    body {
        max-width: 100%;
    }
    
    .search-container {
        padding-left: 15px;
        padding-right: 15px;
        padding-top: 25px;
        padding-bottom: 18px;
    }
    
    .search-bar {
        padding-left: 64px;
        padding-right: 16px;
        height: 60px;
    }
    
    .search-icon {
        left: 32px;
    }
    
    .main-content {
        margin-top: 0px;
    }
    
    .stories-section {
        margin-top: 12px;
        margin-bottom: 18px;
    }
    
    .stories-section .section-title {
        margin-bottom: 18px;
    }
    
    .featured-video {
        width: 100%;
        max-width: 393px;
    }
    
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .video-item {
        width: 100%;
    }
    
    .bottom-nav {
        max-width: 100%;
    }
    
    .stories-container {
        gap: 8px;
    }
    
    .story-avatar {
        max-width: 70px;
    }
    
    .story-name {
        font-size: 20px;
        line-height: 24px;
    }
    
    .search-text {
        font-size: 20px;
    }
    
    .featured-video-section {
        margin-bottom: 15px;
    }
    
    .new-videos-section {
        margin-bottom: 18px;
    }
    
    .new-videos-section .section-title {
        margin-bottom: 18px;
    }
    
    .more-videos-button {
        max-width: 100%;
        height: 48px;
        margin-top: 15px;
    }
    
    .more-videos-text {
        font-size: 20px;
    }
}

@media (max-width: 375px) {
    .search-container {
        padding-top: 25px;
        padding-bottom: 18px;
    }
    
    .search-bar {
        height: 58px;
    }
    
    .main-content {
        margin-top: 0px;
    }
    
    .stories-section {
        margin-top: 12px;
        margin-bottom: 18px;
    }
    
    .stories-section .section-title {
        margin-bottom: 18px;
    }
    
    .featured-video-section {
        margin-bottom: 15px;
    }
    
    .new-videos-section {
        margin-bottom: 18px;
    }
    
    .new-videos-section .section-title {
        margin-bottom: 18px;
    }
    
    .more-videos-button {
        height: 46px;
        margin-top: 15px;
    }
    
    .more-videos-text {
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .search-container {
        padding-top: 20px;
        padding-bottom: 16px;
    }
    
    .search-bar {
        height: 55px;
    }
    
    .main-content {
        margin-top: 0px;
    }
    
    .stories-container {
        gap: 6px;
    }
    
    .story-avatar {
        max-width: 65px;
    }
    
    .story-name {
        font-size: 18px;
        line-height: 22px;
    }
    
    .search-text {
        font-size: 18px;
    }
    
    .stories-section {
        margin-top: 10px;
        margin-bottom: 16px;
    }
    
    .stories-section .section-title {
        margin-bottom: 16px;
    }
    
    .featured-video-section {
        margin-bottom: 14px;
    }
    
    .new-videos-section {
        margin-bottom: 16px;
    }
    
    .new-videos-section .section-title {
        margin-bottom: 16px;
    }
    
    .more-videos-button {
        height: 44px;
        margin-top: 14px;
    }
    
    .more-videos-text {
        font-size: 18px;
    }
    
    .more-videos-arrow {
        width: 20px;
        height: 20px;
    }
}

@media (min-width: 414px) {
    .stories-section {
        margin-top: 0px;
    }
    
    .search-container {
        padding: 20px 20px 20px;
    }
    
    .main-content {
        margin-top: 0px;
    }
}

@media (min-width: 768px) {
    .stories-section {
        margin-top: 0px;
    }
    
    .search-container {
        padding: 25px 20px 25px;
    }
    
    .main-content {
        margin-top: 0px;
    }
    
    .stories-section {
        margin-bottom: 20px;
    }
    
    .featured-video-section {
        margin-bottom: 20px;
    }
    
    .new-videos-section {
        margin-bottom: 25px;
    }
    
    .more-videos-button {
        max-width: 450px;
        height: 55px;
    }
    
    .more-videos-text {
        font-size: 24px;
    }
}

@media (min-width: 441px) {
    body {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }
}

/* Safe area support for notched devices */
@supports (padding: max(0px)) {
    .bottom-nav {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        height: calc(78px + env(safe-area-inset-bottom));
    }
}

/* Video preview loading state */
.video-preview-container {
    min-height: 100%;
}

.video-preview-container video.video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Скрываем все элементы управления */
    pointer-events: none;
}

.video-preview-container video.video-preview::-webkit-media-controls {
    display: none !important;
}

.video-preview-container video.video-preview::-webkit-media-controls-enclosure {
    display: none !important;
}

.video-preview-container video.video-preview::-webkit-media-controls-panel {
    display: none !important;
}

.video-preview-container video.video-preview::-webkit-media-controls-play-button {
    display: none !important;
}

.video-preview-container video.video-preview::-webkit-media-controls-start-playback-button {
    display: none !important;
}

.video-preview-container iframe.iframe-preview {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Отключаем клики на iframe, чтобы работал клик на ссылку */
}
