/* ============================================
   АДАПТИВНЫЕ СТИЛИ ДЛЯ ВИДЕО ПЛЕЕРА
   ============================================ */

/* Базовые улучшения для модального окна */
.modal {
    padding: 0;
}

.modal-content {
    width: 95%;
    max-width: 1200px;
    margin: 2% auto;
    background: #000;
    border-radius: 0;
}

/* Улучшения для Bunny Player Container */
#bunnyPlayerContainer {
    width: 100% !important;
    padding-top: 56.25% !important;
    /* 16:9 aspect ratio */
    position: relative !important;
    background: #000 !important;
}

#bunnyPlayerContainer iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Кнопка закрытия - адаптивная */
.modal .close {
    right: 10px;
    top: 10px;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    z-index: 3000;
}

/* ============================================
   МОБИЛЬНЫЕ УСТРОЙСТВА (до 600px)
   ============================================ */
@media (max-width: 600px) {
    .modal {
        padding: 0;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Плеер занимает оптимальную высоту */
    #bunnyPlayerContainer,
    .video-player-container {
        width: 100% !important;
        padding-top: 56.25% !important;
        max-height: 100vh;
    }

    /* Кнопка закрытия больше на мобильных */
    .modal .close {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
        right: 5px;
        top: 5px;
    }
}

/* ============================================
   ПЛАНШЕТЫ (601px - 1024px)
   ============================================ */
@media (min-width: 601px) and (max-width: 1024px) {
    .modal-content {
        width: 90%;
        max-width: 900px;
        margin: 5vh auto;
    }

    #bunnyPlayerContainer,
    .video-player-container {
        width: 100% !important;
        padding-top: 56.25% !important;
    }
}

/* ============================================
   ДЕСКТОП (от 1025px)
   ============================================ */
@media (min-width: 1025px) {
    .modal-content {
        width: 85%;
        max-width: 1200px;
        margin: 5vh auto;
    }

    #bunnyPlayerContainer,
    .video-player-container {
        width: 100% !important;
        padding-top: 56.25% !important;
    }
}

/* ============================================
   ЛАНДШАФТНАЯ ОРИЕНТАЦИЯ НА МОБИЛЬНЫХ
   ============================================ */
@media (max-width: 900px) and (orientation: landscape) {
    .modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    #bunnyPlayerContainer,
    .video-player-container {
        width: 100% !important;
        height: 100vh !important;
        padding-top: 0 !important;
    }

    #bunnyPlayerContainer iframe,
    .video-player-container video {
        object-fit: contain;
    }
}

/* ============================================
   УЛУЧШЕНИЯ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ
   ============================================ */
@media (max-width: 360px) {
    .modal .close {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }
}

/* ============================================
   УЛУЧШЕНИЯ ДЛЯ БОЛЬШИХ ЭКРАНОВ (4K и выше)
   ============================================ */
@media (min-width: 1920px) {
    .modal-content {
        max-width: 1600px;
    }
}