html {
    font-size: 14px;
    overflow-x: hidden;
}

body {
    font-size: inherit;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ensure page container doesn't cause double scrollbars */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* Remove focus outline from h1 elements - Blazor adds focus for navigation */
h1:focus,
h1:focus-visible,
[tabindex]:focus,
[tabindex]:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Focus styles for interactive elements only */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Remove all default borders and outlines */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Table styling */
.ttable {
    border: solid 1px gray;
}

/* Color utilities */
.checked {
    color: greenyellow;
}

.red-color {
    color: red;
}

.yellow-color {
    color: yellow;
}

.purple-color {
    color: purple;
}

/* ============ Desktop submenu view ============ */
@media all and (min-width: 992px) {
    .dropdown-menu li {
        position: relative;
    }

    .nav-item .submenu {
        display: none;
        position: absolute;
        left: 100%;
        top: 0;
        min-width: 180px;
        z-index: 1000;
    }

    .nav-item .submenu-left {
        right: 100%;
        left: auto;
    }

    .dropdown-menu > li:hover {
        background-color: #f1f1f1;
    }

    .dropdown-menu > li:hover > .submenu {
        display: block;
    }
}

/* ============ Mobile/Tablet devices ============ */
@media (max-width: 991.98px) {
    .dropdown-menu .dropdown-menu {
        margin-left: 0.7rem;
        margin-right: 0.7rem;
        margin-bottom: 0.5rem;
    }
    
    /* Better touch targets */
    .nav-link,
    .dropdown-item {
        padding: 0.625rem 1rem;
    }
}

/* Scrollable dropdown menus for long lists */
.dropdown-menu-scrollable {
    max-height: 60vh;
    overflow-y: auto;
}

@media (max-width: 991.98px) {
    .dropdown-menu-scrollable {
        max-height: 40vh;
    }
}

/* Smooth scrolling for browsers that support it */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Text truncation utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
