/* =========================================================
   vUSAF MOBILE RESPONSIVE PATCH
   SAFE VERSION FOR LEGACY VAM + EVENTS + AETC
   ========================================================= */

/* ---------- GLOBAL ---------- */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Better mobile scaling */
* {
    box-sizing: border-box;
}

/* Prevent images from breaking layout */
img {
    max-width: 100%;
    height: auto;
}

/* Embedded media */
iframe,
embed,
object,
video {
    max-width: 100%;
}

/* ---------- MOBILE ONLY ---------- */

@media screen and (max-width: 1100px) {
    .topnav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .command-grid,
    .vusaf-live-dashboard,
    .vusaf-command-deck,
    .vusaf-command-bar,
    .vusaf-command-metrics,
    .vusaf-command-telemetry,
    .ops-grid,
    .mission-grid,
    .dashboard-grid,
    .vusaf-status-grid,
    .vusaf-quick-grid {
        grid-template-columns: 1fr !important;
    }

    .vusaf-shell {
        grid-template-columns: 1fr !important;
    }

    .vusaf-sidebar {
        position: relative !important;
        top: auto !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 0 12px !important;
    }

    .vusaf-main {
        padding: 12px !important;
    }

    .vusaf-live-card,
    .vusaf-live-card-news,
    .vusaf-live-card-landings,
    .vusaf-command-deck,
    .vusaf-status-strip {
        grid-column: 1 / -1 !important;
    }
}

@media screen and (max-width: 768px) {

    body {
        font-size: 14px;
        overflow-x: hidden;
    }

    .container,
    .wrapper,
    .main-content,
    .content,
    .page-content,
    .dashboard,
    .dashboard-wrapper,
    .page-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
    }

    nav,
    .navbar,
    .topnav,
    .menu,
    .navigation,
    .header-menu {
        width: 100%;
    }

    .navbar-header {
        float: none !important;
    }

    .navbar-toggle {
        display: block !important;
    }

    .navbar-collapse {
        max-height: none !important;
        overflow-x: hidden !important;
        border-top: 1px solid rgba(86, 182, 255, .24) !important;
    }

    .navbar-collapse.collapse {
        display: none !important;
    }

    .navbar-collapse.collapse.in,
    .navbar-collapse.in {
        display: block !important;
    }

    .navbar-nav {
        float: none !important;
        margin: 7.5px 0 !important;
    }

    nav ul,
    .navbar ul,
    .menu ul,
    .topnav ul {
        display: flex !important;
        flex-direction: column !important;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    nav li,
    .navbar li,
    .menu li,
    .topnav li {
        width: 100%;
        list-style: none;
        float: none !important;
    }

    nav a,
    .navbar a,
    .menu a,
    .topnav a {
        display: block;
        width: 100%;
        padding: 12px;
    }

    .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .navbar-brand {
        max-width: calc(100vw - 86px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero,
    .hero-banner,
    .banner,
    .header-banner {
        height: auto !important;
        padding: 20px 10px !important;
        background-position: center center !important;
    }

    .card,
    .mission-card,
    .dashboard-card,
    .event-card,
    .operations-card,
    .training-card {
        width: 100% !important;
        margin-bottom: 15px !important;
    }

    .row,
    .flex,
    .flex-row,
    .card-row,
    .mission-row {
        display: flex !important;
        flex-direction: column !important;
    }

    table {
        display: block;
        width: 100% !important;
        overflow-x: auto;
        white-space: nowrap;
        border-collapse: collapse;
    }

    th,
    td {
        padding: 8px !important;
        font-size: 13px !important;
    }

    input,
    select,
    textarea,
    button {
        width: 100%;
        max-width: 100%;
        margin-bottom: 10px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: auto;
        margin-bottom: 0;
    }

    .btn,
    button,
    input[type="submit"] {
        white-space: normal;
    }

    .sidebar,
    .left-sidebar,
    .right-sidebar {
        width: 100% !important;
        margin-bottom: 15px;
    }

    .pilot-card,
    .pilot-details,
    .roster-card {
        width: 100% !important;
    }

    .ops-grid,
    .mission-grid,
    .dashboard-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    canvas,
    #radarScope,
    #map,
    .scope-container {
        width: 100% !important;
        height: auto !important;
    }

    footer,
    .footer {
        text-align: center;
        padding: 20px 10px;
    }

    .vusaf-command-brand h1,
    .vusaf-command-title,
    .vusaf-dashboard h1 {
        font-size: 32px !important;
        line-height: 1.08 !important;
    }

    .vusaf-command-telemetry-value,
    .vusaf-command-metric-value {
        font-size: 30px !important;
    }

    .vusaf-status-strip,
    .vusaf-landing-list li,
    .vusaf-live-list li {
        grid-template-columns: 1fr !important;
        align-items: start !important;
    }

    .vusaf-status-detail {
        white-space: normal !important;
    }

    .spacer,
    .empty-column,
    .right-space,
    .left-space {
        display: none !important;
    }
}
