h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

html.pwa-mode, html.pwa-mode body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

.e-grid .e-headercell {
    background-color: rgb(149, 170, 201); /* Override the header background color */
    color: rgb(44, 123, 229);
    font-size: 10px;
    line-height: 15px;
    font-weight: 600;
}

/* Table responsiveness: allow horizontal scroll on small screens
   while keeping dropdowns visible vertically */
.table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.table-responsive .dropdown-menu {
    position: absolute;
    z-index: 1050;
}

/* Ensure dropdown toggles in tables don't get cut off */
td .dropdown {
    position: static;
}

td .dropdown-menu {
    position: absolute;
    transform: translateY(-50%);
    top: auto !important;
    right: 0 !important;
    left: auto !important;
    min-width: 150px;
}

/* Global mobile navbar height variable and safe-area support */
:root {
    --mobile-navbar-height: 64px; /* Actual header height incl. padding */
}

/* Responsive Typography for Mobile Devices */
@media (max-width: 576px) {
    /* Remove container horizontal padding on small screens */
    .container, .container-fluid, .container-xl, .container-lg, .container-md, .container-sm {
        --bs-gutter-x: 0; /* neutralize Bootstrap horizontal gutter */
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Ensure rows don’t reintroduce horizontal overflow */
    .row {
        --bs-gutter-x: 0;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    /* Much smaller H1 headings on mobile - more appropriate sizing */
    h1, .h1, .header-title {
        font-size: 1.25rem !important; /* 20px - much more reasonable for mobile */
        line-height: 1.3;
        font-weight: 600 !important; /* Slightly bolder to maintain hierarchy */
    }

    h2, .h2 {
        font-size: 1.125rem !important; /* 18px */
        line-height: 1.3;
    }

    h3, .h3 {
        font-size: 1rem !important; /* 16px */
        line-height: 1.4;
    }

    h4, .h4 {
        font-size: 0.938rem !important; /* 15px */
    }

    h5, .h5 {
        font-size: 0.875rem !important; /* 14px */
    }

    h6, .h6, .header-pretitle {
        font-size: 0.75rem !important; /* 12px */
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    /* Adjust header spacing on mobile */
    .header {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Ensure text doesn't overflow on small screens */
    .header-title.text-truncate {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Fix table headers on mobile */
    .table th {
        font-size: 0.75rem !important; /* 12px for table headers */
        padding: 0.5rem 0.25rem !important;
        white-space: nowrap;
        letter-spacing: 0.03em;
    }

    .table td {
        font-size: 0.875rem !important; /* 14px for table data */
        padding: 0.75rem 0.25rem !important;
    }

    /* Allow long content to wrap instead of overflowing */
    .table th,
    .table td {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Prevent awkward text wrapping in tables */
    .table-responsive table {
        min-width: auto !important;
    }

    /* Card and container adjustments */
    .card-header h3,
    .card-header .h3 {
        font-size: 1rem !important;
    }

    /* Reduce overall spacing for mobile */
    .mt-4 {
        margin-top: 1rem !important;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }

    /* Base font size adjustment for better mobile readability */
    body {
        font-size: 0.875rem !important; /* 14px base instead of 16px */
    }

    /* Utility: hide optional elements/columns on mobile when applied */
    .d-none-mobile {
        display: none !important;
    }
}

/* Intermediate tablet size (576px - 768px) */
@media (min-width: 577px) and (max-width: 767px) {
    h1, .h1, .header-title {
        font-size: 1.875rem !important; /* 30px */
    }

    h2, .h2 {
        font-size: 1.5rem !important; /* 24px */
    }

    h3, .h3 {
        font-size: 1.25rem !important; /* 20px */
    }
}

/* Optional: Fluid typography using clamp() for smooth scaling */
@supports (font-size: clamp(1rem, 2vw, 3rem)) {
    @media (max-width: 768px) {
        h1, .h1, .header-title {
            font-size: clamp(1.125rem, 4vw, 2rem) !important;
        }

        h2, .h2 {
            font-size: clamp(1rem, 3.5vw, 1.5rem) !important;
        }

        h3, .h3 {
            font-size: clamp(0.938rem, 3vw, 1.25rem) !important;
        }
    }
}

/* Extra small devices (phones in portrait, less than 400px) */
@media (max-width: 400px) {
    /* Even smaller text for very small screens */
    h1, .h1, .header-title {
        font-size: 1.125rem !important; /* 18px */
    }

    h2, .h2 {
        font-size: 1rem !important; /* 16px */
    }

    /* Subscription table specific fixes */
    .table {
        font-size: 0.75rem !important; /* 12px for entire table */
    }

    .table th {
        font-size: 0.625rem !important; /* 10px for headers */
        padding: 0.375rem 0.125rem !important;
        text-transform: uppercase;
        font-weight: 600;
    }

    .table td {
        font-size: 0.813rem !important; /* 13px for data */
        padding: 0.5rem 0.125rem !important;
    }

    /* Hide less important columns on very small screens if needed */
    @media (max-width: 360px) {
        .table .d-none-mobile {
            display: none !important;
        }
    }
}

/* Specific fixes for subscription/license management tables */
.table-subscription-mobile {
    table-layout: fixed;
    width: 100%;
}

@media (max-width: 576px) {
    /* Prevent column header text from wrapping vertically */
    .table thead th {
        min-width: 60px;
        vertical-align: middle;
    }

    /* Specific column widths for subscription table */
    .table th:nth-child(1) { /* SUBSCRIPTION column */
        width: 40%;
    }

    .table th:nth-child(2) { /* STATUS column */
        width: 25%;
    }

    .table th:nth-child(3) { /* VALID UNTIL column */
        width: 35%;
    }
}
