body {
    background: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.contentForm {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}
.form-container {
    background: transparent;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* Unified Form Card */
.unified-form-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

.unified-form-card .card-header {
    background: #ffffff;
    border-bottom: 3px solid #e9ecef;
}

.unified-form-card .card-body {
    background: #ffffff;
}

/* Form Section Blocks */
.form-section-block {
    margin: 0;
}

.form-section-block .section-divider {
    padding: 0.875rem 2rem;
    margin: 0;
    border-left: 5px solid rgba(0, 0, 0, 0.1);
}

.form-section-block .section-divider h5 {
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    margin: 0;
}

.form-section-block .section-divider i {
    opacity: 0.95;
}

.form-section-block .section-body {
    padding: 1rem;
}

.form-section-block .section-body .row {
    margin-bottom: 0;
}

/* Form Submit Section */
.form-submit-section {
    border-top: 3px solid #e9ecef;
    background: #f8f9fa;
    margin: 0;
    padding: 2rem !important;
}

.ImplantType .row , .EvaulateandTreat .row {
    display: grid;
    grid-auto-flow: column;      /* fill top → bottom, then next column */
    grid-template-rows: repeat(8, auto); /* max 8 rows per column */
    column-gap: 2rem;
    row-gap: 0.75rem;
}

/* Responsive fix for grid layout */
@media (max-width: 768px) {
    .ImplantType .row, .EvaulateandTreat .row {
        grid-auto-flow: row;
        grid-template-rows: auto;
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 0.75rem;
    }
}

/* Prevent Bootstrap validation styling on checkbox/radio labels */
.was-validated .form-check-input:valid ~ .form-check-label,
.was-validated .form-check-input:checked ~ .form-check-label,
.form-check-input.is-valid ~ .form-check-label {
    color: inherit !important;
}

/* Legacy section styling (for backwards compatibility) */
.form-section {
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}
.form-section:last-of-type {
    border-bottom: none;
}
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 8px;
    display: inline-block;
}
.section-content {
    padding: 0;
}
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.form-control, .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}
/* .form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
} */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}
/* .form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
} */
.form-check-label {
    font-weight: 400;
    color: #495057;
}
.required::after,
.form-label.required::after {
    content: " *";
    color: #dc3545;
    margin-left: 2px;
}
/* .btn-primary {
    background-color: var(--primaryColor);
    border-color: var(--primaryColor);
    font-weight: 500;
}
.btn-primary:hover {
    background-color: var(--primaryColor);
    border-color: var(--primaryColor);
    opacity: 0.85;
} */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.btn-lg:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}
.alert {
    border-radius: 6px;
    border: none;
}
.alert-success {
    background-color: #d1e7dd;
    color: #0a3622;
}
.top-navbar .navbar {
    padding-top: 10px;
    padding-bottom: 10px;
}
/* Scroll buttons */
#scrollToTopBtn, #scrollToBottomBtn {
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    background: #0d6efd;
    color: white;
}
#scrollToTopBtn:hover, #scrollToBottomBtn:hover {
    background: #0b5ed7;
    color: white;
}
/* Top section styling */
.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    padding: 8px 0 6px;
}
.top-navbar .nav-link {
    font-weight: 600;
    color: #1f2937;
    letter-spacing: 0.2px;
}
.top-navbar .btn.btn-light.btn-sm {
    border-radius: 20px;
    font-weight: 600;
    padding: 6px 12px;
}
.fade-in-text {
    background: #f6f8fb;
}

.referral-view-card {
    border: none;
    box-shadow: 0 10px 30px rgba(6, 24, 44, 0.1);
}
.referral-section {
    background-color: #fff;
}
.referral-section .section-title {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}
.referral-option-label {
    font-weight: 600;
}
.referral-option-input .form-check {
    margin-bottom: 0.5rem;
}
.referral-multi-required.has-error {
    border: 1px solid #dc3545;
    border-radius: 0.5rem;
    padding: 0.75rem;
}
.referral-multi-required .invalid-feedback {
    margin-top: 0.5rem;
}
.referral-responsive-form .btn-modern {
    min-width: 160px;
}
@media (max-width: 768px) {
    .referral-section {
        padding: 1.5rem 1rem;
    }
    .referral-section .section-title {
        font-size: 1rem;
    }
}
.formSelect {
    width: 100%;
  }
  
  .formSelect+.select2-container .select2-selection--single {
    height: 37px;
    padding: 7px;
  }
  
  .formSelect+.select2-container .select2-selection__arrow {
    height: 15px;
  }
  
  .formSelect+.select2-container .select2-selection--single .select2-selection__rendered {
    text-align: left;
    line-height: 28px;
  }

/* Tooth Chart Styling */
.tooth-chart-container {
    margin-top: 1rem;
}

.tooth-chart-toggle {
    border-radius: 4px;
    transition: all 0.3s ease;
}

.tooth-chart-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

.tooth-chart-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(45deg);
}

.tooth-chart {
    background: #ffffff;
}

.tooth-grid-wrapper {
    width: 100%;
}

.tooth-grid {
    width: 100%;
}

.tooth-row {
    gap: 3px;
    padding: 5px 0;
}

.tooth-divider {
    width: 20px;
    height: 2px;
    background: #dee2e6;
    margin: 0 8px;
    align-self: center;
}

.tooth-box {
    width: 40px;
    height: 40px;
    border: 2px solid  var(--primaryColor);
    background-color: #ffffff;
    color:  var(--primaryColor);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.tooth-box:hover {
    background-color: #e3f2fd;
    border-color:  var(--primaryColor);
    transform: scale(1.08);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tooth-box.selected {
    background-color: #007bff;
    color: #ffffff;
    border-color:  var(--primaryColor);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.4);
}

.confirm-teeth {
    background-color: #fff;
    border: 2px solid  var(--primaryColor);
    font-weight: 600;
    color: #212529;
}

.confirm-teeth:focus {
    border-color:  var(--primaryColor);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.clear-tooth-selection {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
}

/* Tooth type toggle buttons */
.tooth-type-toggle {
    position: relative;
    padding-left: 2.5rem;
    text-align: left;
    font-weight: 600;
}

.tooth-type-toggle .toggle-icon {
    position: absolute;
    left: 1rem;
    transition: transform 0.3s ease;
}

.tooth-type-toggle .toggle-icon.fa-chevron-down {
    transform: rotate(0deg);
}

.tooth-type-section {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.tooth-chart-collapse {
    border-top: 1px solid #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-container {
        padding: 20px 15px;
    }
    
    .tooth-box {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
    
    .tooth-row {
        gap: 2px;
    }
    
    .tooth-divider {
        width: 15px;
        margin: 0 5px;
    }
    
    .contentForm {
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    .tooth-box {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    
    .tooth-row {
        gap: 1px;
    }
    
    .tooth-divider {
        width: 10px;
        margin: 0 3px;
    }
}

.bulkFileLoading {
	display: flex;
	justify-content: center;
	align-items: center;
	position: fixed;
	z-index: 1061;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: rgba(0, 0, 0, .4);
}

.bulkFileLoading-box {
	background: #fff;
	padding: 30px 40px;
	border-radius: 10px;
	text-align: center;
	box-shadow: 0 0 10px rgba(0,0,0,0.3);
	min-width: 300px;
}

.bulkFileLoader {
	animation: rotate_v1 1s infinite linear;
	border: 6px solid #eee;
	border-top: 6px solid #3498db;
	border-radius: 50%;
	width: 50px;
	height: 50px;
	margin: 0 auto 20px;
}

@keyframes rotate_v1 {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.bulkFileloading-text {
	font-size: 16px;
	font-weight: bold;
	margin-bottom: 10px;
	color: #333;
}

.bulFileloading-subtext {
	font-size: 14px;
	color: #888;
}

/* Select2 Checkbox Styling for practiceProvider */
.select2-checkbox-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 2px 0;
}

.select2-checkbox-icon {
	width: 18px;
	height: 18px;
	border: 2px solid #ced4da;
	border-radius: 3px;
	background-color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
	transition: all 0.2s ease;
}

.select2-checkbox-icon.checked {
	background-color: #0d6efd;
	border-color: #0d6efd;
}

.select2-checkbox-icon.checked::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid white;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.select2-checkbox-text {
	flex: 1;
}

/* Style selected options in dropdown using select2's aria-selected attribute */
.select2-results__option[aria-selected="true"] .select2-checkbox-icon {
	background-color: #0d6efd;
	border-color: #0d6efd;
}

.select2-results__option[aria-selected="true"] .select2-checkbox-icon::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid white;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Hover effect for options */
.select2-results__option:hover .select2-checkbox-icon {
	border-color: #0d6efd;
}

.select2-results__option[aria-selected="true"]:hover .select2-checkbox-icon {
	background-color: #0b5ed7;
	border-color: #0b5ed7;
}

/* Ensure checkbox styling works with select2's highlight class */
.select2-results__option--highlighted .select2-checkbox-icon {
	border-color: #0d6efd;
}

.select2-results__option--highlighted[aria-selected="true"] .select2-checkbox-icon {
	background-color: #0b5ed7;
	border-color: #0b5ed7;
}

/* ===== Multiple Image Upload Styling ===== */

/* Image Details Container */
#referralImageDetailsContainer {
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 8px;
    padding: 0rem;
	margin-top: 1rem;
}

/* Individual Image Section */
.referral-image-section {
	background: #ffffff;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 1.5rem;
	margin-bottom: 0rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: all 0.3s ease;
}

.referral-image-section:hover {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.referral-image-section:last-of-type {
	margin-bottom: 0;
}

/* Image Section Header */
.image-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 1rem;
	border-bottom: 2px solid #e9ecef;
}

.image-section-header h6 {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 0;
	color: #495057;
	font-weight: 600;
	font-size: 1rem;
}

.image-section-title {
	color: #212529;
	font-weight: 700;
}

/* Remove Image Section Button */
.remove-image-section {
	background-color: #dc3545;
	border-color: #dc3545;
	color: white;
	padding: 0.35rem 0.8rem;
	font-size: 0.85rem;
	border-radius: 4px;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.remove-image-section:hover {
	background-color: #bb2d3b;
	border-color: #bb2d3b;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.remove-image-section i {
	margin-right: 0rem;
}

/* Cancel Image Section Button */
.cancel-image-section {
	background-color: #6c757d;
	border-color: #6c757d;
	color: white;
	padding: 0.35rem 0.8rem;
	font-size: 0.85rem;
	border-radius: 4px;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.cancel-image-section:hover {
	background-color: #5a6268;
	border-color: #5a6268;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.cancel-image-section i {
	margin-right: 0rem;
}

/* Image Section Divider */
.image-section-divider {
	height: 1px;
	background: linear-gradient(90deg, #e9ecef 0%, transparent 50%, #e9ecef 100%);
	margin-top: 1.5rem;
}

.referral-image-section:last-of-type .image-section-divider {
	display: none;
}

/* Image Preview Styling */
.referral-image-preview {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 1rem;
}

.referral-image-preview label {
	font-weight: 600;
	color: #495057;
	margin-bottom: 0.75rem;
}

.referral-preview-img {
	border-radius: 4px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease;
}

.referral-preview-img:hover {
	transform: scale(1.02);
}

/* Add Another Image Button */
#addImageButtonContainer {
	text-align: center;
	padding-top: 1rem;
}

#addAnotherImageBtn {
	background-color: #ffffff;
	border: 2px solid #0d6efd;
	color: #ffffff;
	font-weight: 600;
	padding: 0.6rem 1.5rem;
	border-radius: 6px;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

#addAnotherImageBtn:hover {
	background-color: #0d6efd;
	color: white;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

#addAnotherImageBtn:active {
	transform: translateY(0);
}

#addAnotherImageBtn i {
	font-size: 1rem;
}

/* Form Controls within Image Sections */
.referral-image-section .form-label {
	font-weight: 600;
	color: #212529;
	margin-bottom: 0.6rem;
}

.referral-image-section .form-control,
.referral-image-section .form-select {
	border: 1px solid #ced4da;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.referral-image-section .form-control:focus,
.referral-image-section .form-select:focus {
	border-color: #0d6efd;
	box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.referral-image-section .form-control.is-invalid,
.referral-image-section .form-select.is-invalid {
	border-color: #dc3545;
}

.referral-image-section .form-control.is-invalid:focus,
.referral-image-section .form-select.is-invalid:focus {
	border-color: #dc3545;
	box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

/* Help Text Styling */
.referralImgHelpText {
	font-size: 0.875rem;
	color: #6c757d;
	margin-top: 0.35rem;
	display: block;
}

/* Animation for new sections */
@keyframes slideInImage {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.referral-image-section.new-section {
	animation: slideInImage 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	#referralImageDetailsContainer {
		padding: 1rem;
	}
	
	.referral-image-section {
		padding: 1rem;
		margin-bottom: 1rem;
	}
	
	.image-section-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}
	
	.image-section-header h6 {
		width: 100%;
	}
	
	.remove-image-section {
		align-self: flex-start;
	}
	
	#addAnotherImageBtn {
		width: 100%;
		justify-content: center;
	}
}