/**
 * Space Availability Table Widget Styles
 */

/* Container */
.space-availability-widget {
	width: 100%;
	overflow-x: auto;
	margin: 20px 0;
}

/* Table Base */
.space-availability-table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
}

/* Table Header */
.space-availability-table thead {
	background-color: #2B8A8E;
	border-bottom-width: 3px;
	border-bottom-style: solid;
	border-bottom-color: #FF8C5A;
}

.space-availability-table thead th {
	padding: 16px 20px;
	text-align: center;
	font-weight: 600;
	font-size: 1.38rem;
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
	letter-spacing: 0.5px;
	text-transform: uppercase;
    border: 1px solid #fff;
	color: #FFFFFF;
}

/* Table Body */
.space-availability-table tbody tr {
	transition: background-color 0.2s ease;
}

.space-availability-table tbody tr:nth-child(odd) {
	background-color: #FFF9F5;
}

.space-availability-table tbody tr:nth-child(even) {
	background-color: #F0F8FF;
}

.space-availability-table tbody tr:hover {
	background-color: #E8F4F8 !important;
}

.space-availability-table tbody td {
	padding: 14px 20px;
	color: #333333;
	font-size: 1.125rem;
    text-align: center;
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
	vertical-align: middle;
	border: 1px solid #fff;
}

/* View Image Link */
.view-image-link {
	display: inline-flex;
    gap: 9px;
	align-items: center;
	color: #087E95;
	text-decoration: none;
	border-radius: 4px;
	font-size: 1.125rem;
	font-weight: 500;
	transition: all 0.3s ease;
	border: none;
	cursor: pointer;
}

.view-image-link svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* Lightbox */
.space-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
}

.space-lightbox.active {
	display: flex;
}

.lightbox-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #08080898;
	cursor: pointer;
}

.lightbox-content {
	position: relative;
	z-index: 1000000;
	max-width: 90vw;
	max-height: 90vh;
    min-height: 800px;
	display: flex;
	align-items: center;
	justify-content: center;
    box-shadow: 0px 3px 20px #0000006C;
    border-radius: 29px;
    padding: 20px;
    background-color: #fff;
	opacity: 0;
	transform: translateY(-20px);
}

.space-lightbox.active .lightbox-content {
	animation: fadeInDown 0.4s ease forwards;
}

.space-lightbox.closing .lightbox-content {
	animation: fadeOutUp 0.3s ease forwards;
}

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

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

.lightbox-image {
	max-width: 100%;
	max-height: 90vh;
	height: auto;
	width: 100%;
	object-fit: contain;
    border-radius: 29px !important;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.space-lightbox:not(.loading) .lightbox-image {
	opacity: 1;
}

/* Loading Spinner */
.space-lightbox.loading::before {
	content: '';
	position: absolute;
	width: 50px;
	height: 50px;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top-color: #2B8A8E;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	z-index: 1000001;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    padding: 0 !important;
    width: 55px;
    height: 55px;
    font-size: 45px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    z-index: 1000001;
    background-color: #000 !important;
    border: none !important;
    border-radius: 50% !important;
}

/* Responsive Design */
@media (max-width: 768px) {
	.space-availability-table {
		font-size: 14px;
	}
	
	.space-availability-table thead th,
	.space-availability-table tbody td {
		padding: 12px 10px;
		font-size: 13px;
	}
	
	.view-image-link {
		padding: 6px 10px;
		font-size: 12px;
	}
	
	.view-image-link svg {
		width: 14px;
		height: 14px;
	}
	
	.lightbox-close {
		top: 10px;
		right: 10px;
		font-size: 32px;
	}
}

@media (max-width: 480px) {
	.space-availability-widget {
		margin: 10px -15px;
	}
	
	.space-availability-table thead th,
	.space-availability-table tbody td {
		padding: 10px 8px;
		font-size: 12px;
	}
	
	.view-image-link {
		padding: 5px 8px;
		font-size: 11px;
		gap: 4px;
	}
}
