/* =============================================================================
   Service Details Modal Styles
   ============================================================================= */

/* Modal CSS Variables */
:root {
	--modal-z-index: 9999;
	--modal-overlay-bg: rgba(0, 0, 0, 0.5);
	--modal-border-radius: 12px;
	--modal-max-width: 800px;
	--modal-animation-duration: 0.3s;
	--modal-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Modal Overlay */
.service-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--modal-overlay-bg);
	z-index: var(--modal-z-index);
	overflow-y: auto;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity var(--modal-animation-duration) ease;
}

.service-modal.active {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 1;
}

.service-modal.opening {
	opacity: 1;
}

.service-modal.closing {
	opacity: 0;
}

/* Modal Content Container */
.service-modal-content {
	background: white;
	border-radius: var(--modal-border-radius);
	max-width: var(--modal-max-width);
	width: 100%;
	max-height: 90vh;
	overflow: hidden;
	position: relative;
	box-shadow: var(--modal-shadow);
	transform: translateY(50px) scale(0.95);
	transition: all var(--modal-animation-duration) cubic-bezier(0.4, 0, 0.2, 1);
	border: 1px solid #e5e7eb;
}

.service-modal.active .service-modal-content {
	transform: translateY(0) scale(1);
}

.service-modal.opening .service-modal-content {
	animation: modalSlideIn var(--modal-animation-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.service-modal.closing .service-modal-content {
	animation: modalSlideOut var(--modal-animation-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Modal Animations */
@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(50px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes modalSlideOut {
	from {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	to {
		opacity: 0;
		transform: translateY(-30px) scale(0.95);
	}
}

/* Modal Header */
.service-modal-header {
	padding: 2rem 2rem 1rem;
	border-bottom: 1px solid #e5e7eb;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	position: relative;
}

.service-modal-header::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

.service-modal-title {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 700;
	color: #1f2937;
	line-height: 1.3;
	flex: 1;
	gap: 0.5rem;
	display: flex;
	align-items: center;
}

.service-modal-close {
	background: none;
	border: none;
	color: #6b7280;
	font-size: 1.5rem;
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 50%;
	transition: all 0.3s ease;
	width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
}

.service-modal-close:hover {
	background: #f3f4f6;
	color: #374151;
	transform: rotate(90deg);
}

.service-modal-close:focus {
	outline: none !important;
	outline-offset: 2px;
}

/* Modal Body */
.service-modal-body {
	padding: 2rem;
	overflow-y: auto;
	max-height: calc(90vh - 200px);
}

.service-modal-image {
	margin-bottom: 2rem;
	text-align: center;
}

.service-modal-image img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-modal-description {
	margin-bottom: 2rem;
	color: #6b7280;
	line-height: 1.7;
	font-size: 1.1rem;
}

.service-modal-description h3 {
	margin-top: 0rem;
}

.service-modal-features {
	margin-bottom: 2rem;
}

.service-modal-features h4 {
	margin: 0 0 1rem 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: #1f2937;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.service-modal-features h4 i {
	color: #3b82f6;
	font-size: 1rem;
}

.service-modal-features ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.service-modal-features li {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	transition: all 0.3s ease;
}

.service-modal-features li:hover {
	background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
	border-color: #cbd5e1;
	transform: translateX(4px);
}

.service-modal-features li i {
	color: #10b981;
	font-size: 1rem;
	flex-shrink: 0;
	width: 1.25rem;
	text-align: center;
}

/* Modal Info Section */
.service-modal-info {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
	padding: 1.5rem;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	border-radius: 8px;
	border: 1px solid #e5e7eb;
}

.service-modal-price,
.service-modal-areas,
.service-modal-duration {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.service-modal-price h5,
.service-modal-areas h5,
.service-modal-duration h5 {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.service-modal-price .price-value,
.service-modal-duration .duration-value {
	font-size: 1.25rem;
	font-weight: 700;
	color: #1f2937;
}

.service-modal-areas .areas-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.areas-tags {
	gap: 0.1rem;
	display: flex;
	flex-wrap: wrap;
}

.service-modal-areas .area-tag {
	background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
	color: white;
	padding: 0.25rem 0.75rem;
	border-radius: 15px;
	font-size: 0.8rem;
	font-weight: 500;
	text-wrap: nowrap;
}
.service-modal-areas .area-tag  {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.08), rgba(71, 85, 105, 0.06));
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.2);
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: inline-block;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    line-height: 1.3;
    margin: 0.125rem 0.25rem 0.125rem 0;
    max-width: calc(100% - 0.5rem);
    box-sizing: border-box;
    word-wrap: break-word;
    text-overflow: ellipsis;
}

.service-modal-areas .area-tag:hover {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.12), rgba(71, 85, 105, 0.1));
    border-color: rgba(100, 116, 139, 0.3);
    color: #334155;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.15);
}

/* Modal Footer */
.service-modal-footer {
	padding: 1.5rem 2rem 2rem;
	border-top: 1px solid #e5e7eb;
	display: flex;
	gap: 1rem;
	justify-content: flex-end;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	position: relative;
}

.service-modal-footer::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

.service-modal-btn {
	padding: 0.875rem 1.75rem;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	transition: all 0.3s ease;
	cursor: pointer;
	border: none;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	position: relative;
	overflow: hidden;
}

.service-modal-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	transition: left 0.5s;
}

.service-modal-btn:hover::before {
	left: 100%;
}

.service-modal-btn-primary {
	background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
	color: white !important;
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.service-modal-btn-primary:hover {
	background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
	color: white !important;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.service-modal-btn-secondary {
	background: white;
	color: #6b7280 !important;
	border: 2px solid #e5e7eb;
}

.service-modal-btn-secondary:hover {
	background: #f8fafc;
	color: #374151 !important; 
	border-color: #d1d5db;
	transform: translateY(-1px);
}

/* Modal Loading State */
.service-modal-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4rem 2rem;
	text-align: center;
}

.service-modal-loading .loading-spinner {
	margin-bottom: 1.5rem;
}

.service-modal-loading .loading-spinner i {
	font-size: 2.5rem;
	color: #3b82f6;
	animation: spin 1s linear infinite;
}

.service-modal-loading .loading-text {
	font-size: 1.1rem;
	color: #6b7280;
	margin: 0;
}

/* Modal Error State */
.service-modal-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4rem 2rem;
	text-align: center;
}

.service-modal-error .error-icon {
	margin-bottom: 1.5rem;
}

.service-modal-error .error-icon i {
	font-size: 3rem;
	color: #ef4444;
}

.service-modal-error .error-message {
	font-size: 1.1rem;
	color: #6b7280;
	margin-bottom: 2rem;
	line-height: 1.6;
}

.service-modal-error .error-retry-btn {
	background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
	color: white;
	border: none;
	padding: 0.875rem 1.75rem;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
}

.service-modal-error .error-retry-btn:hover {
	background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
	transform: translateY(-2px);
}

/* Prevent Background Scroll */
body.modal-open {
	overflow: hidden;
	padding-right: var(--scrollbar-width, 0);
}

/* =============================================================================
   Modal Responsive Design
   ============================================================================= */

/* Tablet Styles */
@media (max-width: 768px) {
	.service-modal {
		padding: 0.5rem;
	}
	
	.service-modal-content {
		max-height: 95vh;
		border-radius: 8px;
	}
	
	.service-modal-header {
		padding: 1.5rem 1.5rem 1rem;
	}
	
	.service-modal-title {
		font-size: 1.5rem;
	}
	
	.service-modal-body {
		padding: 1.5rem;
		max-height: calc(95vh - 180px);
	}
	
	.service-modal-footer {
		padding: 1rem 1.5rem 1.5rem;
		flex-direction: column;
	}
	
	.service-modal-btn {
		width: 100%;
		justify-content: center;
	}
	
	.service-modal-info {
		grid-template-columns: 1fr;
		gap: 1rem;
		padding: 1rem;
	}
}

/* Mobile Styles */
@media (max-width: 480px) {
	.service-modal {
		padding: 0;
		align-items: flex-end;
	}
	
	.service-modal-content {
		max-height: 90vh;
		border-radius: 16px 16px 0 0;
		width: 100%;
		max-width: none;
	}
	
	.service-modal.active .service-modal-content {
		animation: modalSlideUp var(--modal-animation-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
	}
	
	.service-modal-header {
		padding: 1rem 1rem 0.75rem;
		position: relative;
	}
	
	.service-modal-header::before {
		content: '';
		position: absolute;
		top: 0.5rem;
		left: 50%;
		transform: translateX(-50%);
		width: 40px;
		height: 4px;
		background: #d1d5db;
		border-radius: 2px;
	}
	
	.service-modal-title {
		font-size: 1.25rem;
		margin-top: 1rem;
	}
	
	.service-modal-close {
		width: 2rem;
		height: 2rem;
		font-size: 1.25rem;
	}
	
	.service-modal-body {
		padding: 1rem;
		max-height: calc(90vh - 160px);
	}
	
	.service-modal-footer {
		padding: 1rem;
	}
	
	.service-modal-features ul {
		gap: 0.5rem;
	}
	
	.service-modal-features li {
		padding: 0.75rem;
		font-size: 0.9rem;
	}
}

/* Mobile Slide Up Animation */
@keyframes modalSlideUp {
	from {
		transform: translateY(100%);
	}
	to {
		transform: translateY(0);
	}
}

/* Enhanced Touch Interaction Support */
@media (max-width: 768px) {
	.service-modal-content {
		/* Add touch-friendly scrolling */
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}
	
	.service-modal-body {
		/* Improve touch scrolling performance */
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-y: contain;
	}
	
	/* Enhanced touch targets */
	.service-modal-close,
	.service-modal-btn {
		min-height: 44px;
		min-width: 44px;
	}
	
	/* Improved tap highlighting */
	.service-modal-btn,
	.service-modal-close {
		-webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
		tap-highlight-color: rgba(59, 130, 246, 0.2);
	}
}

/* Enhanced Mobile Modal Gestures */
@media (max-width: 480px) {
	.service-modal-content {
		/* Add swipe indicator */
		position: relative;
	}
	
	.service-modal-header::before {
		/* Swipe handle */
		content: '';
		position: absolute;
		top: 0.5rem;
		left: 50%;
		transform: translateX(-50%);
		width: 40px;
		height: 4px;
		background: #d1d5db;
		border-radius: 2px;
		cursor: grab;
	}
	
	.service-modal-header::before:active {
		cursor: grabbing;
	}
	
	/* Optimize for one-handed use */
	.service-modal-footer {
		padding-bottom: calc(1rem + env(safe-area-inset-bottom));
	}
	
	/* Improve readability on small screens */
	.service-modal-title {
		font-size: 1.125rem;
		line-height: 1.4;
	}
	
	.service-modal-description {
		font-size: 1rem;
		line-height: 1.6;
	}
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
	.service-modal {
		background: rgba(0, 0, 0, 0.8);
	}
	
	.service-modal-content {
		border: 2px solid #000;
	}
	
	.service-modal-btn-primary {
		background: #000;
		border: 2px solid #000;
	}
	
	.service-modal-btn-secondary {
		border: 2px solid #000;
		color: #000;
	}
}

/* Reduced Motion Support for Modal */
@media (prefers-reduced-motion: reduce) {
	.service-modal,
	.service-modal-content,
	.service-modal-btn,
	.service-modal-features li {
		transition: none;
		animation: none;
	}
	
	.service-modal-close:hover {
		transform: none;
	}
	
	@keyframes modalSlideIn {
		from, to {
			opacity: 1;
			transform: translateY(0) scale(1);
		}
	}
	
	@keyframes modalSlideOut {
		from, to {
			opacity: 0;
			transform: translateY(0) scale(1);
		}
	}
	
	@keyframes modalSlideUp {
		from, to {
			transform: translateY(0);
		}
	}
}
/*
 Enhanced Error States */
.service-modal-error,
.service-modal-offline,
.service-modal-reconnecting,
.service-modal-checking,
.service-modal-success,
.service-modal-fallback-error {
	text-align: center;
	padding: 2rem;
	min-height: 200px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

/* Error Icons */
.service-modal-error .error-icon,
.service-modal-offline .offline-icon,
.service-modal-reconnecting .reconnect-icon,
.service-modal-checking .checking-icon,
.service-modal-success .success-icon {
	font-size: 3rem;
	margin-bottom: 1rem;
	animation: pulse 2s infinite;
}

.service-modal-error .error-icon i {
	color: #dc3545;
}

.service-modal-offline .offline-icon i {
	color: #6c757d;
}

.service-modal-reconnecting .reconnect-icon i {
	color: #17a2b8;
}

.service-modal-checking .checking-icon i {
	color: #ffc107;
}

.service-modal-success .success-icon i {
	color: #28a745;
}

/* Error Content */
.service-modal-error .error-content,
.service-modal-offline .offline-content,
.service-modal-reconnecting .reconnect-content,
.service-modal-checking .checking-content,
.service-modal-success .success-content {
	max-width: 400px;
}

.service-modal-error .error-title,
.service-modal-offline .offline-title,
.service-modal-reconnecting .reconnect-title,
.service-modal-checking .checking-title,
.service-modal-success .success-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 0.75rem;
	color: #333;
}

.service-modal-error .error-message,
.service-modal-offline .offline-message,
.service-modal-reconnecting .reconnect-message,
.service-modal-checking .checking-message,
.service-modal-success .success-message {
	font-size: 1rem;
	color: #6c757d;
	margin-bottom: 1.5rem;
	line-height: 1.5;
}

/* Error Actions */
.service-modal-error .error-actions,
.service-modal-offline .offline-actions,
.service-modal-success .success-actions {
	display: flex;
	gap: 0.75rem;
	justify-content: center;
	flex-wrap: wrap;
	margin-top: 1rem;
}

/* Error Type Specific Styles */
.service-modal-error.network-error .error-icon i {
	color: #6c757d;
}

.service-modal-error.timeout-error .error-icon i {
	color: #ffc107;
}

.service-modal-error.server-error .error-icon i {
	color: #dc3545;
}

.service-modal-error.security-error .error-icon i {
	color: #fd7e14;
}

/* Fallback Error */
.service-modal-fallback-error {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	padding: 2rem;
	margin: 1rem;
}

.service-modal-fallback-error h3 {
	color: #dc3545;
	margin-bottom: 1rem;
}

.service-modal-fallback-error p {
	color: #6c757d;
	margin-bottom: 0.75rem;
}

.service-modal-fallback-error a {
	color: #007bff;
	text-decoration: underline;
}

.service-modal-fallback-error button {
	background: #007bff;
	color: white;
	border: none;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	cursor: pointer;
	margin-top: 1rem;
}

.service-modal-fallback-error button:hover {
	background: #0056b3;
}

/* Enhanced Animations */
@keyframes pulse {
	0% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
	100% {
		opacity: 1;
	}
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.fa-spin {
	animation: spin 1s linear infinite;
}

.fa-pulse {
	animation: pulse 1s linear infinite;
}

.fa-beat {
	animation: beat 1s ease-in-out infinite;
}

@keyframes beat {
	0%, 90% {
		transform: scale(1);
	}
	45% {
		transform: scale(1.1);
	}
}

/* Responsive Error States */
@media (max-width: 768px) {
	.service-modal-error,
	.service-modal-offline,
	.service-modal-reconnecting,
	.service-modal-checking,
	.service-modal-success {
		padding: 1.5rem 1rem;
		min-height: 150px;
	}
	
	.service-modal-error .error-icon,
	.service-modal-offline .offline-icon,
	.service-modal-reconnecting .reconnect-icon,
	.service-modal-checking .checking-icon,
	.service-modal-success .success-icon {
		font-size: 2.5rem;
	}
	
	.service-modal-error .error-actions,
	.service-modal-offline .offline-actions,
	.service-modal-success .success-actions {
		flex-direction: column;
		align-items: center;
	}
	
	.service-modal-error .error-actions .service-modal-btn,
	.service-modal-offline .offline-actions .service-modal-btn,
	.service-modal-success .success-actions .service-modal-btn {
		width: 100%;
		max-width: 200px;
	}
}

/* Loading State Enhancements */
.service-modal-loading {
	text-align: center;
	padding: 3rem 2rem;
	min-height: 200px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.service-modal-loading .loading-spinner {
	font-size: 2.5rem;
	color: #007bff;
	margin-bottom: 1.5rem;
}

.service-modal-loading .loading-text {
	font-size: 1.1rem;
	color: #6c757d;
	margin: 0;
}

/* Message Styles for General Notifications */
.errand-message {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	margin: 1rem 0;
	border-radius: 8px;
	font-size: 0.95rem;
	line-height: 1.4;
	position: relative;
	animation: slideInDown 0.3s ease-out;
}

.errand-message.error {
	background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
	border: 1px solid #f87171;
	color: #dc2626;
}

.errand-message.success {
	background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
	border: 1px solid #4ade80;
	color: #16a34a;
}

.errand-message i {
	font-size: 1.1rem;
	flex-shrink: 0;
}

.errand-message-close {
	background: none;
	border: none;
	font-size: 1.25rem;
	cursor: pointer;
	color: inherit;
	opacity: 0.7;
	margin-left: auto;
	padding: 0;
	line-height: 1;
}

.errand-message-close:hover {
	opacity: 1;
}

@keyframes slideInDown {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}