/* Responsive styles for PGDD */

/* Common breakpoints:
   - Small devices (phones, 600px and down): @media only screen and (max-width: 600px)
   - Medium devices (tablets, 768px and down): @media only screen and (max-width: 768px)
   - Large devices (desktops, 992px and down): @media only screen and (max-width: 992px)
   - Extra large devices (large desktops, 1200px and down): @media only screen and (max-width: 1200px)
*/

/* ==========================================================================
   Responsive Layout for PGDD
   ========================================================================== */

/* Global media responsiveness */
.main-content img,
.main-content video,
.main-content canvas,
.main-content svg,
.main-content iframe {
    max-width: 100%;
    height: auto;
}

/* Make long code blocks and tables scroll horizontally on small screens */
.main-content pre,
.main-content code,
.main-content .table,
.main-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
}

/* Navbar alignment and spacing */
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-nav.ms-auto {
    align-items: center;
    gap: 0.5rem;
}

/* Hide hamburger by default (shown in media queries) */
.navbar-toggler {
    display: none;
}

/* --------------------------------------------------------------------------
   Medium devices and down (Tablets, Phones)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    /* Sidebar off-canvas behavior */
    .side-panel {
        left: -250px; /* Hide sidebar by default */
        transition: left 0.3s ease-in-out;
        z-index: 1050; /* Ensure it's above the main content but below modals */
    }

    .main-content {
        margin-left: 0;
        padding-left: 15px;
        padding-right: 15px;
    }

    .side-panel.active {
        left: 0; /* Show sidebar when active */
        box-shadow: 0 0 15px rgba(0,0,0,0.3);
    }

    .navbar-toggler {
        display: inline-flex !important; /* Show the hamburger menu button */
        border: none;
        background: transparent;
        align-items: center;
        justify-content: center;
        padding: 0.25rem 0.5rem;
        font-size: 1.25rem;
    }

    .navbar-nav.ms-auto {
        gap: 0.25rem; /* tighter spacing on mobile */
    }

    .navbar .nav-link {
        padding: 0.25rem 0.5rem;
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }

    /* Overlay for when the sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none; /* Hidden by default */
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* --------------------------------------------------------------------------
   Small devices (Phones)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Container padding tightening */
    .navbar .container {
        max-width: 100%;
    }

    .main-content .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h1, .h1 {
        font-size: 1.75rem;
    }

    h2, .h2 {
        font-size: 1.5rem;
    }

    .auth-modal .modal-dialog {
        max-width: 90%;
        margin: 1.75rem auto;
    }
}

