html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.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 #e51920;
}

.validation-message {
    color: #e51920;
}

.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."
    }

/* Dropdown Button Fixes */
.dropdown-menu {
    z-index: 1050 !important;
    position: absolute !important;
}

.dropdown-item-content {
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.dropdown-item-content:hover {
    background-color: var(--bs-dropdown-link-hover-bg, #e9ecef);
    color: var(--bs-dropdown-link-hover-color, #1e2125);
}

/* Make the entire button area clickable */
.dropdown-item.border-0.bg-transparent {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    text-align: left !important;
}

.dropdown-item.border-0.bg-transparent:hover {
    background: transparent !important;
}

.dropdown-item.border-0.bg-transparent:focus {
    background: transparent !important;
    box-shadow: none !important;
}

/* Navigation Styling */
.page {
    transition: all 0.3s ease;
}

.sidebar {
    background: linear-gradient(180deg, #1a1a1a 0%, #4a4a4a 100%) !important;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    border: none !important;
}

/* Ensure seamless gradient in navigation */
.sidebar .top-row,
.sidebar .nav-scrollable,
.sidebar .nav-item,
.sidebar .nav-item a {
    border: none !important;
    background: transparent !important;
}

.sidebar .top-row {
    background: transparent !important;
}

main {
    transition: all 0.3s ease;
}

.top-row {
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 100%) !important;
    border: none !important;
    border-bottom: none !important;
    transition: all 0.3s ease;
}

.navbar-brand {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 1.5rem;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: #e0e0e0 !important;
    text-decoration: none;
    transform: scale(1.02);
}

.logo-image {
    height: 60px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    filter: brightness(1.1);
    transition: filter 0.3s ease;
}

.logo-image:hover {
    filter: brightness(1.2);
}

.logo-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Responsive logo sizing */
@media (max-width: 768px) {
    .logo-image {
        height: 48px;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 40px;
        max-width: 160px;
    }
}

.nav-link {
    color: #e0e0e0 !important;
    border-radius: 6px;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-weight: 500;
}

.nav-item .bi {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

/* Dark theme for navigation */
.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
    color: #e0e0e0 !important;
}

.navbar-dark .navbar-brand:hover,
.navbar-dark .navbar-nav .nav-link:hover {
    color: #ffffff !important;
}

/* Homepage Hero Section */
.hero-section {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2a2a2a 100%);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 179, 71, 0.1) 100%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-weight: 300;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-section .lead {
    font-weight: 300;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-section .btn {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.hero-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Modal Improvements */
.modal {
    z-index: 9999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.modal-backdrop {
    z-index: 9998 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.modal.show {
    display: block !important;
}

.modal.d-block {
    display: block !important;
}

.modal-content {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid #007bff;
    background-color: white;
    position: relative;
    z-index: 10000;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* Content Area Transitions */
.content {
    transition: all 0.3s ease;
}

/* Button Transitions */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Card Transitions */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* User Management Styles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.table-responsive .table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.badge {
    font-size: 0.75em;
    font-weight: 500;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* PDF.js Viewer Styles */
.pdfjs-viewer-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #525659;
    position: relative;
}

.pdfjs-pages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pdfjs-page-wrapper {
    position: relative;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.pdfjs-page-label {
    position: absolute;
    top: -25px;
    left: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 3px;
}

.pdfjs-page-canvas {
    display: block;
}

.pdfjs-highlight-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pdfjs-highlight-box {
    position: absolute;
    /* Solid blue highlight base color */
    background-color: rgba(33, 150, 243, 0.4);
    border: 2px solid #2196F3;
    border-radius: 3px;
    pointer-events: none;
}

.pdfjs-highlight-pulse {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
	    /* Keep the highlight consistently blue while still pulsing slightly */
	    0% {
	        background-color: rgba(33, 150, 243, 0.3);
	        border-color: #1976D2;
	    }
	    50% {
	        background-color: rgba(33, 150, 243, 0.6);
	        border-color: #0d6efd;
	    }
	    100% {
	        background-color: rgba(33, 150, 243, 0.3);
	        border-color: #1976D2;
	    }
}

.pdfjs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    font-size: 16px;
}

.pdfjs-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ff6b6b;
    font-size: 14px;
    padding: 20px;
    text-align: center;
}

.pdfjs-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.pdfjs-controls .btn {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
}

.pdfjs-controls .btn i {
    font-size: 16px;
}

.pdfjs-page-info {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    min-width: 60px;
    text-align: center;
}

.pdfjs-divider {
    width: 1px;
    height: 24px;
    background-color: #dee2e6;
    margin: 0 8px;
}

.pdfjs-viewer-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.pdfjs-container {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.pdfjs-controls {
    flex-shrink: 0;
}

/* Ensure PDF toolbar (up/down + zoom) is always visible in the
   VisualGrounding viewer by floating it over the page content. */
.visual-grounding-viewer .pdfjs-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    border-top: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

/* Visual Grounding Viewer enhancements */
.visual-grounding-viewer {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.visual-grounding-viewer .grounding-header {
    flex-shrink: 0;
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
}

.visual-grounding-viewer .pdf-viewer-container {
    flex: 1;
    min-height: 0;
    overflow: visible;
}

.visual-grounding-viewer .grounding-text {
    flex-shrink: 0;
    max-height: 150px;
    overflow-y: auto;
}
