* {
    margin: 0;
    padding: 0;
}

@font-face {
    font-family: Hero_light;
    src: url(../Fonts/Hero\ light.ttf);
}

@font-face {
    font-family: Hero_regular;
    src: url(../Fonts/Hero\ regular.ttf);
}

@font-face {
    font-family: Old_Classic;
    src: url(../Fonts/Old\ Classic.ttf);
}

@font-face {
    font-family: BonaNova;
    src: url(../Fonts/BonaNovaSC-Regular.ttf);
}

.container {
    margin: 0 8.5vw;
    position: relative;
}

body {
    background-color: #F6F9FA;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.textmain{
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 1vw;
    position: absolute;
    top: 0vw;
}

.mobile-header {
    display: none;
}

header{
    background-color: #595D5E;
    height: 5vw;
}
.mobile-menu{
    margin: 0 4vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 5vw;
}
.mobile-menu h1{
    font-family: BonaNova;
    font-weight: 100;
    font-size: 3vw;
    color: #F6F9FA;
    padding-top: 0.5vw;
}

/* Стили для десктопного меню */
.main_menu {
    display: flex;
    list-style-type: none;
    align-items: center;
    gap: 2vw;
}

.main_menu a{
    text-decoration: none;
    font-family: Hero_regular;
    font-size: 1.2vw;
    color: #F6F9FA;
}

.menu-search, .menu-header {
    display: none;
}

.desktop-icons {
    display: flex;
    gap: 1vw;
}

.desktop-icons img {
    height: 1.5vw;
}

/* Подменю */
.sub_menu {
    display: none;
    position: absolute;
    background-color: #595D5E;
    list-style: none;
    padding: 1vw;
    border-radius: 0.5vw;
    margin-top: 1vw;
}

.main_menu li:hover .sub_menu {
    display: block;
}

.sub_menu li {
    margin: 0.5vw 0;
}

h2 {
    font-family: Hero_regular;
    font-size: 2.5vw;
    color: #12171D;
    font-weight: 100;
}

.line {
    width: 9vw;
    height: 0.2vw;
    background-color: #595D5E;
}

.video{
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 1vw;
    margin-top: 2vw;
    margin-bottom: 2vw;
    flex: 1;

}

footer {
    background-color: #595D5E;
    height: 5vw;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
}

footer p {
    font-family: Hero_regular;
    font-size: 1vw;
    color: #F6F9FA;
}

.copyright {
    font-size: 2vw !important;
    margin-right: 0.3vw;
}

/* Мобильные стили */
@media (max-width: 768px) {
    .container {
        margin: 0 5vw;
    }

    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    /* Мобильный header */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 10px 5px 10px;
        background-color: #595D5E;
        position: relative;
        z-index: 1001;
    }

    .mobile-header h1 {
        font-family: BonaNova;
        font-weight: 100;
        font-size: 9vw;
        color: #F6F9FA;
        margin: 0;
        padding: 0;
    }

    /* Бургер меню */
    .burger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 20px;
        width: 30px;
        cursor: pointer;
        z-index: 1000;
    }

    .search-icon {
        height: 24px;
    }

    .burger-menu span {
        width: 100%;
        height: 2px;
        background-color: #F6F9FA;
        transition: all 0.3s;
    }

    .burger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .burger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .burger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Скрытие десктопного меню */
    header {
        height: auto;
    }

    .mobile-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: #595D5E;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 80px 20px 20px;
        transition: left 0.3s ease;
        z-index: 999;
        margin: 0;
        box-sizing: border-box;
    }

    .mobile-menu.active {
        display: block;
    }

    .mobile-menu h1 {
        display: none;
    }

    .menu-search, .menu-header {
        display: block;
        margin-bottom: 20px;
    }

    .menu-search {
        position: absolute;
        top: 80px;
        left: 20px;
    }

    .menu-search img {
        width: 24px;
        height: 24px;
    }

    .menu-header {
        position: absolute;
        top: 100px;
        left: 50%;
        transform: translateX(-50%);
    }

    .menu-header a {
        display: flex;
        align-items: center;
        gap: 5px;
        text-decoration: none;
        font-family: Hero_regular;
        font-size: 20px;
        color: #F6F9FA;
    }


    .menu-header img {
        width: 32px;
        height: 32px;
    }

    .mobile-controls {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .main_menu {
        position: relative;
        top: 95px;
        transform: none;
        text-align: center;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .main_menu li {
        width: 100%;
        margin: 0;
        padding: 18px 0;
        border-bottom: 1px solid #f6f9fa3f;
    }

    .main_menu li:last-child {
        border-bottom: none;
    }

    .main_menu a {
        font-size: 20px;
        font-weight: 100;
        font-family: Hero_light;
    }

    .sub_menu {
        display: none;
    }

    .desktop-icons {
        display: none;
    }

    /* Контент видео */
    .video {
        margin-top: 30px;
        margin-bottom: 30px;
        gap: 20px;
        flex: 1;
        padding: 0 20px;
        justify-content: start;
    }

    h2 {
        font-size: 32px;
        text-align: center;
        /* margin-bottom: 10px; */
    }

    .line {
        width: 80px;
        height: 2px;
        margin-bottom: 20px;
    }

    /* Footer */
    footer {
        height: auto;
        padding: 20px;
        margin-top: auto;
    }

    footer p {
        font-size: 14px;
    }

    .copyright {
        font-size: 20px !important;
        margin-right: 5px;
    }
}

/* Планшетная версия */
/* @media screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        margin: 0 40px;
    }

    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    header {
        height: 60px;
    }

    .menu {
        height: 60px;
    }

    .menu h1 {
        font-size: 32px;
        padding-top: 8px;
    }

    .main_menu a {
        font-size: 16px;
    }

    .desktop-icons img {
        height: 20px;
    }


    .mobile-header {
        display: none;
    }

    .menu-search, .menu-header {
        display: none;
    }


    .video {
        margin-top: 40px;
        margin-bottom: 40px;
        gap: 20px;
        flex: 1;
        justify-content: start;
    }

    h2 {
        font-size: 32px;
    }

    .line {
        width: 120px;
        height: 3px;
    }


    footer {
        height: 60px;
        padding: 20px;
        margin-top: auto;
    }

    footer p {
        font-size: 14px;
    }

    .copyright {
        font-size: 24px !important;
        margin-right: 8px;
    }
} */

/* Стили для страницы видео */
.videos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
    justify-content: space-between;
    width: 100%;
}

.video-item {
    flex: 0 0 23vw;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    border: 2px dashed #595D5E;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(116, 128, 127, 0.2);
    border-color: #12171D;
}

.video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #F6F9FA;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-item:hover .video-thumbnail img {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}

.video-item:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(18, 23, 29, 0.8);
    color: #F6F9FA;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: Hero_regular;
    font-weight: 400;
}

.video-info {
    padding: 1.2rem;
    background: #F6F9FA;
}

.video-info h3 {
    font-size: 1.1rem;
    font-family: Hero_regular;
    font-weight: 400;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    color: #12171D;
}

.video-description {
    font-size: 0.9rem;
    font-family: Hero_light;
    color: #595D5E;
    line-height: 1.5;
    /* margin: 0 0 0.8rem 0; */
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-family: Hero_light;
    color: #595D5E;
}

.views, .date {
    font-family: Hero_regular;
    font-weight: 400;
}

.no-videos {
    width: 100%;
    text-align: center;
    padding: 3rem 1rem;
    color: #595D5E;
}

.no-videos p {
    font-size: 1.1rem;
    font-family: Hero_regular;
    margin-bottom: 1.5rem;
}

.vk-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: #595D5E;
    color: #F6F9FA;
    text-decoration: none;
    border-radius: 10px;
    font-family: Hero_regular;
    font-weight: 400;
    transition: background-color 0.3s ease;
}

.vk-link:hover {
    background: #12171D;
}

.vk-link img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .videos-grid {
        justify-content: center;
        gap: 1.5rem;
        /* margin-top: 20vw; */
    }
    
    .video-item {
        flex: 0 0 100%;
        max-width: 400px;
    }
    
    .video-thumbnail {
        height: 180px;
    }
    
    .video-info {
        padding: 1rem;
    }
    
    .video-info h3 {
        font-size: 1rem;
    }
    
    .video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .no-videos {
        padding: 2rem 1rem;
    }
}

/* @media (max-width: 1024px) and (min-width: 769px) {
    .video-item {
        flex: 0 0 280px;
    }
} */

@media (max-width: 480px) {
    .video-item {
        flex: 0 0 100%;
        max-width: none;
    }
    
    .video-thumbnail {
        height: 160px;
    }
    
    .play-button svg {
        width: 50px;
        height: 50px;
    }
    
    .vk-link {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ====== МОДАЛЬНОЕ ОКНО С ВИДЕОПЛЕЕРОМ ====== */

.video-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.video-modal-content {
    position: relative;
    background-color: #F6F9FA;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.video-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background-color: #595D5E;
    color: #F6F9FA;
}

.video-modal-header h3 {
    font-family: Hero_regular;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-modal-close {
    background: none;
    border: none;
    color: #F6F9FA;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.video-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.video-modal-body {
    padding: 0;
    position: relative;
    min-height: 400px;
}

#video-player-container {
    width: 100%;
    height: 500px;
    background-color: #000;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

#video-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-loading, .video-error, .demo-video {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: #2c2c2c;
    color: #F6F9FA;
    font-family: Hero_regular;
}

.video-loading p {
    font-size: 1.2rem;
    margin: 0;
}

.video-error h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #ff6b6b;
}

.video-error p {
    font-size: 1rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.error-close-btn {
    background-color: #595D5E;
    color: #F6F9FA;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: Hero_regular;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.error-close-btn:hover {
    background-color: #5a6665;
}

.demo-video {
    background-color: #F6F9FA;
    color: #12171D;
    padding: 20px;
}

.demo-video h4 {
    color: #595D5E;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.demo-video p {
    margin-bottom: 20px;
    opacity: 0.8;
}

.video-modal-footer {
    padding: 15px 25px;
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
}

.external-video-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #595D5E;
    text-decoration: none;
    font-family: Hero_regular;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.external-video-link:hover {
    background-color: #595D5E;
    color: #F6F9FA;
}

.external-video-link img {
    width: 18px;
    height: 18px;
}

/* Ссылка на VK в видео-карточке */
.external-link {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-item:hover .external-link {
    opacity: 1;
}

.external-link a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.external-link a:hover {
    background-color: #4267B2;
    transform: scale(1.1);
}

.external-link img {
    filter: brightness(0) invert(1);
}

/* Стили для курсора на видео-карточках */
.video-link {
    cursor: pointer;
    position: relative;
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .video-modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        top: 20vw;
    }
    
    .video-modal-header {
        padding: 12px 16px;
    }
    
    .video-modal-header h3 {
        font-size: 1.1rem;
        max-width: 75%;
    }
    
    #video-player-container {
        height: calc(56.25vw); /* 16:9 соотношение для мобильных */
        max-height: 350px;
        min-height: 200px;
    }
    
    .video-modal-footer {
        padding: 10px 16px;
    }
    
    .external-video-link {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .video-modal.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .video-modal-content {
        width: 95%;
        margin: 0;
        border-radius: 12px;
        max-height: 85vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    .video-modal-header {
        padding: 15px;
        flex-shrink: 0;
    }
    
    .video-modal-header h3 {
        font-size: 1rem;
        max-width: 80%;
    }
    
    .video-modal-close {
        font-size: 1.8rem;
        width: 40px;
        height: 40px;
    }
    
    .video-modal-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 0;
    }
    
    #video-player-container {
        height: calc((95vw - 30px) * 9 / 16); /* 16:9 с учетом отступов */
        max-height: 300px;
        min-height: 180px;
        flex-shrink: 0;
    }
    
    .video-modal-footer {
        padding: 12px 15px;
        flex-shrink: 0;
    }
    
    .external-link {
        top: 8px;
        right: 8px;
    }
    
    .external-link a {
        width: 32px;
        height: 32px;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 360px) {
    .video-modal-content {
        width: 98%;
        margin: 0;
        max-height: 90vh;
    }
    
    .video-modal-header {
        padding: 10px 12px;
    }
    
    .video-modal-header h3 {
        font-size: 0.95rem;
    }
    
    .video-modal-close {
        font-size: 1.6rem;
        width: 36px;
        height: 36px;
    }
    
    #video-player-container {
        height: calc((98vw - 24px) * 9 / 16); /* 16:9 с учетом отступов */
        max-height: 250px;
        min-height: 160px;
    }
    
    .video-modal-footer {
        padding: 10px 12px;
    }
    
    .external-video-link {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
}

/* Прокрутка мобильного меню и списка пунктов */
@media screen and (max-width: 768px) {
    .mobile-menu {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: 100vh;
        padding: 60px 16px 16px; /* если уже есть — можно не дублировать */
    }
    .mobile-menu .main_menu {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Усиление для горизонтальной ориентации маленьких телефонов */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .mobile-menu {
        padding-top: 56px;
        max-height: 100vh;
        overflow-y: auto;
    }
    .mobile-menu .main_menu {
        top: 30px; /* если используется относительное позиционирование */
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}