/**
 * Course Popup Styles
 *
 * @package Wdm_Ceasap_Customization
 * @version 1.0.0
 */

/* ==========================================================================
   Popup Overlay
   ========================================================================== */
.ceasap-course-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	padding: 20px;
	box-sizing: border-box;
}

.ceasap-course-popup-overlay.ceasap-course-popup-visible {
	opacity: 1;
	visibility: visible;
}

/* ==========================================================================
   Popup Container
   ========================================================================== */
.ceasap-course-popup {
	font-family: 'Nunito', sans-serif;
	background: #fff;
	border-radius: 8px;
	max-width: 1200px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	transition: opacity 0.3s ease;
}

/* ==========================================================================
   Close Button
   ========================================================================== */
.ceasap-course-popup-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: #dc3545;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: #fff;
	cursor: pointer;
	z-index: 10;
	padding: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	font-weight: bold;
}

.ceasap-course-popup-close:hover {
	background-color: #c82333;
	color: #fff;
	transform: scale(1.1);
}

.ceasap-course-popup-close:focus {
	outline: 2px solid #dc3545;
	outline-offset: 2px;
}

/* ==========================================================================
   Popup Content
   ========================================================================== */
.ceasap-course-popup-content {
	display: flex;
	flex-direction: row;
	gap: 30px;
	padding: 30px;
}

.ceasap-course-popup-left {
	flex: 0 0 40%;
	max-width: 40%;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.ceasap-course-popup-image {
	width: 100%;
	border-radius: 10px;
	overflow: hidden;
}

.ceasap-course-popup-image img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

.ceasap-course-popup-no-image {
	width: 100%;
	height: 200px;
	background-color: #f5f5f5;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	border-radius: 4px;
}

.ceasap-course-popup-right {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* ==========================================================================
   Course Details
   ========================================================================== */
.ceasap-course-popup-name {
	font-size: 28px;
	font-weight: bold;
	margin: 0 0 10px 0;
	color: #333;
	line-height: 1.3;
}

.ceasap-course-popup-datetime-box,
.ceasap-course-popup-details-box {
	background-color: #fff;
	border: 2px solid #0e86d4;
	border-radius: 10px;
	padding: 15px 20px;
	display: flex;
	gap: 15px;
}

.ceasap-course-popup-datetime-box {
	align-items: center;
	margin-bottom: 20px;
}

.ceasap-course-popup-details-box {
	flex-direction: column;
	gap: 12px;
	margin-top: 0;
}

.ceasap-course-popup-datetime-label,
.ceasap-course-popup-detail-label {
	font-size: 16px;
	font-weight: bold;
	color: #0e86d4;
	flex-shrink: 0;
}

.ceasap-course-popup-datetime-value,
.ceasap-course-popup-detail-value {
	font-size: 16px;
	font-weight: bold;
	color: #000;
}

.ceasap-course-popup-detail-item {
	display: flex;
	align-items: center;
	gap: 15px;
}

.ceasap-course-popup-description {
	line-height: 1.6;
	color: #000;
	font-size: 16px;
}

.ceasap-course-popup-description p {
	margin: 0 0 10px 0;
}

.ceasap-course-popup-description p:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Actions
   ========================================================================== */
.ceasap-course-popup-actions {
	margin-top: auto;
	padding-top: 20px;
	display: flex;
	gap: 15px;
	align-items: stretch;
}

.ceasap-course-popup-actions .ceasap-course-popup-view-details-btn:only-child {
	width: 100%;
}

.ceasap-course-popup-bundle-btn,
.ceasap-course-popup-view-details-btn {
	font-size: 18px;
	color: #FFF;
	text-align: center;
	padding: 20px;
	border-radius: 5px;
	transition: all 0.2s ease;
	flex: 1;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: pointer;
}

.ceasap-course-popup-view-details-btn {
	text-decoration: none;
	border: none;
}

.ceasap-course-popup-bundle-icon,
.ceasap-course-popup-external-icon {
	font-size: 24px;
	font-weight: bold;
	line-height: 1;
}

.ceasap-course-popup-bundle-text,
.ceasap-course-popup-view-details-text {
	line-height: 1;
}

.ceasap-course-popup-external-icon {
	font-size: 18px;
	font-weight: bold;
	line-height: 1;
	display: inline-block;
	vertical-align: middle;
}

.ceasap-course-popup-bundle-btn {
	background-color: #0e86d4;
	border: 2px solid transparent;
}

.ceasap-course-popup-bundle-btn.ceasap-add-to-bundle {
	background-color: #0e86d4;
	color: #fff;
	border: 2px solid transparent;
}

.ceasap-course-popup-bundle-btn.ceasap-add-to-bundle:hover {
	background-color: #FFF;
	color: #0e86d4;
	border: 2px solid #0e86d4;
}

.ceasap-course-popup-bundle-btn.ceasap-remove-from-bundle {
	background-color: #dc3545;
	color: #fff;
	border: 2px solid #dc3545;
}

.ceasap-course-popup-bundle-btn.ceasap-remove-from-bundle:hover {
	background-color: #c82333;
	border-color: #bd2130;
}

.ceasap-course-popup-view-details-btn {
	background-color: #0e86d4;
}

.ceasap-course-popup-view-details-btn:hover {
	background-color: #FFF;
	color: #0e86d4;
	border: 2px solid #0e86d4;
	text-decoration: none;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */
.ceasap-course-popup-loader-container {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 200px;
}

.ceasap-course-popup-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid rgba(13, 135, 212, 0.2);
	border-top-color: #0e86d4;
	border-radius: 50%;
	animation: ceasap-spin 0.8s linear infinite;
}

@keyframes ceasap-spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

.ceasap-course-popup-loading,
.ceasap-course-popup-error {
	text-align: center;
	padding: 60px 20px;
	font-size: 18px;
}

.ceasap-course-popup-loading {
	color: #666;
}

.ceasap-course-popup-error {
	color: #dc3232;
}

/* ==========================================================================
   Scrollbar Styling
   ========================================================================== */
.ceasap-course-popup::-webkit-scrollbar {
	width: 8px;
}

.ceasap-course-popup::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.ceasap-course-popup::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 4px;
}

.ceasap-course-popup::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* ==========================================================================
   Responsive Design - Grouped Media Queries
   ========================================================================== */

/* Tablet Layout (992px to 769px) - Keep side-by-side */
@media (max-width: 992px) and (min-width: 769px) {
	.ceasap-course-popup-content {
		padding: 25px;
		gap: 25px;
	}

	.ceasap-course-popup-left {
		flex: 0 0 35%;
		max-width: 35%;
	}

	.ceasap-course-popup-right {
		flex: 1;
	}
}

/* Mobile Layout (768px and below) - Stack vertically */
@media (max-width: 768px) {
	.ceasap-course-popup-overlay {
		padding: 20px 10px;
		align-items: flex-start;
		padding-top: 40px;
	}

	.ceasap-course-popup {
		max-height: calc(100vh - 80px);
		margin-top: 0;
	}

	.ceasap-course-popup-content {
		display: grid;
		grid-template-columns: 1fr;
		padding: 20px;
		gap: 20px;
	}

	.ceasap-course-popup-left {
		flex: 1;
		max-width: 100%;
		display: contents;
	}

	.ceasap-course-popup-image {
		order: 1;
		margin-bottom: 0;
		width: 100%;
	}

	.ceasap-course-popup-details-box {
		order: 4;
		margin-top: 0;
		width: 100%;
	}

	.ceasap-course-popup-right {
		flex: 1;
		display: contents;
	}

	.ceasap-course-popup-name {
		font-size: 24px;
		order: 2;
		margin: 0 0 15px 0;
	}

	.ceasap-course-popup-datetime-box {
		order: 3;
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
		margin-bottom: 0;
	}

	.ceasap-course-popup-description {
		order: 5;
		margin-top: 0;
	}

	.ceasap-course-popup-actions {
		order: 6;
		margin-top: 0;
		padding-top: 0;
		flex-direction: column;
	}
}
