﻿html {
	scrollbar-gutter: stable;
}

body.modal-open {
	overflow: hidden;
}

.doctor-modal {
	display: none !important;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	align-items: center;
	justify-content: center;
	background: transparent;
	padding: 0;
	margin: 0;
	border: none;
}

.doctor-modal.active {
	display: flex !important;
}

.doctor-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(35, 34, 34, 0.4);
	z-index: 1;
}

.doctor-modal-content {
	position: relative;
	background: white;
	border-radius: 20px;
	max-width: 1000px;
	padding: 40px 40px 53px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: modalSlideIn 0.3s ease;
	z-index: 2;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: transparent;
	z-index: 10;
}

.modal-close svg {
	width: 16px;
	height: 16px;
}

.modal-body {
	display: grid;
	grid-template-columns: 408fr 464fr;
	align-items: center;
	gap: 48px;
}

.modal-image {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
	border-radius: 20px;
}

.modal-image > #doctorModalPhoto {
	width: 100%;
	height: auto;
	aspect-ratio: 408 / 516;
	border-radius: 8px;
	object-fit: cover;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-image-note {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 20px;
	background: rgba(79, 159, 70, 1);
	color: rgba(255, 255, 255, 1);
	font-family: Rubik;
	font-weight: 400;
	font-size: 18px;
	line-height: 26px;
	letter-spacing: 0%;
	text-align: center;
}

.modal-info {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}

.modal-info h2 {
	margin: 0 0 20px;
	font-weight: 700;
	font-style: Bold;
	font-size: 40px;
	line-height: 120%;
	letter-spacing: 0%;
}

.modal-info .position {
	color: rgba(25, 156, 219, 1);
	font-weight: 700;
	font-size: 16px;
	margin: 0 0 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.modal-info .specialization {
	color: rgba(35, 34, 34, 1);
	font-weight: 400;
	font-size: 16px;
	line-height: 150%;
	letter-spacing: 0%;
	margin: 0;
}

.modal-info .description {
	color: rgba(35, 34, 34, 1);
	line-height: 1.8;
	font-size: 16px;
	word-wrap: break-word;
	margin: 20px 0;
	max-height: min(40vh, 360px);
	overflow-y: auto;
	padding-right: 12px;
	scrollbar-width: thin;
	overscroll-behavior: contain;
}

.modal-info .description::-webkit-scrollbar {
	width: 8px;
}

.modal-info .description::-webkit-scrollbar-track {
	background: rgba(241, 244, 246, 1);
	border-radius: 999px;
}

.modal-info .description::-webkit-scrollbar-thumb {
	background: rgba(25, 156, 219, 0.5);
	border-radius: 999px;
}

.modal-info .description p {
	margin: 0 0 14px;
}

.modal-info .description ul {
	margin: 0;
	padding: 24px 24px 24px 44px;
	border-radius: 20px;
	background-color: rgba(241, 244, 246, 1);
	list-style: disc;
}

.modal-info .description ul + ul {
	margin-top: 12px;
}

.modal-info .description ul li {
	margin: 0 0 6px;
	padding: 0;
}

.modal-info .description .doctor-documents-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-top: 16px;
}

.modal-info .description .doctor-documents-grid img {
	width: 100%;
	max-width: 100%;
	margin: 0;
}

.modal-info .description img {
	display: block;
	width: min(100%, 230px);
	max-width: 100%;
	max-height: 300px;
	height: auto;
	aspect-ratio: auto;
	object-fit: contain;
	background: rgba(241, 244, 246, 1);
	border: 1px solid rgba(35, 34, 34, 0.08);
	border-radius: 14px;
	padding: 8px;
	margin: 14px 0;
	cursor: zoom-in;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.certificate-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100001;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.certificate-modal.active {
	display: flex;
}

.certificate-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(35, 34, 34, 0.4);
}

.certificate-modal-content {
	position: relative;
	z-index: 2;
	max-width: min(92vw, 1100px);
	max-height: 92vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.certificate-modal-content img {
	max-width: 100%;
	max-height: 92vh;
	width: 92vh;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
	box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.certificate-modal-close {
	position: fixed;
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.6);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 3;
}

.certificate-modal-close svg {
	width: 16px;
	height: 16px;
}

#experts .doctor-card-item {
	cursor: pointer;
}

#experts .doctor-card-item .staff-card {
	transition: transform 0.3s ease;
}

@media (max-width: 992px) {
	.doctor-modal-content {
		width: 100%;
		max-width: 100%;
		margin: 0;
		top: 94px;
		border-radius: 16px 16px 0 0;
		max-height: 90vh;
	}

	.doctor-modal {
		align-items: flex-end;
		padding: 0;
	}

	.modal-body {
		grid-template-columns: 1fr;
		justify-items: center;
		gap: 20px;
		margin: 0 0 80px;
	}

	.modal-image {
		order: -1;
		max-width: 480px;
		aspect-ratio: 408 / 516;
	}

	.modal-info h2 {
		font-size: 24px;
	}

	.modal-info .description {
		max-height: none;
		overflow: visible;
		padding-right: 0;
	}

	.modal-close {
		top: 15px;
		right: 15px;
		width: 36px;
		height: 36px;
	}
}

@media (max-width: 480px) {
	.modal-close {
		display: none;
	}

	.doctor-modal-content {
		padding: 20px;
	}

	.modal-info .description img {
		width: min(100%, 180px);
		max-height: 240px;
	}

	.modal-info .description .doctor-documents-grid {
		grid-template-columns: 1fr;
	}

	.certificate-modal {
		padding: 12px;
	}

	.certificate-modal-close {
		top: 12px;
		right: 12px;
	}
}
