:root {
    --sidebar-width: 250px;
    --header-height: 60px;
    --primary-color: #1b6ec2;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --border-color: #dee2e6;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: #fff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: calc(100vh - 24px);
    margin-top: 12px;
    margin-left: 12px;
    z-index: 100;
    /* border: solid 1px; */
    border-radius: 25px;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    position: sticky !important;
    top: 12px;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    margin: 0 1.5rem;
    font-weight: bold;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.nav-menu {
    padding: 1rem 0;
}

.nav-item {
    padding: 12px;
    margin: 0 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    display: block;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #d9e7fa59;
    text-decoration: none;
    color: var(--text-color);
}

.nav-item.active {
    background-color: #e7f1ff;
    color: var(--primary-color);
    font-weight: 500;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    justify-content: flex-end;
}

.content {
    padding: 2rem;
}

/* Modal Backdrop Fix */
.modal-backdrop {
    z-index: 1040 !important;
}
.modal {
    z-index: 1050 !important;
}

/* Loading Indicator Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Ensure it's above everything else */
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.dropdown-header {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    min-height: calc(1.5em + 0.75rem + 2px); /* Match form-control height */
}

.dropdown-header.multi-select {
    flex-wrap: wrap;
    gap: 0.25rem;
}

.dropdown-header .placeholder {
    color: #6c757d;
    background: transparent;
    cursor: auto;
}

.dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    transition: transform 0.2s;
}

.dropdown-arrow.down {
    border-top: 0px solid #343a40;
}

.dropdown-arrow.up {
    border-bottom: 2px solid #343a40;
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: #fff;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.selected {
    background-color: #e9ecef;
    font-weight: 500;
}

.dropdown-item input[type="checkbox"] {
    margin-right: 0.5rem;
}


/* Blazor error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--primary-color);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}
