@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
	--primary-colour: #0067b1;
	--secondary-colour: #1e90ff;
	--tertiary-colour: #ffd200;
	--body-text: #444;
	--body-text-light: #666;
}

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

.primary-background h1,
.primary-background h2,
.primary-background h3,
.primary-background h4 {
	color: white;
}

.title-banner {
	/*top: -200px;*/
	position: relative;
}
.has-overlapping-title-image {
	margin-top: -150px;
}
.title-content {
	padding: 100px 0 180px;
	max-width: 600px;
}

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

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

.invalid {
	outline: 1px solid red;
}

.validation-message {
	color: red;
}

#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: 1000;
}

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

.blazor-error-boundary {
	background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPj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4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
	padding: 1rem 1rem 1rem 3.7rem;
	color: white;
}

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

.primary-background {
	background: var(--primary-colour);
	color:white;
}
.secondary-background {
	background-color: white;
	color:black;
}

.white-background {
	background: white;
}

.footer {
	background-color: var(--sr-black);
	color: #fff;
	margin-top: 0;
	position: static;
}

.title-container {
	margin-top: 0 !important;
}

.container.title-container-banner {
	padding: 0;
}

	.container.title-container-banner > div {
		margin-top: -200px;
	}

.container {
	width: 100%;
	padding-right: var(--bs-gutter-x, .75rem);
	padding-left: var(--bs-gutter-x, .75rem);
	margin-right: auto;
	margin-left: auto;
	margin-top: 70px;
}

.app-links img {
	width: 192px;
	height: 57px;
}

.app-description-box {
	border-radius: 40px;
	padding: 50px 50px 0 50px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex: 1 1 50%;
}

.app-description-box-text {
	margin: 0 auto 5px auto;
	max-width: 520px;
	text-align: center;
	line-height: 1.23em;
	color: white;
}

.app-description-box-1 {
	background-color: mediumpurple;
}

.app-description-box-2 {
	background-color: #00A94F;
}

.app-description-box-3 {
	background-color: lightblue;
}

/*Library Overrides*/
.custom-gutter-row {
	--bs-gutter-x: 0rem !important; /* Adjust this value */
}

.file-drop-zone {
  border: 2px dashed #cbd5e0;
  padding: 1.25rem;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  background: #f9fafb;
  transition: border-color .12s ease, background .12s ease;
}
.file-drop-zone:focus { outline: none; box-shadow: 0 0 0 3px rgba(66,153,225,.25); }
.file-drop-zone.file-drop--over { border-color: #3182ce; background: #ebf8ff; }
.file-drop-inner p { margin: 0; font-weight: 600; }
.file-drop-inner small { color: #6b7280; display:block; margin-top: .35rem; }

/* Global overlay style for full-viewport drop target */
.file-drop-zone.file-drop--global {
  display: none; /* shown on dragenter */
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  z-index: 10000;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 2rem;
  pointer-events: none; /* default off; JS enables when displaying */
}

/* Ensure pointer events allowed when visible (JS toggles) */
.file-drop-zone.file-drop--global.file-drop--over {
  pointer-events: auto;
}

/* Inner box that appears in the center when using global overlay */
.file-drop-zone.file-drop--global .file-drop-inner {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem 2rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  max-width: 720px;
  width: 90%;
  text-align: center;
}

/* Keep the existing look when used as inline drop zone */
.file-drop-zone {
  border: 2px dashed #cbd5e0;
  padding: 1.25rem;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  background: #f9fafb;
  transition: border-color .12s ease, background .12s ease;
}

/* Hover/drag-over states */
.file-drop-zone.file-drop--over { border-color: #3182ce; background: #ebf8ff; }
/* --- appended for dashboard charts --- */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 220px; /* line chart */
  height: 220px;
}

.chart-container.small {
  min-height: 180px; /* pie chart */
  height: 180px;
}

.chart-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Make mermaid diagrams inside modals more readable */
.modal .modal-body .mermaid,
.modal .modal-body .mermaid svg,
.modal .modal-body .mermaid text {
  font-size: 15rem; /* adjust as needed (1rem = 16px) */
  line-height: 1.4;
}

/* Ensure the SVG uses available width and can wrap/scroll inside modal */
.modal .modal-body .mermaid svg {
  width: 100% !important;
  height: auto !important;
  max-height: 70vh;
}

/* If the diagram still looks small, increase this scale value */
.modal .modal-body .mermaid svg {
  /* optional: scale up the whole diagram (uncomment to use) */
  /* transform: scale(1.1); transform-origin: center top; */
}

/* wider info modal */
.modal-dialog.modal-wide {
  max-width: 1200px;
  margin: 1.75rem auto;
}

/* responsive fallback for smaller screens */
@media (max-width: 1400px) {
  .modal-dialog.modal-wide {
    max-width: 95%;
    margin: 1rem;
  }
}

/* keep modal content scrollable when content is tall */
.modal-dialog.modal-wide .modal-body {
  max-height: 75vh;
  overflow: auto;
}

/* Dark theme overrides for components that use Bootstrap classes */
html.dark-theme {
  --primary-colour: #1b6ec2;
  --secondary-colour: #4ea8ff;
  --tertiary-colour: #f6c857;
  --body-text: #e6eefc;
  --body-text-light: #bfcfe6;
  --body-bg: #0f1724;
  --card-bg: #0b1220;
  --muted-bg: #071025;
}

/* Apply variables when dark theme active via class or data attribute */
[data-theme="dark"], html.dark-theme {
  --primary-colour: #1b6ec2;
  --secondary-colour: #4ea8ff;
  --tertiary-colour: #f6c857;
  --body-text: #e6eefc;
  --body-text-light: #bfcfe6;
  --body-bg: #0f1724;
  --card-bg: #0b1220;
  --muted-bg: #071025;
}

/* Ensure page background and primary text follow variables */
[data-theme="dark"] body,
[data-theme="dark"] .page,
[data-theme="dark"] .content,
html.dark-theme body,
html.dark-theme .page,
html.dark-theme .content {
  background-color: var(--body-bg) !important;
  color: var(--body-text) !important;
}

/* Sidebar */
[data-theme="dark"] .sidebar,
html.dark-theme .sidebar {
  background-color: #071025 !important;
  color: var(--body-text) !important;
}

/* Top-row / headers */
[data-theme="dark"] .top-row,
html.dark-theme .top-row {
  background-color: transparent !important;
  color: var(--body-text) !important;
}

/* Links and nav */
[data-theme="dark"] a,
[data-theme="dark"] .nav-link,
[data-theme="dark"] .btn-link,
[data-theme="dark"] .navbar-nav .nav-link,
html.dark-theme a,
html.dark-theme .nav-link,
html.dark-theme .btn-link,
html.dark-theme .navbar-nav .nav-link {
  color: white !important;
}

/* Buttons */
[data-theme="dark"] .btn-primary,
html.dark-theme .btn-primary {
  background-color: var(--primary-colour) !important;
  border-color: #1461a8 !important;
  color: #fff !important;
}

[data-theme="dark"] .btn-outline-secondary,
html.dark-theme .btn-outline-secondary {
  color: var(--body-text) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

/* Forms */
[data-theme="dark"] .form-control,
[data-theme="dark"] input.form-control,
[data-theme="dark"] select.form-select,
[data-theme="dark"] textarea.form-control,
html.dark-theme .form-control,
html.dark-theme input.form-control,
html.dark-theme select.form-select,
html.dark-theme textarea.form-control {
  background-color: #0b1220 !important;
  color: var(--body-text) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

/* Cards and modals */
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .login-panel,
html.dark-theme .card,
html.dark-theme .modal-content,
html.dark-theme .login-panel {
  background-color: var(--card-bg) !important;
  color: var(--body-text) !important;
}

/* File drop */
[data-theme="dark"] .file-drop-zone,
html.dark-theme .file-drop-zone {
  background: var(--muted-bg) !important;
  border-color: rgba(255,255,255,0.06) !important;
  color: var(--body-text) !important;
}

/* Small helpers */
[data-theme="dark"] .text-dark { color: white !important; }
[data-theme="dark"] .text-muted { color: white !important; }
html.dark-theme .text-dark { color: white !important; }
html.dark-theme .text-muted { color: white !important; }

/* Smooth transition for theme switching */
html, body, .content, .card, .modal-content {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

/* Broad overrides to ensure dark theme applies across Bootstrap elements */
html.dark-theme .navbar,
html.dark-theme .navbar-nav,
html.dark-theme .nav,
html.dark-theme .nav-link,
html.dark-theme .dropdown-menu,
html.dark-theme .table,
html.dark-theme .table-striped,
html.dark-theme .container,
html.dark-theme .page,
html.dark-theme .content,
html.dark-theme .card,
html.dark-theme .card-body,
html.dark-theme .modal,
html.dark-theme .modal-content,
html.dark-theme .modal-body,
html.dark-theme .form-control,
html.dark-theme .list-group-item {
  background-color: var(--card-bg) !important;
  color: var(--body-text) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* Ensure table rows and borders are visible */
html.dark-theme .table thead th,
html.dark-theme .table tbody td,
html.dark-theme .table-striped tbody tr:nth-of-type(odd) {
  background-color: transparent !important;
  color: var(--body-text) !important;
}

/* Ensure links in dark mode are readable */
html.dark-theme a,
html.dark-theme .btn-link,
html.dark-theme .nav-link {
  color: white !important;
}

/* Make sure badges contrast */
html.dark-theme .badge {
  background-color: rgba(255,255,255,0.08) !important;
  color: var(--body-text) !important;
}

/* Header stacking: keep header on top and let page content scroll behind it */
.top-row {
  position: sticky;
  top: 0;
  z-index: 3000 !important; /* high so header beats content */
  background-color: var(--card-bg, #ffffff); /* ensure opaque background */
  backdrop-filter: blur(6px); /* subtle glass effect when desired */
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Force main content elements into a lower stacking context so they sit behind header */
.page,
.content,
.sidebar,
.card,
.modal-content,
.chart-container,
.chart-canvas,
canvas {
  z-index: 0 !important;
  position: relative !important;
}

/* In case some ancestor sets transform/creates stacking context, neutralize it where safe.
   NOTE: removing transforms can affect layout/animations — only use if it does not break things. */
.page,
.sidebar,
.content {
  transform: none !important;
  will-change: auto !important;
}

/* Dark-mode table and white-background overrides (append near end of file) */

/* Ensure Bootstrap tables and any .bg-white elements darken in dark theme */
html.dark-theme .table,
html.dark-theme .table thead th,
html.dark-theme .table tbody td,
html.dark-theme .table-striped tbody tr:nth-of-type(odd),
html.dark-theme .table-responsive,
html.dark-theme .table th,
html.dark-theme .table td,
html.dark-theme .table thead,
html.dark-theme .table tbody,
[data-theme="dark"] .table,
[data-theme="dark"] .table thead th,
[data-theme="dark"] .table tbody td,
[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
[data-theme="dark"] .table-responsive,
[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
  background-color: var(--card-bg) !important;
  color: var(--body-text) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* Neutralize any explicit white backgrounds used by pages */
html.dark-theme .bg-white,
html.dark-theme .white-background,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .white-background {
  background-color: var(--card-bg) !important;
  color: var(--body-text) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* Many Identity/management pages use .card or .box wrappers — ensure they follow dark bg */
html.dark-theme .card,
html.dark-theme .card-body,
html.dark-theme .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .panel {
  background-color: var(--card-bg) !important;
  color: var(--body-text) !important;
}

/* If some controls still show white due to very specific selectors, increase specificity */
html.dark-theme body .container .card,
html.dark-theme body .container .table,
[data-theme="dark"] body .container .card,
[data-theme="dark"] body .container .table {
  background-color: var(--card-bg) !important;
  color: var(--body-text) !important;
}

/* Make table text and badges readable */
html.dark-theme .table th,
html.dark-theme .table td,
[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
  color: var(--body-text) !important;
}

/* If any inline style produced white canvas, force canvas background */
html.dark-theme canvas,
[data-theme="dark"] canvas {
  background-color: transparent !important;
}

/* Quick helper: reduce high z-index panels that accidentally cover the header */
html.dark-theme .card,
html.dark-theme .table,
[data-theme="dark"] .card,
[data-theme="dark"] .table {
  z-index: 0 !important;
}

/* Keep the video hidden (or low-opacity) until it can play to avoid flicker */
.home-banner-hidden {
  opacity: 0;
  transition: opacity 300ms ease-in;
}

.home-banner-hidden.canplay {
  opacity: 1;
}