/* Default container styling */

/* --- Layout stability (prevents page shake on modal/offcanvas/scrollbar) --- */
html {
    scrollbar-gutter: stable;
}

body {
    overflow-x: clip;
}

/* ScrollBarHelper padding doubles up when scrollbar-gutter already reserves space */
body.modal-open,
body:has(.modal.show),
body:has(.offcanvas.show) {
    padding-right: 0 !important;
}

.modal-backdrop,
.offcanvas-backdrop {
    width: 100% !important;
}

.custom-nav-link {
    color: #747579 !important; /* Corrected usage of !important */
    padding: 4px 16px;
    font-weight: 500;
    line-height: 30px;
    font-size: 15px !important; /* Corrected usage of !important */
    font-family: 'Roboto', sans-serif;

}
.custom-container  {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin: 0 auto; /* Center the container by default */
}

/* For screen sizes 1024px and above */
@media (min-width: 1024px) and (max-width: 1439px) {
    .custom-container  {
        max-width: 1024px;  /* Set a max-width for 1024px screens */
        margin: 0 auto;     /* Center the content */
    }
}

/* For larger screens (1440px) */
@media (min-width: 1440px) {
    .custom-container  {
        max-width: 1440px;  /* Set a max-width for 1440px screens */
        margin: 0 auto;     /* Center the content */
    }
}

/* Ensure elements within container align centrally */
.custom-navbar-collapse {
    display: flex;
    justify-content: center; /* Center the navbar items */
}

.custom-navbar-nav {
    display: flex;
    align-items: center;
    justify-content: center;  /* Center the nav items horizontally */
    gap: 15px;
    padding: 0;
}
.custom-navbar-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
}

.custom-nav-item {
    list-style: none;
}

.custom-nav-link:hover {
    color: #007bff;
}

.custom-navbar-collapse {
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

@media (min-width: 769px) {
    .custom-navbar-collapse {
        display: flex !important;
    }

    .navbar-toggler {
        display: none;
    }
}

@media (max-width: 768px) {
    .custom-container {
        position: relative;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.25rem;
    }

    .navbar-brand {
        flex: 0 1 auto;
        min-width: 0;
        margin-right: 0.25rem;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

    .navbar-brand img {
        height: 50px !important;
        max-height: 50px;
        width: auto;
    }

    .header-toolbar {
        flex: 1 1 auto;
        min-width: 0;
        margin-left: auto;
        gap: 0.25rem;
        justify-content: flex-end;
    }

    .header-toolbar-actions {
        gap: 0.35rem;
    }

    .custom-nav-search {
        flex: 1 1 auto;
        min-width: 0;
        margin-right: 0.25rem !important;
        margin-left: 0 !important;
    }

    .custom-nav-search .custom-nav-link {
        font-size: 11px !important;
        line-height: 1.2;
        padding: 0 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .custom-navbar-collapse.collapse:not(.show) {
        display: none !important;
    }

    .custom-navbar-collapse.collapse.show {
        display: flex !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background-color: rgba(253, 249, 249, 0.94);
        z-index: 550;
        padding: 10px;
        transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        border-radius: 4px;
        min-width: 150px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .custom-navbar-nav {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
    }

    .custom-nav-link {
        padding: 15px;
        width: 100%;
        text-align: center;
    }

    .align-items-end-custom .btn {
        width: auto !important;
        white-space: nowrap;
    }
}

.navbar-toggler.collapsed span:nth-child(4) {
    transform: translateY(10px) rotate(45deg);
}

.navbar-toggler.collapsed span:nth-child(5) {
    transform: scaleX(0.7);
}

.navbar-toggler.collapsed span:nth-child(6  ) {
    transform: translateY(-10px) rotate(-45deg);
}

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

@media (max-width: 768px) {
    .custom-nav-link {
        text-align: center;
        width: auto;
    }
}

@media (min-width: 375px) and (max-width: 768px) {
    .custom-nav-search .custom-nav-link {
        font-size: 12px !important;
    }
}

.custom-toggler {
    position: static;
    transform: none;
    z-index: 1060;
    flex-shrink: 0;
}

.navbar-toggler span {
    display: block;
}

/* Hover effect for links */
.custom-nav-link:hover {
    color: #007bff; /* Example hover color */
}

/* Specific style for the "Licence used" text */
.custom-nav-search a {
    color: #ff4500 !important; /* Update color from red (#e01313) to orange-red */
    font-size: 16px; /* Ensure same font size as other links */
    font-weight: bold; /* Optional: make it bold */
}
.custom-navbar-collapse {
    display: flex;
    justify-content: center; /* Horizontal alignment */
    align-items: center;    /* Vertical alignment */
    text-align: center;     /* Ensure text is centered */
}

/* For screen sizes 1024px */
@media (min-width: 1024px) and (max-width: 1439px) {
    .custom-navbar-collapse {
        max-width: 1024px;
        margin: 0 auto; /* Center horizontally within the page */
    }
}

/* For larger screens (1440px) */
@media (min-width: 1440px) {
    .custom-navbar-collapse {
        max-width: 1440px;
        margin: 0 auto; /* Center horizontally */
    }
}

/* Center alignment for navbar items */
.custom-navbar-nav {
    display: flex;
    justify-content: center; /* Horizontal alignment */
    align-items: center;    /* Vertical alignment */
    gap: 20px;              /* Space between items */
    padding: 0;
    margin: 0;
    list-style: none;       /* Remove default list styles */
}

/* Style individual links */
.custom-nav-link {
    text-decoration: none;
    color: #000; /* Default color */
    padding: 10px 15px;
}

/* Responsive alignment for smaller screens */
@media (max-width: 768px) {
    .custom-navbar-collapse {
        flex-direction: column;
    }

    .custom-navbar-nav {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .custom-nav-link {
        text-align: center;
        width: 100%;
    }
}

/* Tablet alignment */
@media (min-width: 769px) and (max-width: 1199.98px) {
    .header-toolbar {
        gap: 0.75rem;
        flex-shrink: 0;
        align-items: center;
    }

    .header-toolbar-actions {
        gap: 0.5rem;
        align-items: center;
    }
}
