/* --- BN ANALYTICS LIGHT MOBILE PATCH --- */

@media (max-width: 850px) {
    /* 1. Stack and Center All Headers & Search Bars */
    .header-top-row, 
    .nav-container, 
    .selectors-row, 
    .tools-glass-row, 
    .tools-glass-bar,
    .search-row, 
    .mode-toggle-container,
    .social-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 15px !important;
    }

    .nav-side-box, .search-center-box, .nav-side-box.right, .search-wrapper {
        width: 100% !important;
        justify-content: center !important;
        display: flex !important;
    }

    /* 2. Responsive Scaling for Titles */
    .page-title-main {
        font-size: 2rem !important;
        text-align: center !important;
        line-height: 1.1;
    }

    /* 3. Button Adjustments */
    .btn, .mode-btn {
        width: 80% !important;
        max-width: 300px;
    }

    /* 4. Natural Table Scrolling */
    /* This allows users to swipe the table without it breaking the layout */
    .table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
    }

    table {
        min-width: 1200px !important; /* Forces the table to stay wide so text doesn't wrap */
    }

    /* 5. Card Grids (KDPVP / Migrations) */
    #cardGrid, .podium-container {
        grid-template-columns: 1fr !important;
    }

    /* 6. Bento Grid (Index) */
    .bento-grid {
        grid-template-columns: 1fr !important;
    }
    .span-4, .span-3, .span-full {
        grid-column: span 1 !important;
    }
}

/* --- LANDSCAPE LOGO FIX --- */
/* Balanced look for sideways phones */
@media (max-height: 500px) and (orientation: landscape) {
    .brand-logo {
        width: 120px !important;   /* Increased from 50px to 120px */
        bottom: 15px !important;   /* Slightly off the very edge */
        opacity: 0.5 !important;   /* Increased from 0.15 to 0.5 for visibility */
        z-index: 5 !important;      /* Keep them visible but safe */
        pointer-events: none;      /* Clicks pass through to buttons */
    }

    /* Pull them tighter into the corners to leave the center buttons clear */
    .logo-right {
        right: 15px !important;
    }
    .logo-left {
        left: 15px !important;
    }

    /* Make the Hub buttons slightly more compact sideways so you can see more links at once */
    .bento-card {
        padding: 20px !important;
        min-height: 110px !important;
    }
    
    .card-header {
        padding: 15px 30px !important;
    }

    .card-header h1 {
        font-size: 2rem !important;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .bento-grid {
        grid-template-columns: 1fr 1fr !important; /* Show 2 columns instead of 1 when sideways */
    }
}