/* ============================================================
   RESPONSIVE FIX - PC & Mobile Compatibility
   Ensures proper layout on both desktop and mobile devices
   ============================================================ */

/* =========================================
   1. NAVBAR - Full width on desktop
   ========================================= */

/* Expand navbar container to full width on all screens */
.app-header .navbar>.container-sm {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* On desktop (≥992px), show full navbar menu properly */
@media (min-width: 992px) {
    .app-header .navbar>.container-sm {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Ensure navbar items don't wrap unnecessarily */
    .navbar-nav.quick-links {
        flex-wrap: nowrap;
        gap: 0.25rem;
    }

    .navbar-nav.quick-links .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.6rem !important;
        white-space: nowrap;
    }

    /* Navbar collapse should be visible on desktop */
    .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }
}

/* On extra large screens, more spacing */
@media (min-width: 1200px) {
    .navbar-nav.quick-links .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem !important;
    }
}

/* =========================================
   2. CONTENT AREA - Proper width on desktop
   ========================================= */

/* Body wrapper should use full available width */
.body-wrapper>.container-fluid {
    max-width: 100% !important;
    width: 100% !important;
}

/* Override boxed layout constraint */
#main-wrapper[data-boxed-layout="boxed"] {
    max-width: 100% !important;
    width: 100% !important;
}

/* Desktop content area */
@media (min-width: 992px) {
    .body-wrapper>.container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Limit max width for readability but keep wide enough */
    .body-wrapper>.container-fluid>.container-fluid,
    .body-wrapper>.container-fluid>.container-lg {
        max-width: 1400px;
        margin: 0 auto;
    }
}

@media (min-width: 1400px) {
    .body-wrapper>.container-fluid {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

/* =========================================
   3. OFFCANVAS MENU - Mobile hamburger menu
   ========================================= */

/* Show hamburger button ONLY on mobile */
.navbar-toggler {
    display: none !important;
}

@media (max-width: 991.98px) {
    .navbar-toggler[data-bs-toggle="offcanvas"] {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: rgba(255, 215, 0, 0.15);
        border-radius: 8px;
        color: #FFD700;
        font-size: 1.4rem;
        transition: all 0.3s ease;
    }

    .navbar-toggler[data-bs-toggle="offcanvas"]:hover {
        background: rgba(255, 215, 0, 0.25);
    }

    /* Hide the desktop navbar-collapse on mobile */
    .navbar-collapse {
        display: none !important;
    }
}

/* =========================================
   4. HOME PAGE SECTIONS - Responsive grids
   ========================================= */

/* Server announcement section */
@media (min-width: 992px) {
    #server-announcement .sa-events-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* Menu items grid - Desktop optimized */
@media (min-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 14px !important;
    }
}

@media (min-width: 992px) {
    .menu-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 16px !important;
    }

    .menu-grid .menu-item {
        padding: 1.1rem !important;
    }

    .menu-grid .menu-icon {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }
}

@media (min-width: 1200px) {
    .menu-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 18px !important;
    }
}

@media (min-width: 1400px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    }
}

/* =========================================
   5. CARDS & TABLES - Desktop optimized
   ========================================= */

@media (min-width: 992px) {

    /* Cards have more padding on desktop */
    .card-body {
        padding: 1.5rem !important;
    }

    /* Tables readable width */
    .table-responsive {
        overflow-x: auto;
    }

    .table th,
    .table td {
        padding: 0.75rem 1rem;
    }
}

/* =========================================
   6. MODALS - Wider on desktop
   ========================================= */

@media (min-width: 992px) {
    .modal-dialog {
        max-width: 700px;
    }
}

@media (min-width: 1200px) {
    .modal-dialog.modal-lg {
        max-width: 900px;
    }
}

/* =========================================
   7. POSTS / NEWS SECTION - Grid layout
   ========================================= */

@media (min-width: 768px) {

    .post-card,
    .news-item {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
}

/* =========================================
   8. TOP PAGE (BXH) - Podium responsive
   ========================================= */

@media (min-width: 992px) {

    /* Podium cards - ensure proper sizing */
    .podium-pirate-king,
    .podium-yonko,
    .podium-shichibukai {
        min-height: 280px;
    }
}

/* =========================================
   9. TEXT & TYPOGRAPHY - Desktop readable
   ========================================= */

@media (min-width: 992px) {
    body {
        font-size: 1rem;
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }
}

/* =========================================
   10. FOOTER - Full width on desktop
   ========================================= */

@media (min-width: 992px) {

    footer,
    .footer {
        padding: 2rem 3rem;
    }
}

/* =========================================
   11. UTILITY - Hide/Show helpers
   ========================================= */

/* Additional responsive utility classes */
@media (max-width: 991.98px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .hide-desktop {
        display: none !important;
    }

    .show-desktop {
        display: block !important;
    }
}