/* Responsive overrides and helpers (minimal, non-breaking) */

/* Treat custom container-fluidw like Bootstrap's container-fluid */
.container-fluidw {
    width: 100%;
    padding-right: var(--bs-gutter-x, .75rem);
    padding-left: var(--bs-gutter-x, .75rem);
    margin-right: auto;
    margin-left: auto;
}

/* Media elements scale down within containers */
img,
video {
    max-width: 100%;
    height: auto;
}

canvas {
    max-width: 100%;
    height: auto;
}

/* Ensure horizontal scroll for wide tables on small screens */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Prevent accidental horizontal scroll in main content */
.az-content {
    overflow-x: hidden;
}

/* Guard against stray page-level horizontal overflow */
body {
    overflow-x: hidden;
}

/* Navbar adjustments */
.navbar-collapse {
    width: 100%;
}

/* Desktop top nav: stay readable when browser zoom increases (effective width shrinks) */
@media (min-width: 992px) {
    nav.navbar .navbar-collapse {
        flex-grow: 1;
        min-width: 0;
    }

    nav.navbar .main-navbar-inner {
        min-width: 0;
    }

    nav.navbar .az-header-menu {
        min-width: 0;
    }

    /* Scroll instead of wrapping link labels onto multiple lines */
    nav.navbar .az-header-menu .main-navbar-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    nav.navbar .az-header-menu .main-navbar-nav::-webkit-scrollbar {
        height: 5px;
    }

    nav.navbar .az-header-menu .main-navbar-nav::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.18);
        border-radius: 4px;
    }

    nav.navbar .az-header-menu .nav-item {
        flex-shrink: 0;
    }

    nav.navbar .az-header-menu .nav-link {
        white-space: nowrap;
        font-size: clamp(0.8rem, 0.55rem + 0.5vw, 0.9rem);
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }

    nav.navbar .az-header-menu .nav-link img {
        flex-shrink: 0;
    }

    /* Long display names don’t push the bar */
    nav.navbar .main-navbar-user-name {
        max-width: min(9.5rem, 18vw);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: clamp(0.85rem, 0.7rem + 0.4vw, 1rem) !important;
        line-height: 1.2;
        font-weight: 600;
    }

    nav.navbar .main-navbar-profile .addedDDStlye {
        max-width: 100%;
    }
}

.navbar-brand img {
    max-width: 150px;
    height: auto;
}

@media (max-width: 575.98px) {
    .navbar-brand img {
        max-width: 120px;
    }
}

/* Footer should not overlay content on small devices */
@media (max-width: 991.98px) {
    .az-footer {
        position: static !important;
    }
}

/* Modal max-width for small devices */
@media (max-width: 575.98px) {
    .modal-dialog {
        width: auto !important;      /* override inline width: 750px */
        max-width: 95% !important;
        margin: 0.5rem auto;
    }
}

/* Compact spacing for form groups on small screens */
@media (max-width: 575.98px) {
    .form-group {
        margin-bottom: 0.75rem;
    }
}

/* Tighter nav link padding on phones */
@media (max-width: 575.98px) {
    .navbar .nav-link {
        padding: .5rem .75rem;
    }
}

/* Ellipsis for tight name/file columns used across lists */
.excess-text-container {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* Let modal content shrink within capped dialog on small screens */
@media (max-width: 575.98px) {
    .modal-content {
        width: auto !important;
    }
}

/* PDF container should not overflow horizontally */
#pdfContainer {
    width: 100% !important;
    overflow: hidden;
}

/* Inputs should not force flex overflow */
.form-control,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
select,
textarea {
    min-width: 0;
}

/* Limit dropdown width on mobile */
@media (max-width: 575.98px) {
    .dropdown-menu {
        max-width: 95vw;
        overflow-x: auto;
    }
}

/* Override fixed custom-file widths used in views */
@media (max-width: 575.98px) {
    .custom-file {
        width: 100% !important;
        margin-top: 0.5rem !important;
    }
}

/* Tables wrap content on small screens */
@media (max-width: 575.98px) {
    .table th,
    .table td {
        white-space: normal;
        word-break: break-word;
    }
}


