html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    touch-action: manipulation;
}

/* Ensure all interactive elements remain clickable during scroll */
button, a, input, textarea, select, [role="button"], .btn, .form-control {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

/* Prevent scroll blocking on all containers */
* {
    -webkit-tap-highlight-color: transparent;
}

*:focus {
    outline-offset: 2px;
}

a, .btn-link {
    color: #006bb7;
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

a:active, .btn-link:active {
    opacity: 0.7;
}

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

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTI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jExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.page-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

/* Data Table */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    overscroll-behavior: contain;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.table {
    margin-bottom: 0;
    position: relative;
}

.table tbody tr {
    position: relative;
}

.table td, .table th {
    position: relative;
    z-index: 1;
}

.table .btn, .table a, .table button {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    touch-action: manipulation;
}

.table .btn:hover, .table a:hover, .table button:hover {
    z-index: 3;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
}

.data-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    position: relative;
    z-index: 2;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    position: relative;
    z-index: 1;
}

.data-table tbody tr {
    position: relative;
    cursor: default;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
    position: relative;
    z-index: 2;
}

.data-table tbody tr td {
    vertical-align: middle;
}

.data-table .btn-sm {
    min-width: 60px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background-color: #1b6ec2;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #155a9c;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    margin-left: 0.5rem;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1b6ec2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    overflow-y: auto;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1051;
    margin: 1.75rem auto;
}

/* Bootstrap modal overrides for better interaction */
.modal.show {
    pointer-events: auto;
}

.modal-content {
    position: relative;
    z-index: 1051;
    pointer-events: auto;
}

.modal-body {
    position: relative;
    overflow-y: auto;
    max-height: 70vh;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-body * {
    pointer-events: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-btn:hover {
    color: #495057;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Container */
.form-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    position: relative;
}

.card {
    position: relative;
    z-index: 1;
}

.card-body {
    position: relative;
    z-index: 1;
}

.card .btn, .card button, .card a, .card input, .card textarea, .card select {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    touch-action: manipulation;
}

.card .btn:hover, .card button:hover, .card a:hover {
    z-index: 3;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.form-control:focus {
    border-color: #1b6ec2;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(27, 110, 194, 0.25);
    z-index: 3;
}

.form-control:focus {
    border-color: #1b6ec2;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(27, 110, 194, 0.25);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
}

.validation-summary {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.text-danger {
    color: #dc3545;
}
