/*===========================================================================
* GLOBAL LAYOUT & BASE STYLES
============================================================================*/
body,
html {
	height: 100%;
	margin: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.wrapper {
	display: flex;
	flex: 1;
	overflow: hidden;
}

/*===========================================================================
* SIDEBAR NAVIGATION
============================================================================*/
.sidebar {
	width: 220px;
	height: 100vh;
	background: #0d6efd;
	color: white;
	transition:
		width 0.3s ease,
		opacity 0.3s ease;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	white-space: nowrap;
}

.sidebar.collapsed {
	width: 0;
	opacity: 0;
	visibility: hidden;
}

.sidebar .nav-link {
	color: white;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px;
	transition: all 0.3s ease;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover,
.submenu .nav-link.active,
.submenu .nav-link:hover {
	background: rgb(123, 147, 184);
	border-radius: 5px;
}

.sidebar .nav-link i {
	font-size: 20px;
	width: 25px;
	text-align: center;
}

/* Submenus */
.submenu {
	padding-left: 20px;
}

.submenu .nav-link {
	padding-left: 20px;
}

/* Active submenu keeps parent open */
.submenu.show {
	display: block;
}

/*===========================================================================
* MAIN CONTENT AREA
============================================================================*/
.main-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	transition:
		margin-left 0.3s ease,
		width 0.3s ease;
	width: calc(100% - 220px);
}

.sidebar.collapsed ~ .main-content {
	width: 100%;
}

.content-area {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
}

/*===========================================================================
* HEADER & FOOTER
============================================================================*/
.top-navbar {
	background: #0d6efd;
	color: white;
	padding: 10px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: width 0.3s ease;
	width: 100%;
}

.footer {
	background: #6c757d;
	color: white;
	padding: 15px;
	display: flex;
	justify-content: center;
	align-items: center !important;
	transition: width 0.3s ease;
	width: 100%;
}

.toggle-btn {
	background: none;
	border: none;
	color: white;
	font-size: 24px;
	cursor: pointer;
}

.profile-img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
}

/*===========================================================================
* FORM CONTROLS & INPUT STYLES
============================================================================*/
.form-control,
.form-control:focus,
.form-select,
.form-select:focus {
	border-radius: 5px;
	box-shadow: none !important;
}

/*===========================================================================
* SELECT2 DROPDOWN STYLES
============================================================================*/
/* Base Select2 styling */
.select2-container {
	z-index: 1100 !important;
}

.select2-container--bootstrap-5 .select2-selection,
.select2-container--bootstrap-5 .select2-selection--single {
	border: 1px solid #ced4da !important;
	border-radius: 0.375rem; /* match Bootstrap's default */
	min-height: calc(1.5em + 0.75rem + 2px); /* match input height */
	padding: 0.375rem 0.75rem;
}

/* Rendered text alignment */
.select2-container--bootstrap-5 .select2-selection__rendered {
	line-height: normal;
}

/* Dropdown list styling */
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options {
	max-height: 200px !important;
	overflow-y: auto !important;
	overflow-x: hidden !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option--selected {
	background-color: #0d6efd !important; /* Bootstrap primary */
	color: #fff !important;
}

/* Search box styling */
.select2-container--bootstrap-5 .select2-dropdown .select2-search__field:focus {
	outline: none;
	border-width: 0.1px;
	border-color: #0d6efd;
	box-shadow: none;
}

/* Force the main wrapper to use Flexbox so items sit side-by-side */
.select2-container--bootstrap-5
	.select2-selection--multiple
	.select2-selection__rendered {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	margin: 0 !important;
	padding-top: 0.5px !important;
	list-style: none !important;
}

.select2-selection__choice {
	background-color: #0d6efd !important;
	color: #ffffff !important;
}

.select2-selection__choice__remove,
.select2-selection__choice__remove:hover {
	color: #ffffff !important;
	background-color: #0d6efd !important;
}

/* Force the tags to shrink-wrap their text */
.select2-container--bootstrap-5
	.select2-selection--multiple
	.select2-selection__choice {
	display: inline-flex !important; /* Shrinks to fit content */
	width: auto !important;
	max-width: 100% !important;
	align-items: center !important;
	flex-direction: row-reverse !important; /* X on the right */
	margin: 0.125rem 0.25rem 0.125rem 0 !important;
	padding: 2px !important;
	background-color: #0d6efd !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 0.25rem !important;
	float: none !important;
}

/* Strip ALL default browser styling from the internal search input */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-search,
.select2-container--bootstrap-5
	.select2-selection--multiple
	.select2-search__field {
	display: inline-flex !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	margin: 0 !important;
	padding: 0 !important;
	width: auto !important;
	min-width: 80px !important; /* Gives you room to type */
	line-height: inherit !important;
}

/* Fix the X button inside the tags */
.select2-container--bootstrap-5 .select2-selection__choice__remove {
	color: #ffffff !important;
	background: transparent !important;
	border: none !important;
	opacity: 0.7 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	font-weight: bold !important;
	position: static !important;
}

.select2-container--bootstrap-5 .select2-selection__choice__remove:hover {
	opacity: 1 !important;
	color: #ffffff !important;
}

/* Clean up duplicate spans */
.select2-container--bootstrap-5 .select2-selection__choice__display {
	/* background-color: transparent !important; */
	padding: 0 !important;
	margin: 0 !important;
}

/* ==========================================================
   VALIDATION STATES (Your custom SVG backgrounds)
   ========================================================== */
.select2-selection.is-invalid {
	border-color: #dc3545 !important;
	padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 1rem;
}

.select2-selection.is-valid {
	border-color: #198754 !important;
	padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 1rem;
}

/*===========================================================================
* DATATABLE STYLES
============================================================================*/
/* DataTable search and dropdown styling */
.no-focus-style {
	border: 1px solid lightblue !important;
	/* border: 1px solid #ced4da !important; */
	padding: 0.375rem 0.75rem !important;
	border-radius: 0.25rem !important;
}

.no-focus-style:focus {
	outline: none !important;
	box-shadow: none !important;
}

/* DataTable export button styling */
.dt-button.custom-data-table-btn {
	background-color: lightblue !important;
	color: black !important;
	border: none;
	padding: 6px 12px;
	border-radius: 20px !important;
	margin: 0 4px;
}

/* DataTable pagination button styling */
.dt-paging-button.current {
	background-color: lightblue !important;
}

/*===========================================================================
* ERROR MESSAGE STYLES
============================================================================*/
.error {
	color: #ff0000;
}

/*===========================================================================
* FILE UPLOAD & DROPZONE STYLES
============================================================================*/
.drop-zone {
	height: 150px;
	border: 2px dashed #ced4da !important;
	border-radius: 0.375rem;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	cursor: pointer;
	box-sizing: border-box;
	position: relative;
	background-color: #eceff1;
}

.drop-zone__thumb {
	width: 100%;
	height: 100%;
	border-radius: 0px 0px 0.375rem 0.375rem;
	position: relative;
	overflow: hidden;
}

.drop-zone__thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}

.drop-zone__thumb::after {
	content: attr(data-label);
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	padding: 5px 0;
	color: #ffffff;
	background: #000000bf;
	font-size: 14px;
	text-align: center;
	border-bottom-right-radius: 0.375rem;
	border-bottom-left-radius: 0.375rem;
}

.upload-drpzone-file {
	display: none !important;
}

/*===========================================================================
* JQUERY UI DATEPICKER STYLES
============================================================================*/
/* Base datepicker styling */
.ui-datepicker {
	z-index: 1200 !important;
}

/* Today's date highlighting */
.ui-datepicker-today a {
	background-color: #fffa90 !important;
	color: #777620 !important;
	font-weight: bold;
}

/* Selected date styling */
.ui-state-active {
	background-color: #0d6efd !important;
	color: #fff !important;
	font-weight: bold;
}

/*===========================================================================
* SALUTATION INPUT STYLES
============================================================================*/
.salutation {
	width: 100px !important; /* Adjust width as needed */
	flex: none !important; /* Prevents auto-stretch */
}

/* Unified Salutation & First Name Box */
.unified-input-group {
	display: flex;
	border: 1px solid #ced4da; /* Standard Bootstrap border color */
	border-radius: 0.375rem; /* Standard Bootstrap border radius */
	overflow: hidden; /* Keeps the corners rounded */
	background-color: #fff;
}

/* Remove borders from the native input */
.unified-input-group .form-control {
	border: none;
	box-shadow: none !important;
}

/* Remove borders from Select2 so it blends in */
.unified-input-group .select2-container--bootstrap-5 .select2-selection {
	border: none !important;
	border-right: 1px solid #ced4da !important; /* Keep only the divider line */
	border-radius: 0 !important;
	background-color: transparent !important;
	box-shadow: none !important;
}

/* Optional: Add the blue glow to the whole group when focused */
.unified-input-group:focus-within {
	border-color: #86b7fe;
	/* box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); */
}

/*===========================================================================
* TABLE STYLING
============================================================================*/
/* Sub row background color for tables */
.sub-row-bg {
	background-color: #dbd7d7 !important;
}

/*===========================================================================
* INTERNATIONAL TELEPHONE INPUT (ITI) STYLES
============================================================================*/
/* Base ITI styling */
.iti {
	width: 100% !important;
}

/*===========================================================================
* COPY BUTTON STYLES
============================================================================*/
/* Copy Wrapper */
.copy-wrapper {
	position: relative;
	width: 100%;
}

/* Copy Button */
.copy-btn {
	cursor: pointer;
	color: #0d6efd;
	font-size: 1.2rem;
	display: none;
}

/* Text Fix (for p, h, etc.) */
.copy-text {
	margin: 0 !important;
}

/* Show Button */
.copy-wrapper:hover .copy-btn,
.copy-wrapper:focus-within .copy-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Copy button right side styles */
.copy-right {
	display: block;
}

.copy-right .copy-text {
	padding-right: 35px;
}

.copy-right .copy-btn {
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
}

/* Copy button left side styles */
.copy-left {
	display: block;
}

.copy-left .copy-text {
	padding-left: 35px;
}

.copy-left .copy-btn {
	position: absolute;
	top: 50%;
	left: 10px;
	transform: translateY(-50%);
}

/* Copy button right side inline styles */
.copy-inline {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.copy-inline .copy-btn {
	position: static;
}

/* Copy button default styles */
.copy-wrapper:not(.copy-left):not(.copy-right):not(.copy-inline) {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.copy-wrapper:not(.copy-left):not(.copy-right):not(.copy-inline) .copy-btn {
	position: static;
}

.copy-wrapper:not(.copy-left):not(.copy-right):not(.copy-inline) .copy-text {
	padding: 0;
}

.hover-card {
	transition: transform 0.2s ease;
}

.hover-card:hover {
	transform: translateY(-5px);
}

.inside-card:hover {
	will-change: transform;
	background-color: #eef0f3 !important;
}

/*===========================================================================
* FLIP BUTTON
============================================================================*/
.btn-flip {
	position: relative;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.btn-flip .flip-inner {
	position: relative;
	height: 1.3em;
	line-height: 1.3em;
	overflow: hidden;
}

.btn-flip .flip-inner span {
	display: block;
	height: 1.3em;
	transition: transform 0.35s ease;
}

.btn-flip .flip-inner span:last-child {
	position: absolute;
	left: 0;
	top: 100%;
	width: 100%;
}

.btn-flip:hover .flip-inner span:first-child {
	transform: translateY(-100%);
}

.btn-flip:hover .flip-inner span:last-child {
	transform: translateY(-100%);
}

/*===========================================================================
* RESPONSIVE DESIGN
============================================================================*/
@media (max-width: 768px) {
	/* Mobile sidebar behavior */
	.sidebar {
		width: 0;
		opacity: 0;
		visibility: hidden;
		position: absolute;
		height: 100%;
		z-index: 1101;
		transition: all 0.3s ease;
	}

	.sidebar.show {
		width: 200px;
		opacity: 1;
		visibility: visible;
	}

	/* Mobile main content */
	.main-content {
		width: 100%; /* Full width when sidebar is hidden */
	}

	.content-area {
		flex: 1;
		padding: 10px;
		overflow-y: auto;
	}

	/* Mobile utility classes */
	.custom-center {
		text-align: center !important;
	}
}
