/* ===========================================
   ПЛАНШЕТНИЙ ТА МОБІЛЬНИЙ ВИГЛЯД
   =========================================== */

/* --- ПЛАНШЕТИ (768px - 1024px) --- */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Переключаємо на вертикальний скролл */
    body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh;
    }

    /* Viewport для планшетів - вертикальний скролл */
    .viewport {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        cursor: auto !important;
    }

    .viewport-track {
        width: 100% !important;
        min-height: auto !important;
    }

    /* Навбар фіксований зверху */
    #navbar {
        position: fixed !important;
        left: 50% !important;
        top: 20px !important;
        transform: translateX(-50%) !important;
        width: 90% !important;
        max-width: 800px;
        z-index: 1000 !important;
    }

    /* AI кнопка фіксована знизу */
    #ai-assistant-button {
        position: fixed !important;
        left: 20px !important;
        bottom: -70px !important;
        z-index: 1000 !important;
    }

    /* Картки вертикально */
    .uzhnet-card, .services-card, .app-card, .for-business-card, .projects-card, .contacts-card {
        position: relative;
        left: 0;
        scale: 0.9 !important;
        display: block !important;
    }

    #cards {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100% !important;
        gap: 30px;
        height: fit-content;
        left: 0;
        padding-top: 80px;
        padding-bottom: 100px;
    }

    .uzhnet-holo-card {
        height: auto !important;
        padding-bottom: 20px;
        padding-top: 0px !important;
    }

    /* Фон та зірки */
    #sky {
        width: 100%;
        height: 4500px;
    }

    #starfield {
        width: 100%;
        height: 4500px;
    }

    #comet-canvas {
        width: 100%;
        height: 4500px;
        display: none;
    }

    #planet-container {
        width: 100%;
        height: 4500px;
        display: none;
    }

    #star-container {
        width: 100%;
        height: 4500px;
        position: relative;
        display: none;
    }

    /* Mobile Stars для планшетів */
    #mobile-stars-container {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 4500px;
        pointer-events: none;
        z-index: 1;
    }

    #mobile-starfield {
        width: 100%;
        height: 4500px;
    }

    #comet-container {
        width: 100%;
        height: 4500px;
        position: relative;
    }

    /* Приховуємо десктопні елементи */
    #landscape {
        display: none;
    }

    #tips {
        display: none;
    }

    #asteroids {
        height: 4500px;
        display: none;
    }

    /* Мобільний ландшафт для планшетів */
    #mobile-landscape {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 200px;
        z-index: 10;
        overflow: hidden;
    }

    .mobile-landscape-track {
        display: flex;
        position: absolute;
        bottom: 0;
        left: 0;
        animation: landscapeScroll 120s linear infinite;
    }

    .mobile-landscape-img {
        height: 200px;
        flex-shrink: 0;
    }

    /* Показуємо текст картки ДЛЯ БІЗНЕСУ */
    .for-business-card .for-business-card__content ul li {
        opacity: 1 !important;
    }

    .for-business-card .for-business-card__headers {
        opacity: 1 !important;
    }

    /* Карточки тарифів клікабельні */
    .tariff-card {
        cursor: pointer;
    }

    /* Приховуємо десктопний навбар, показуємо мобільний якщо потрібно */
    /* На планшеті можна показувати десктопний навбар з меншою шириною */
}

/* --- МОБІЛЬНИЙ (до 768px) --- */
@media screen and (max-width: 768px)  {
    /* Viewport для мобільних - вертикальний скролл */
    .viewport {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        cursor: auto !important;
    }

    .viewport-track {
        width: 100% !important;
        min-height: auto !important;
    }

    .uzhnet-card, .services-card, .app-card, .for-business-card, .projects-card, .contacts-card {
        position: relative;
        left: 0;
        scale: 1 !important;
        display: block !important
    }    

    .landscape-1 {
        height: 0 !important;
    }

    .landscape-2 {
        height: 0 !important;
    }
    
    .landscape-3 {
        height: 0 !important;
    }

    #cards {
        display: flex;
        flex-direction: column;
        /* justify-content: center; */
        align-items: center;
        width: 100% !important;
        gap: 20px;
        height: fit-content;
        left: -75px;
    }

    .uzhnet-holo-card {
        height: 480px !important;
        padding-bottom: 20px;
        padding-top: 0px !important;
    }

    #sky {
        width: 100%;
        height: 3900px;
    }

    #starfield {
        width: 100%;
        height: 3900px;
    }

    #comet-canvas {
        width: 100%;
        height: 3900px;

        display: none;
    }

    #planet-container {
        width: 100%;
        height: 3900px;
        display: none;
    }

    .uzhnet-holo-card:hover {
        box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.5) !important;
    }

    #landscape {
        display: none;
    }

    #navbar {
        display: none;
    }

    #star-container {
        width: 100%;
        height: 3900px;
        position: relative;
        display: none;
    }

    /* Mobile Stars */
    #mobile-stars-container {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 3900px;
        pointer-events: none;
        z-index: 1;
    }

    #mobile-starfield {
        width: 100%;
        height: 3900px;
    }

    #comet-container {
        width: 100%;
        height: 3900px;
        position: relative;
    }

    #mobile-navbar {
        position: fixed;
        left: 50%;
        top: 20px;

        transform: translateX(-50%);

        background-color: rgba(38, 40, 51, 0.4);
        width: 90%;
        height: 30px;

        display: flex !important;
        align-items: center;
        justify-content: space-evenly;
        z-index: 1000 !important;
    }

    /* AI кнопка фіксована */
    #ai-assistant-button {
        position: fixed !important;
        left: 20px !important;
        bottom: -70px !important;
        z-index: 1000 !important;
    }

    #tips {
        display: none;
    }
    #documents {
        display: none;
    }

    #asteroids {
        height: 3900px;
        display: none;
    }

    .document-card {
        display: block !important;
        scale: 1 !important;
        position: relative;
        left: 0;
        width: 336px;
    }

    body {
        height: 3773px;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    #mobile-landscape {
        display: block !important;
        position: fixed;
        bottom: -127px;
        left: 0;
        width: 100%;
        height: 330px;
        z-index: 10;
        overflow: hidden;
    }

    .mobile-landscape-track {
        display: flex;
        position: absolute;
        bottom: 0;
        left: 0;
        animation: landscapeScroll 120s linear infinite;
    }

    .mobile-landscape-img {
        height: 330px;
        flex-shrink: 0;
    }

    /* Показуємо текст картки ДЛЯ БІЗНЕСУ на мобільному */
    .for-business-card .for-business-card__content ul li {
        opacity: 1 !important;
    }

    .for-business-card .for-business-card__headers {
        opacity: 1 !important;
    }

    /* Карточки тарифов кликабельны на мобильном */
    .tariff-card {
        cursor: pointer;
    }
}

/* Загальна анімація для ландшафту (потрібна для обох медіа-запитів) */
@keyframes landscapeScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}