html, body, * {
    font-family: 'Poppins', sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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;
}

.content {
    padding-top: 1.1rem;
}




#loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed; /* Ensure it's centered on the viewport */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Perfect centering */
    z-index: 999; /* Place it above other elements */
}

    #loader img {
        width: 150px;
        height: auto;
        border-radius: 15px;
        animation: bounce 1.5s infinite ease-in-out;
        /* Removed box shadow */
    }

.dots {
    margin-top: 20px;
    display: flex;
    gap: 8px;
}

    .dots span {
        width: 10px;
        height: 10px;
        background-color: #1b6ec2;
        border-radius: 50%;
        animation: dot-pulse 1.5s infinite ease-in-out;
    }

        .dots span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .dots span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes dot-pulse {
    0%, 100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Main content (hidden initially) */
#main-content {
    display: none;
}

body.loaded #main-content {
    display: block;
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border: 1px solid #f5c6cb;
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%; /* Full width */
    z-index: 1000;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    text-align: center; /* Center text inside */
}



/* Centering the error icon */
.error-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center; /* Center horizontally */
}

/* Centering the error message */
.error-message {
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center; /* Align vertically */
}


/* Centering the error message */
.error-message {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Centering the error action buttons */
.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}


.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."
    }

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 999;
}

.loading-spinner {
    border: 8px solid #e0e0e0;
    border-top: 8px solid #1b6ec2;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    font-size: 1.5rem;
    color: #1b6ec2;
    font-weight: bold;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#error-ui {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border: 1px solid #f5c6cb;
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.error-message {
    text-align: center;
    margin-bottom: 1rem;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

    .error-actions a {
        color: #1b6ec2;
        text-decoration: underline;
        cursor: pointer;
    }

code {
    color: #c02d76;
}


/* Mobile Responsiveness - Tablets and below */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px; /* Slightly smaller on mobile */
        z-index: 1045; /* Higher z-index for mobile */
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-wrapper {
        margin-left: 0;
    }

    .content-card {
        padding: 1rem;
    }

    .nav-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }

        .nav-link i {
            width: 20px;
            height: 20px;
            font-size: 1rem;
        }

    .nav-item {
        margin: 0.25rem 1rem;
    }

    .sidebar-header {
        padding: 0 1.25rem 1.5rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 576px) {
    .sidebar {
        width: 100%; /* Full width on small screens */
        transform: translateX(-100%);
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .content-card {
        padding: 0.75rem;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        gap: 1rem;
    }

        .nav-link i {
            width: 18px;
            height: 18px;
            font-size: 0.9rem;
        }

    .nav-item {
        margin: 0.25rem 0.75rem;
    }

    .sidebar-header {
        padding: 0 1rem 1.25rem;
    }

        .sidebar-header h6 {
            font-size: 0.7rem;
        }

    /* Access denied cards on mobile */
    .col-md-6.col-lg-5 {
        padding: 0 1rem;
    }

    .card-body.py-5 {
        padding: 2rem 1.5rem !important;
    }

    .fs-1 {
        font-size: 3rem !important;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .d-md-flex {
        flex-direction: column;
    }

        .d-md-flex .btn {
            margin-bottom: 0.5rem;
        }
}

/* Extra small devices */
@media (max-width: 480px) {
    : root {
        --topbar-height: 60px; /* Smaller topbar on very small screens */
    }

    .nav-link span {
        max-width: calc(100% - 30px);
    }

    .content-card {
        padding: 0.5rem;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 250px; /* Narrower sidebar in landscape */
    }

    .nav-link {
        padding: 0.625rem 1rem;
    }

        .nav-link span {
            font-size: 0.8rem;
        }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .nav-link i {
        transform: translateZ(0); /* Better rendering on high DPI */
    }
}

/* Focus improvements for accessibility */
@media (prefers-reduced-motion: no-preference) {
    .nav-link:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}