/* Shared responsive rules loaded after the application's page styles. */
html {
    overflow-x: hidden;
}

body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.app-layout > .w-100 {
    flex: 1 0 auto;
    min-height: 0;
}

.app-layout > footer {
    position: static;
    flex: 0 0 auto;
    clear: both;
}

.app-shell,
.main-container,
.content-wrapper,
main,
main > div {
    min-width: 0;
    max-width: 100%;
}

.app-shell-public {
    min-height: 100vh;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

.form-control,
.form-select,
.input-group,
.select2-container,
.select2-container--bootstrap,
.select2-container--krajee-bs5 {
    max-width: 100%;
}

textarea.form-control {
    resize: vertical;
}

.table-responsive,
.grid-view,
.kv-grid-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.grid-view table,
.kv-grid-table {
    margin-bottom: 0;
}

.pagination {
    flex-wrap: wrap;
    gap: .25rem;
}

.modal-dialog {
    max-width: calc(100vw - 2rem);
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 1201px) {
    .app-layout-public .logo-text,
    .app-layout-sidebar .logo-text {
        font-size: 2.25rem;
    }

    .app-layout-public .tagline,
    .app-layout-sidebar .tagline {
        text-align: center;
    }
}

@media (max-width: 1200px) {
    .app-layout-public .navbar-content {
        gap: .75rem;
        padding: .5rem 1rem;
        margin: 0;
    }

    .app-layout-public .logo-section {
        min-width: 0;
        gap: 1rem;
        margin-left: 0;
    }

    .app-layout-public .logo-image {
        height: clamp(64px, 8vw, 88px);
    }

    .app-layout-public .logo-text {
        font-size: clamp(1.25rem, 2.7vw, 1.7rem);
        line-height: 1.2;
        text-shadow: none;
    }
}

@media (max-width: 992px) {
    .navbar-content,
    .logo-section {
        flex-direction: row;
        text-align: left;
    }

    .navbar-content {
        gap: .75rem;
        padding: .5rem 1rem;
        margin: 0;
    }

    .logo-section {
        min-width: 0;
        gap: .75rem;
        margin: 0;
    }

    .logo-image {
        width: auto;
        height: 72px;
        flex: 0 0 auto;
    }

    .logo-text-container {
        min-width: 0;
    }

    .logo-text {
        font-size: clamp(1rem, 3.4vw, 1.5rem);
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .tagline {
        font-size: .85rem;
    }

    .flag-container {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .navbar {
        min-height: 92px;
        padding: .35rem 0 0;
        border-bottom-width: 10px;
        overflow: visible;
    }

    .app-layout-sidebar .navbar-content {
        padding-left: 4.75rem;
    }

    .logo-image {
        height: 58px;
        padding: .25rem;
    }

    .logo-text {
        font-size: clamp(.88rem, 4vw, 1.15rem);
        text-shadow: none;
    }

    .tagline {
        font-size: .72rem;
    }

    .flag-container,
    .flag-line {
        display: none;
    }

    .main-container {
        display: block;
        min-height: 0;
    }

    .content-wrapper {
        width: 100%;
        padding: .75rem;
        overflow: visible;
    }

    .ndu-mobile-toggle {
        top: 16px !important;
        left: 14px !important;
        width: 44px;
        height: 44px;
        padding: 0 !important;
    }

    .ndu-sidebar {
        width: min(86vw, 300px) !important;
        max-width: 100%;
        height: 100dvh !important;
    }

    .ndu-sidebar.ndu-collapsed {
        width: min(86vw, 300px) !important;
    }

    .ndu-sidebar-nav {
        max-height: calc(100dvh - 84px);
        overscroll-behavior: contain;
    }

    body:has(.ndu-sidebar:not(.ndu-collapsed)) {
        overflow: hidden;
    }

    .container,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-xxl {
        max-width: 100%;
        padding-right: .75rem;
        padding-left: .75rem;
    }

    .hero-section,
    .professional-hero,
    .form-card,
    .card-body,
    .application-guide,
    .instruction-card {
        padding: 1rem;
    }

    h1,
    .h1 {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    h2,
    .h2 {
        font-size: clamp(1.25rem, 6vw, 1.65rem);
    }

    .button-group,
    .form-actions,
    .action-buttons {
        width: 100%;
    }

    .button-group > .btn,
    .form-actions > .btn,
    .action-buttons > .btn,
    .button-group > a,
    .form-actions > a {
        width: 100%;
        min-height: 44px;
        white-space: normal;
    }

    .table th,
    .table td {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .grid-view .table th,
    .grid-view .table td {
        min-width: 8rem;
    }

    .grid-view .table th:last-child,
    .grid-view .table td:last-child {
        min-width: 5rem;
    }

    footer {
        font-size: .8rem;
    }
}

@media (max-width: 480px) {
    .app-layout-sidebar .navbar-content {
        padding-left: 4.25rem;
    }

    .navbar-content {
        padding-right: .5rem;
    }

    .logo-section {
        gap: .4rem;
    }

    .logo-image {
        height: 50px;
    }

    .tagline {
        display: none;
    }

    .content-wrapper {
        padding: .5rem;
    }

    .row {
        --bs-gutter-x: 1rem;
    }

    .form-row,
    .form-row-triple,
    .form-options {
        flex-direction: column;
    }

    .form-options {
        align-items: flex-start;
        gap: .75rem;
    }

    .alert,
    .card,
    .form-card,
    .login-card,
    .professional-hero {
        border-radius: 8px;
    }
}
