/*
 * RESPONSIVE STYLES
 * Mobile-first design adapted for tablets and desktops.
 */

/* Base: prevent horizontal scroll on small screens */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img, svg, video {
    max-width: 100%;
    height: auto;
}

/* ============================================================
 * MOBILE (default, < 768px) — keep existing layout
 * ============================================================ */

/* ============================================================
 * TABLET (>= 768px)
 * ============================================================ */
@media (min-width: 768px) {
    .navbar {
        padding-inline: 32px;
    }

    .navbar--logo {
        width: 150px;
    }

    /* Center the mobile-style content inside a card-like container on tablets */
    main {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
        padding-inline: 16px;
        box-sizing: border-box;
    }

    .scrollable-nav .nav-items {
        overflow-x: visible;
        justify-content: center;
    }

    .nav-item {
        font-size: 17px;
    }

    .main-title {
        font-size: 28px;
    }

    .slides > div {
        width: 45vw !important;
        max-width: 340px;
    }

    .img-block {
        height: 22rem;
    }

    .prefooter div {
        max-width: 33%;
    }
}

/* ============================================================
 * DESKTOP (>= 1024px)
 * ============================================================ */
@media (min-width: 1024px) {
    .navbar {
        padding-inline: 48px;
    }

    .navbar--hamburger {
        display: none;
    }

    main {
        max-width: 960px;
        padding-inline: 24px;
    }

    .index-background {
        height: 520px;
    }

    .main-title {
        font-size: 32px;
    }

    .nav-item {
        padding: 24px 36px 16px 32px;
        font-size: 18px;
    }

    .scroll-button {
        display: none;
    }

    .slides {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
        gap: 16px;
    }

    .slides > div {
        width: 280px !important;
        max-width: 280px;
        flex-shrink: 1;
    }

    .img-block {
        height: 18rem;
    }

    .prefooter div {
        max-width: 25%;
    }

    /* Bigger forms on desktop */
    .form-passenger,
    .index-input {
        font-size: 17px;
    }

    .btn-success,
    .btn-success-2,
    .btn-disabled,
    .btn-select-flight {
        font-size: 1.05rem;
        padding: 14px;
    }
}

/* ============================================================
 * LARGE DESKTOP (>= 1280px)
 * ============================================================ */
@media (min-width: 1280px) {
    main {
        max-width: 1100px;
    }

    .navbar {
        padding-inline: 64px;
    }
}

/* ============================================================
 * MOBILE TWEAKS (<= 480px) — prevent overflow
 * ============================================================ */
@media (max-width: 480px) {
    .navbar {
        padding-inline: 12px;
    }

    .navbar--logo {
        width: 100px;
    }

    .nav-item {
        padding: 20px 18px 14px 18px;
        font-size: 14px;
    }

    .main-title {
        font-size: 22px;
    }

    .img-block {
        height: 14rem;
        padding: 1rem;
        font-size: 14px;
    }

    .btn-success,
    .btn-success-2,
    .btn-disabled {
        font-size: 1rem;
        padding: 14px;
    }

    .prefooter div {
        max-width: 100%;
    }

    .slides > div {
        width: 85vw !important;
    }
}

/* ============================================================
 * MODAL — full-screen on mobile, centered card on desktop
 * ============================================================ */
@media (min-width: 768px) {
    .modal {
        max-width: 560px;
        left: 50%;
        transform: translateX(-50%);
        min-height: auto;
        max-height: 90vh;
        overflow-y: auto;
        margin-top: 4vh;
        border-radius: 12px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    }

    .modal-flight-resume {
        max-width: 720px;
        left: 50%;
        transform: translateX(-50%);
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    }
}

/* ============================================================
 * ADMIN PANEL — make the wide table scroll horizontally on small screens
 * ============================================================ */
@media (max-width: 1024px) {
    .panel-table,
    .data-table,
    table.users-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
