/* --------- Variables --------- */
:root {
	--lightgrey: #9fb0b9;
	--darkgrey: #455A64;
	--stmblue: #2F2A4A;
	--gold: #FFD700;
	--border-color: #dee2e6;
	--box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	--box-shadow-hover: 0 4px 8px rgba(0,0,0,0.2);
	--FatalErrorBorder: #cc3300;
	--FatalErrorBackground: #ffb399;
	--success-bg: #d4edda;
	--success-border: #28a745;
	--error-bg: #f8d7da;
	--error-border: #dc3545;
	--warning-bg: #fff3cd;
	--warning-border: #ffc107;
	--info-bg: #d1ecf1;
	--info-border: #17a2b8;
	--transition-speed: 0.3s;
}

/* --------- Base Styles --------- */
html {
	height: 100%;
	font-family: "Segoe UI", Calibri, sans-serif;
}

body {
	overflow-y: scroll !important;
	padding: 0 !important;
}

/* --------- Layout --------- */

.row {
	padding-bottom: 5px;
}

.full-width {
	position: absolute;
	left: 0;
	width: 100%;
}

.padding-top {
	padding-top: 20px;
}

/* --------- Navigation --------- */
.navbar {
	padding: 0.375rem 0.75rem;
}

/* Development server - dark red navbar */
.navbar.bg-dev-dark {
	background: linear-gradient(135deg, #8B0000 0%, #6B0000 100%) !important; /* Dark red with diagonal gradient */
}

/* Override gradient when red header is hidden */
.navbar.bg-dev-dark.hide-red {
	background: linear-gradient(135deg, #2F2A4A 0%, #25203A 100%) !important; /* Use production gradient instead */
}

.navbar-brand {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
}

.logo {
	text-decoration: none !important;
	color: var(--lightgrey) !important;
}

.logo .d-flex {
	line-height: 1.2;
}

.logo .font-weight-bold {
	font-size: 1.125rem;
	color: #fff;
	margin-bottom: 0.15rem;
}

.logo .small {
	font-size: 0.825rem;
	color: var(--lightgrey);
	font-weight: 500;
}

.navbar-nav > li > .dropdown-menu {
	margin-top: 0;
}

.navbar-nav > li > .dropdown-menu a {
	padding: 8px 20px;
}

/* Fix border/outline issues on dropdown-toggle links */
.nav-link.dropdown-toggle {
	outline: none !important;
	border: none !important;
	box-shadow: none !important;
}

.nav-link.dropdown-toggle:focus,
.nav-link.dropdown-toggle:active,
.nav-link.dropdown-toggle:focus-visible,
.nav-link.dropdown-toggle.show,
.nav-link.dropdown-toggle[aria-expanded="true"] {
	outline: none !important;
	border: none !important;
	box-shadow: none !important;
	background-color: transparent !important;
}

.nav-link.dropdown-toggle:hover {
	outline: none !important;
	border: none !important;
}

/* Remove any Bootstrap focus ring */
.nav-link.dropdown-toggle:focus::before,
.nav-link.dropdown-toggle:focus::after {
	display: none !important;
}

/* --------- Links --------- */
a {
	-webkit-transition: all var(--transition-speed);
	transition: all var(--transition-speed);
	text-decoration: none;
}

a:hover, a:visited, a:link, a:active {
	text-decoration: none;
}

a:hover {
	color: var(--stmblue);
}

.a-nocolor {
	-webkit-transition: all var(--transition-speed);
	transition: all var(--transition-speed);
	color: var(--darkgrey);
	text-decoration: none;
}

/* --------- Cards --------- */
.card {
	width: 100%;
	margin: 10px auto;
}

.card-user {
	max-width: 500px;
}

/* --------- Images --------- */
img {
	max-width: 100%;
	height: auto !important;
}

.small-image {
	max-height: 80px;
}

.header-logo {
	max-height: 110px;
}

.img-asset {
	max-height: 200px;
}

.img-asset-table {
	max-height: 50px;
}

/* --------- Text Alignment --------- */
.center {
	text-align: center;
}

.middle {
	vertical-align: middle;
}

.right {
	text-align: right;
}

.left {
	text-align: left;
}

.centered {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
}

/* --------- Typography --------- */
.bold {
	font-weight: bold;
}

.red {
	color: #dc3545 !important;
}

.float-right {
	float: right;
}

/* --------- Forms --------- */
.form {
	margin: 0 auto;
	padding: 15px;
}

.form-section {
	margin-bottom: 20px;
}

.form-group,
.input-group {
	margin-bottom: 1rem;
}

.form-inline {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-ms-flex-flow: row wrap;
	flex-flow: row wrap;
	margin-bottom: 1rem;
}

.form-inline .form-group {
	align-items: stretch;
	height: 40px;
}

.form-inline label {
	display: flex;
	align-items: center;
	height: 100%;
	margin-bottom: 0;
	padding-right: 0.5rem;
	font-weight: 500;
}

.form-inline .input-group {
	display: flex;
	align-items: center;
	height: 100%;
}

.form-inline .form-control {
	height: 100%;
	min-width: 160px;
	margin-right: 0.5rem;
}

.form-inline .btn {
	display: flex;
	align-items: center;
	height: 100%;
	margin-left: 0.5rem;
	padding-top: 0;
	padding-bottom: 0;
}

/* --------- Tables --------- */
.table-outer-border {
	border: 1px solid var(--border-color);
	border-radius: 0.25rem;
}

.table .thead-dark .a-nocolor {
	-webkit-transition: all var(--transition-speed);
	transition: all var(--transition-speed);
	color: #FFF;
	text-decoration: none;
}

.table .thead-dark .a-nocolor:hover {
	color: var(--gold);
	text-decoration: none;
}

/* --------- Colors --------- */
.bg-dark {
	background: linear-gradient(135deg, #2F2A4A 0%, #25203A 100%) !important; /* Subtle diagonal gradient */
}

.bg-orange {
	background-color: #ff9800;
}

.bg-yellow {
	background-color: #ffeb3b;
}

.bg-green {
	background-color: #4caf50;
}

.bg-blue {
	background-color: #2196f3;
}

/* --------- Icons --------- */
.ico-primary {
	color: var(--stmblue);
}

.ico-success {
	color: #28a745;
}

.ico-warning {
	color: #ffc107;
}

.ico-danger {
	color: #dc3545;
}

.ico-secondary {
	color: var(--darkgrey);
}

/* --------- Utilities --------- */
.hide {
	display: none !important;
}

.inherit {
	color: inherit;
}

.pointer:hover {
	cursor: pointer;
}

.big-checkbox {
	width: 25px;
	height: 25px;
}

/* --------- Responsive Table --------- */
#resp-table {
	display: table;
	width: 100%;
}

#resp-table-caption {
	display: table-caption;
	text-align: center;
	font-size: 30px;
	font-weight: bold;
}

#resp-table-header {
	display: table-header-group;
	background-color: var(--stmblue);
	font-weight: bold;
	font-size: 25px;
}

.table-header-cell,
.table-body-cell {
	display: table-cell;
	padding: 10px;
	text-align: justify;
	border-bottom: 1px solid black;
}

#resp-table-body {
	display: table-row-group;
}

.resp-table-row {
	display: table-row;
}

/* --------- View Lesson --------- */
#view-lesson > .row > div[class^="col-"] {
	margin-bottom: 15px;
}

#view-lesson > .row > div[class^="col-"] .card {
	height: 100%;
}

#view-lesson > .row > div[class^="col-"] .card .card-header {
	background-color: var(--stmblue);
	color: white;
	font-weight: bold;
}

#view-lesson > .row > div[class^="col-"] .card .card-body {
	padding: 1rem;
}

.view-card-header {
	background-color: var(--stmblue);
	color: white;
	font-weight: bold;
	padding: 0.75rem 1.25rem;
	margin-bottom: 0;
	border-bottom: 1px solid rgba(0,0,0,.125);
}

/* --------- Modals --------- */
.modal {
	display: none;
	position: fixed;
	z-index: 1050;
}

/* --------- Dropdowns --------- */
.dropdown-item:focus, 
.dropdown-item:hover {
	color: #16181b;
	text-decoration: none;
	background-color: #f8f9fa;
}

/* --------- Buttons --------- */
.btn-link {
	font-weight: 400;
	color: var(--stmblue);
	text-decoration: none;
}

.btn-link:focus, 
.btn-link:hover {
	color: #0056b3;
	text-decoration: underline;
}

/* --------- File Input --------- */
.custom-file {
	position: relative;
	display: inline-block;
	width: 100%;
	height: calc(1.5em + .75rem + 2px);
	margin-bottom: 0;
}

.custom-file-input {
	position: relative;
	z-index: 2;
	width: 100%;
	height: calc(1.5em + .75rem + 2px);
	margin: 0;
	opacity: 0;
}

.custom-file-input.selected:lang(en)::after {
	content: "Selected";
}

/* --------- Form Validation --------- */
.has-error label,
.has-error .form-control {
	color: var(--error-border);
	border-color: var(--error-border);
}

/* --------- Lists --------- */
.list-unstyled li {
	margin-bottom: 10px;
	padding: 5px;
	border-bottom: 1px solid var(--border-color);
}

/* --------- User Menu --------- */
.user-menu {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 1000;
	display: none;
	min-width: 10rem;
	padding: 0.5rem 0;
	margin: 0.125rem 0 0;
	font-size: 1rem;
	color: #212529;
	text-align: left;
	list-style: none;
	background-color: #fff;
	background-clip: padding-box;
	border: 1px solid rgba(0,0,0,.15);
	border-radius: 0.25rem;
}

/* --------- Box Container --------- */
.box-container {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
	margin: -10px;
	max-width: 1200px;
}

.box {
	-webkit-box-flex: 1;
	-ms-flex: 1 1 300px;
	flex: 1 1 300px;
	margin: 10px;
	border-radius: 5px;
	-webkit-box-shadow: var(--box-shadow);
	box-shadow: var(--box-shadow);
	-webkit-transition: all var(--transition-speed) ease-in-out;
	transition: all var(--transition-speed) ease-in-out;
	overflow: hidden;
}

.box a {
	display: block;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.box a:hover {
	color: inherit;
	text-decoration: none;
}

.box-content {
	padding: 20px;
	height: 100%;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
}

.box-table {
	width: 100%;
	text-align: center;
}

.box-table-cell {
	padding: 10px;
}

.box-table-cell h1 {
	font-size: 2.5rem;
	margin-bottom: 1rem;
}

.box-table-cell h3 {
	margin: 0;
	font-size: 1.5rem;
}

.box:hover {
	-webkit-box-shadow: var(--box-shadow-hover);
	box-shadow: var(--box-shadow-hover);
	-webkit-transform: translateY(-2px);
	transform: translateY(-2px);
}

/* Box Colors */
.box.bg-warning {
	background-color: var(--warning-bg);
	border: 1px solid var(--warning-border);
}

.box.bg-success {
	background-color: var(--success-bg);
	border: 1px solid var(--success-border);
}

.box.bg-danger {
	background-color: var(--error-bg);
	border: 1px solid var(--error-border);
}

/* --------- Notifications --------- */
.notification {
	position: relative;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-ms-flex-direction: column;
	flex-direction: column;
	min-width: 300px;
	margin-bottom: 10px;
	padding: 15px;
	border-radius: 4px;
	-webkit-box-shadow: var(--box-shadow);
	box-shadow: var(--box-shadow);
	opacity: 0;
	-webkit-transform: translateX(100%);
	transform: translateX(100%);
	-webkit-transition: all var(--transition-speed) ease-in-out;
	transition: all var(--transition-speed) ease-in-out;
	word-wrap: break-word;
	background-color: #fff;
	background-clip: border-box;
	border: 1px solid rgba(0,0,0,.1);
}

.notification-header {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	padding: 0.25rem 0.75rem;
	color: #6c757d;
	background-color: rgba(255,255,255,.85);
	background-clip: padding-box;
	border-bottom: 1px solid rgba(0,0,0,.05);
}

.notification-title {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	margin-right: auto;
	font-weight: bold;
}

.notification-container {
	position: fixed;
	z-index: 9999;
	padding: 15px;
}

/* Hide empty notification containers to prevent blocking clicks */
.notification-container:empty {
	display: none;
	pointer-events: none;
}

.notification-container.bottom-right {
	top: auto !important;
	bottom: 0 !important;
	right: 0 !important;
	left: auto !important;
}

.notification.success {
	background-color: var(--success-bg);
	border: 1px solid var(--success-border);
}

.notification.error {
	background-color: var(--error-bg);
	border: 1px solid var(--error-border);
}

.notification.warning {
	background-color: var(--warning-bg);
	border: 1px solid var(--warning-border);
}

.notification.info {
	background-color: var(--info-bg);
	border: 1px solid var(--info-border);
}

.notification .notification-header {
	background-color: transparent;
	border-bottom: none;
}

.notification .notification-title {
	margin-right: auto;
	font-weight: bold;
}

.notification.success .notification-title {
	color: var(--success-border);
}

.notification.error .notification-title {
	color: var(--error-border);
}

.notification.warning .notification-title {
	color: var(--warning-border);
}

.notification.info .notification-title {
	color: var(--info-border);
}

.notification-body {
	padding: 0.75rem;
	color: #212529;
	background-color: transparent;
}

.notification.showing {
	opacity: 1;
	-webkit-transform: translateX(0);
	transform: translateX(0);
}

.notification.show {
	opacity: 1;
	-webkit-transform: translateX(0);
	transform: translateX(0);
}

.notification.hide {
	opacity: 0;
	-webkit-transform: translateX(100%);
	transform: translateX(100%);
}

/* --------- Fatal Error --------- */
div#fatalError {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0,0,0,0.5);
	z-index: 9999;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
}

div#fatalErrorInner {
	background-color: var(--FatalErrorBackground);
	border: 2px solid var(--FatalErrorBorder);
	padding: 20px;
	border-radius: 5px;
	max-width: 80%;
	max-height: 80%;
	overflow: auto;
	-webkit-box-shadow: var(--box-shadow);
	box-shadow: var(--box-shadow);
}

div#fatalError span {
	display: block;
	margin-bottom: 10px;
	font-weight: bold;
	color: var(--FatalErrorBorder);
}

/* --------- Media Queries --------- */
@media (max-width: 576px) {
	.notification {
		min-width: 100%;
		margin: 0;
	}
	
	.notification-container {
		width: 100%;
		padding: 10px;
	}
}

/* --------- Animations --------- */
.fade {
	-webkit-transition: opacity 0.15s linear;
	transition: opacity 0.15s linear;
}

.fade:not(.show) {
	opacity: 0;
}

/* Flashing animation for dev environment indicator */
@keyframes flash {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.3; }
}

.dev-indicator {
	color: #dc3545 !important;
	font-weight: bold;
	animation: flash 1s infinite;
	-webkit-animation: flash 1s infinite;
}

/* --------- Table Columns --------- */
td[class^="col-"],
th[class^="col-"] {
	position: relative;
	width: 100%;
	padding-right: 15px;
	padding-left: 15px;
}

/* --------- Breakpoints --------- */
@media (min-width: 576px) { /* sm */ }
@media (min-width: 768px) { /* md */ }
@media (min-width: 992px) { /* lg */ }
@media (min-width: 1200px) { /* xl */ }

/* Custom card header colors */
.custom-bg-blue    { background: #2563eb !important; }
.custom-bg-orange  { background: #f59e42 !important; }
.custom-bg-green   { background: #22c55e !important; }
.custom-bg-navy    { background: #1e293b !important; }
.custom-bg-teal    { background: #14b8a6 !important; }
.custom-bg-purple  { background: #a21caf !important; }
.custom-bg-red     { background: #ef4444 !important; }
.custom-bg-yellow  { background: #fde047 !important; }
.custom-bg-pink    { background: #ec4899 !important; }
.custom-bg-grey    { background: #e5e7eb !important; }

.custom-border-blue    { border-color: #2563eb !important; }
.custom-border-orange  { border-color: #f59e42 !important; }
.custom-border-green   { border-color: #22c55e !important; }
.custom-border-navy    { border-color: #1e293b !important; }
.custom-border-teal    { border-color: #14b8a6 !important; }
.custom-border-purple  { border-color: #a21caf !important; }
.custom-border-red     { border-color: #ef4444 !important; }
.custom-border-yellow  { border-color: #fde047 !important; }
.custom-border-pink    { border-color: #ec4899 !important; }

.stat-block { min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
@media (max-width: 575.98px) {
  .stat-block { min-height: 90px; }
}

@media (min-width: 1200px) {
  .modal-xl {
    max-width: 98vw;
  }
  .modal-content {
    width: 100%;
  }
}
.modal-body {
  max-height: 80vh;
  overflow-y: auto;
}

/* ========== Compact UI Styling (Merged from admin-ui.css) ========== */
/* These styles apply globally to all pages for consistent compact UX */

/* Default button size override - compact sizing */
.btn:not(.btn-sm):not(.btn-lg):not(.btn-xl) {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Default form control size override - compact sizing */
.form-control:not(.form-control-sm):not(.form-control-lg) {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    height: calc(1.5em + 0.5rem + 2px);
}

/* Select elements - compact sizing */
select.form-control:not(.form-control-sm):not(.form-control-lg) {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    height: calc(1.5em + 0.5rem + 2px);
}

/* Textarea elements - keep normal size for readability */
textarea.form-control:not(.form-control-sm):not(.form-control-lg) {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    height: auto !important;
    min-height: calc(1.5em + 0.75rem + 2px);
    resize: vertical;
}

/* Card header standardization - padding only (colors preserved for standard pages) */
.card-header {
    padding: 0.5rem 1rem !important;
}

/* Badge sizing - keep compact */
.badge {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
}

/* Global alert margin-bottom */
.alert {
    margin-bottom: 1rem !important;
}

/* Table compact styling */
.table {
    font-size: 0.875rem;
}

.table td,
.table th {
    padding: 0.5rem;
}

/* Ensure cards have consistent shadow */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Compact spacing */
.mb-4 {
    margin-bottom: 1rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

/* Compact breadcrumb */
.breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 0;
    padding: 0.25rem 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    padding: 0 0.5rem;
}

/* Compact page header */
h1.h3 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

/* Compact list group items */
.list-group-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.list-group-item .badge {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .form-control {
        font-size: 0.8rem;
    }
}

/* ========== Global Card Header Color Overrides ========== */
/* Override primary color to use stm-blue for all card headers */
.card-header.bg-primary {
    background-color: var(--stmblue) !important;
    color: #ffffff !important;
}

/* Override primary background color for entire cards */
.card.bg-primary {
    background-color: var(--stmblue) !important;
    color: #ffffff !important;
}

/* Override primary border color for cards */
.card.border-primary {
    border-color: var(--stmblue) !important;
}

/* ========== Admin-Only Card Header Color Overrides ========== */
/* These styles ONLY apply to admin pages - standardizes card headers to stmblue */

/* Ensure consistent card header styling - use custom stmblue color for admin pages only */
.admin-page .card-header.bg-dark {
    background-color: var(--stmblue) !important;
    color: #ffffff !important;
}

/* Override any colored card headers to use dark (stmblue) - admin pages only */
.admin-page .card-header.bg-primary,
.admin-page .card-header.bg-success,
.admin-page .card-header.bg-info,
.admin-page .card-header.bg-warning,
.admin-page .card-header.bg-danger,
.admin-page .card-header.bg-secondary {
    background-color: var(--stmblue) !important;
    color: #ffffff !important;
}


/* Accordion/collapse button links in dark headers - admin pages only */
.admin-page .card-header.bg-dark .btn-link {
    color: #ffffff !important;
    text-decoration: none;
}

.admin-page .card-header.bg-dark .btn-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
}

.admin-page .card-header.bg-dark .btn-link:focus {
    color: #ffffff !important;
    text-decoration: none;
    box-shadow: none;
}

/* ========== Admin Navigation Menu (Admin-specific) ========== */
/* Compact navigation dropdown menu */
.admin-nav-menu .dropdown-item {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    white-space: nowrap;
}

.admin-nav-menu .dropdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-nav-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    margin-right: 0.5rem;
}

.admin-nav-menu .col-4 {
    border-right: 1px solid rgba(0,0,0,0.1);
}

.admin-nav-menu .col-4:last-child {
    border-right: none;
}

/* Responsive adjustments for admin nav menu */
@media (max-width: 768px) {
    .admin-nav-menu {
        min-width: 100% !important;
    }
    
    .admin-nav-menu .col-4 {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }
    
    .admin-nav-menu .col-4:last-child {
        border-bottom: none;
    }
}