/* ==========================================================================
   Modern Bootstrap 5 Tweaks for Services Modal & Forms
   Bootstrap 5, PHP 8.4.17, MySQL 8, JavaScript compatible
   Fixes floating label on select without removing .form-floating
   ========================================================================== */

:root {
	--radius: 0.68rem;
	--transition: all 0.18s ease-in-out;
	--focus-ring: 0 0 0 4px rgba(59, 130, 246, 0.20);
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
	--text-muted: #6b7280;
	--border: #d1d5db;
	--primary: #4285F4;
}

/* ==========================================================================
   FORM CONTROLS BASE
   ========================================================================== */
/* Custom CSS for the second sticky element */

.form-control,
.form-select,
textarea.form-control {
	border-radius: var(--radius);
	border: .15em solid var(--border);
	padding: 0.72rem 1rem;
	font-size: 1rem;
	line-height: 1.5;
	color: #111827;
	background-color: #ffffff;
	transition: var(--transition);
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.form-floating>.form-control-plaintext:focus,
.form-floating>.form-control-plaintext:not(:placeholder-shown),
.form-floating>.form-control:focus,
.form-floating>.form-control:not(:placeholder-shown) {
	padding-top: 1.625rem;
	padding-bottom: 1.25rem;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
	border-color: var(--primary);
	box-shadow: var(--focus-ring);
	background-color: #ffffff;
	outline: none;
}

/* ==========================================================================
   FLOATING LABELS – text/textarea + forced fix for select
   ========================================================================== */

.form-floating>label {
	color: var(--text-muted);
	font-weight: 500;
	transition: var(--transition);
	pointer-events: none;
	left: auto;
	height: auto;
}

/* Text & textarea floating behavior */
.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label,
.form-floating>textarea.form-control:focus~label,
.form-floating>textarea.form-control:not(:placeholder-shown)~label {
	opacity: 1;
	transform: scale(0.85) translateY(-0.58rem) translateX(0.4rem);
	color: var(--primary);
	background: #ffffff;
	padding: 0 0.4rem;
}

/* Fix vertical alignment + spacing for floating label on select */
.form-floating>.form-select {
	padding-top: 1rem !important;
	/* ← main lever – increase to 2.1rem / 2.2rem if still too high */
	padding-bottom: 0.75rem !important;
	padding-left: 1rem !important;
	padding-right: 2.8rem !important;
	/* space for chevron + safety margin */
	line-height: 1.55;
}

/* Make sure label has solid background and is positioned safely */
.form-floating>.form-select~label {
	background-color: #ffffff !important;
	padding: 0 0.55rem !important;
	z-index: 5;
	top: 0.05rem !important;
	/* tiny adjustment – try 0 or 0.1rem */
	height: 1.35rem;
	line-height: 1.35rem;
	overflow: hidden;
}

/* Optional – truncate very long labels so they don't overflow right */
.form-floating>.form-select~label {
	max-width: calc(100% - 4rem);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Visual feedback when focused */
.form-floating>.form-select:focus~label {
	color: #0d6efd !important;
	/* or your --primary color */
}

/* ==========================================================================
   ROW FIX for Category + Price (your .row.g-3.mb-3)
   ========================================================================== */

.row.g-3.mb-3>.col-md-6.form-floating {
	padding-top: 0 !important;
	/* remove extra floating top space */
}

.row.g-3.mb-3 .form-label {
	margin-bottom: 0.4rem;
}

/* ==========================================================================
   BUTTONS – modern lift + gradient
   ========================================================================== */

.btn {
	font-weight: 600;
	border-radius: var(--radius);
	padding: 0.68rem 1.4rem;
	transition: var(--transition);
	box-shadow: var(--shadow-sm);
}

.btn:hover {
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
}

.btn-primary {
	background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
	border-color: #2563eb;
}

.btn-primary:hover,
.btn-primary:focus-visible {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	border-color: #1d4ed8;
}

.btn-outline-secondary {
	color: #64748b;
	border-color: #64748b;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
	color: white;
	background: linear-gradient(135deg, #64748b 0%, #475569 100%);
	border-color: transparent;
}

/* ==========================================================================
   Modal polish
   ========================================================================== */

.modal-content {
	border-radius: var(--radius);
	border: none;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-header,
.modal-footer {
	border-color: #e5e7eb;
}

/* ==========================================================================
   Compact action buttons for tables
   ========================================================================== */

/* Base style for action buttons in tables */
.action-btn {
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 0.95rem;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.5rem;
	transition: all 0.15s ease;
	margin-left: 4px;
}

/* Make them even smaller on narrow screens if needed */
@media (max-width: 576px) {
	.action-btn {
		width: 28px;
		height: 28px;
		font-size: 0.9rem;
	}
}

/* Info (edit) button */
.action-btn.btn-outline-info {
	color: #0dcaf0;
	border-color: #0dcaf0;
}

.action-btn.btn-outline-info:hover,
.action-btn.btn-outline-info:focus-visible {
	background-color: #0dcaf0;
	color: white;
	border-color: #0dcaf0;
	box-shadow: 0 0 0 3px rgba(13, 202, 240, 0.25);
}

/* Danger (delete) button */
.action-btn.btn-outline-danger {
	color: #dc3545;
	border-color: #dc3545;
}

.action-btn.btn-outline-danger:hover,
.action-btn.btn-outline-danger:focus-visible {
	background-color: #dc3545;
	color: white;
	border-color: #dc3545;
	box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}



/* Optional: tooltip enhancement */
.action-btn[title] {
	position: relative;
}

.action-btn[title]:hover::after {
	content: attr(title);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	background: #333;
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.75rem;
	white-space: nowrap;
	pointer-events: none;
	z-index: 100;
	margin-bottom: 6px;
}

/* ==========================================================================
   Compact action buttons for tables
   ========================================================================== */

/* ==========================================================================
	  Light action buttons with solid color icons – table-friendly
	  ========================================================================== */

.action-btn {
	width: 34px;
	height: 34px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.5rem;
	font-size: 1rem;
	transition: all 0.15s ease;
	margin-left: 6px;
	border: 1px solid #dee2e6;
	background-color: #f8f9fa;
	box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.02);
}

.action-btn:hover,
.action-btn:focus-visible {
	background-color: #e9ecef;
	border-color: #ced4da;
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.action-btn:active {
	transform: translateY(0);
	box-shadow: none;
}

/* Solid color icons */
.action-btn i.bi-pencil {
	color: #0d6efd;
	/* primary blue */
}



/* Optional: slightly larger icon on hover */
.action-btn:hover i {
	font-size: 1.1rem;
}

/* Mobile / narrow table adjustment */
@media (max-width: 576px) {
	.action-btn {
		width: 30px;
		height: 30px;
		margin-left: 4px;
	}

	.action-btn i {
		font-size: 0.95rem;
	}
}

/* Tooltip on hover */
.action-btn[title]:hover::after {
	content: attr(title);
	position: absolute;
	bottom: 130%;
	left: 50%;
	transform: translateX(-50%);
	background: #333;
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.78rem;
	white-space: nowrap;
	z-index: 100;
	margin-bottom: 6px;
	pointer-events: none;
}

.action-btn {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	/* or keep 0.5rem for square */
}

.action-btn:hover {
	transform: scale(1.08);
}

/* ==========================================================================
   Compact button group for table actions
   Light theme, icon-only, solid color icons
   ========================================================================== */

.btn-group-sm .btn {
	width: 40px;
	height: 30px;
	padding: 0;
	font-size: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 01.5rem;
	transition: all 0.15s ease;
	border-color: #dee2e6;
	background-color: #f8f9fa;
	box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.02);
}

/* First button in group - rounded left */
.btn-group-sm .btn:first-child {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

/* Last button in group - rounded right */
.btn-group-sm .btn:last-child {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

/* Hover & focus for the whole group */
.btn-group-sm .btn:hover,
.btn-group-sm .btn:focus-visible {
	background-color: #e9ecef;
	border-color: #ced4da;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	z-index: 2;
}

/* Active state */
.btn-group-sm .btn:active {
	transform: translateY(0);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Solid color icons */
.btn-group-sm .edit-btn i.bi-pencil {
	color: #0d6efd;
	/* Bootstrap primary */
}

.btn-group-sm .delete-btn i.bi-trash {
	color: #dc3545;
	/* Bootstrap danger */
}

/* Optional: micro-scale on hover */
.btn-group-sm .btn:hover i {
	transform: scale(1.12);
}

/* Mobile adjustment */
@media (max-width: 576px) {
	.btn-group-sm .btn {
		width: 32px;
		height: 32px;
		font-size: 0.95rem;
	}
}

/* Tooltip on hover */
.btn-group-sm .btn[title]:hover::after {
	content: attr(title);
	position: absolute;
	bottom: 130%;
	left: 50%;
	transform: translateX(-50%);
	background: #333;
	color: white;
	padding: 5px 9px;
	border-radius: 4px;
	font-size: 0.78rem;
	white-space: nowrap;
	z-index: 100;
	margin-bottom: 6px;
	pointer-events: none;
	opacity: 0.95;
}

/* ==========================================================================
   Compact line items in project modal table
   Smaller inputs/selects, reduced padding, tighter layout
   ========================================================================== */

/* Base row styling */
.line-item-row {
	font-size: 0.92rem;
	/* slightly smaller text */
}

/* All form controls inside line items */
.line-item-row .form-control,
.line-item-row .form-select {
	font-size: 0.875rem;
	/* 14px – compact but readable */
	padding: 0.15rem 0.4rem;
	/* much tighter vertical padding */
	height: 32px;
	/* fixed small height */
	min-height: unset;
	line-height: 1.3;
	border-radius: 0.4rem;
	border-color: rgba(209, 213, 219, .2);
}


/* Selects need extra right padding for arrow */
.line-item-row .form-select {
	padding-right: 1.8rem !important;
	/* space for dropdown arrow */
}

/* Number/date inputs – extra compact */
.line-item-row input[type="number"],
.line-item-row input[type="date"] {
	text-align: center;
	padding: 0.35rem 0.15rem;
	width: 100%;
	/* fill cell */
}

/* Specific column widths adjustments (optional – tweak as needed) */
.line-item-row td {
	padding: 0.14rem 0.15rem !important;
	/* reduce cell padding */
	vertical-align: middle;
}

/* Job #, Length, Start/Finish Date – centered */
.line-item-row .job-input,
.line-item-row .length-input,
.line-item-row .start-date,
.line-item-row .finish-date {
	text-align: center;
}

/* Title column – allow more space */
.line-item-row .title-input {
	width: 100%;
	min-width: 180px;
}

/* Error note – smaller textarea-like feel */
.line-item-row .error-input {
	height: 32px;
	resize: none;
}

/* Total column – bold & right-aligned */
.line-item-total {
	font-weight: 600;
	font-size: 0.95rem;
	padding-right: 1rem !important;
}

/* Buttons in row (add/remove) – smaller icons */
.line-item-row .btn {
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 0.9rem;
	border-radius: 0.4rem;
}

/* Handle for drag – smaller grip */
.handle {
	font-size: 1.1rem;
	width: 28px;
	text-align: center;
}

/* Hover/focus states */
.line-item-row .form-control:focus,
.line-item-row .form-select:focus {
	padding: 0.35rem 0.6rem;
	box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.line-item-row .form-select {
	background-position: right .5rem center;
}

/* Mobile / narrow screen adjustment */
@media (max-width: 768px) {

	.line-item-row .form-control,
	.line-item-row .form-select {
		font-size: 0.85rem;
		padding: 0.3rem 0.5rem;
		height: 30px;
	}

	.line-item-row td {
		padding: 0.3rem 0.4rem !important;
	}

	.category-select {
		min-width: 115px !important;
	}

	.service-select {
		min-width: 220px !important;
	}
}

.sticky-top-2 {
	position: -webkit-sticky;
	position: sticky;
	top: 76px;
	z-index: 1019;
}

.frosted-element {
	background: rgba(255, 255, 255, 0.8);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	border: 1px solid rgba(255, 255, 255, 0.3);
}

.sticky-top-2 .form-control,
.sticky-top-2 .btn,
{
transition: none !important;
}

/* For Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* For Firefox */
input[type=number] {
	-moz-appearance: textfield;
	appearance: textfield;
	/* Standard property for other browsers */
}

.popover {
	box-shadow: 0 .3rem 1rem rgba(0, 0, 0, .15)
}

.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
	color: var(--bs-nav-pills-link-active-color);
	background-color: var(--bs-nav-pills-link-active-bg);
}

.navbar-nav .nav-link {
	border-radius: .8em !important;
	padding: .5rem 1rem !important;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link.show {
	color: var(--bs-navbar-active-color);
	background: rgba(0, 0, 0, .25);
}

.navbar-nav .nav-link:focus,
.navbar-nav .nav-link:hover {
	color: var(--bs-nav-link-hover-color);
	background: rgba(0, 0, 0, .1);
}

.modal-backdrop {
	/* Ensure the backdrop covers the viewport */
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;



	/* Semi-transparent background color to enhance the glass effect */
	background-color: rgba(0, 0, 0, .6);
	opacity: .9 !important;

	/* Ensure it sits below your modal but above other content */
	z-index: 1040;
}

@media (max-width: 575.98px) {
	.modal-backdrop {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(255, 255, 255, 1);
		opacity: 1 !important;
		z-index: 1040;
	}
}

@media (max-width: 767.98px) {
	.navbar-nav .nav-link {
		font-size: 1.75rem;
	}
}

.table td {
	vertical-align: middle;
}

@media (min-width: 576px) {
	#searchInput {
		width: 320px !important;
	}
}

.btn-icon {
	width: 30px;
	height: 30px;
	padding: .25em 0;
	color: rgba(var(--bs-link-color-rgb));
	box-shadow: none !important;
	border-radius: 50% !important;
}

.btn-icon:hover {
	background-color: rgb(var(--bs-light));
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08) !important
}