/**
 * Lightweight WooEdu - Schedule & DP Styles
 *
 * Styling for:
 * - Frontend schedule selector
 * - Admin schedule manager
 * - Cart/checkout display
 * - Email display
 * - DP (Down Payment) notice on product page
 *
 * @package Lightweight_WooEdu
 * @since 2.2.27
 */

/* ==========================================================================
   Frontend Schedule Selector
   IMPORTANT: Force explicit colors on ALL elements to prevent theme
   inheritance issues (e.g. dark theme with black text on black bg).
   ========================================================================== */

.wooedu-schedule-selector {
	margin: 20px 0;
	padding: 20px;
	background: #ffffff !important;
	border-radius: 8px;
	border: 1px solid #d0d5dd !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wooedu-schedule-selector * {
	color: inherit;
}

.wooedu-schedule-selector label {
	display: block;
	font-weight: 700;
	margin-bottom: 10px;
	font-size: 15px;
	color: #1a1a2e !important;
	opacity: 1 !important;
	text-shadow: none !important;
}

.wooedu-schedule-selector label .dashicons {
	color: #2271b1 !important;
	vertical-align: middle;
}

.wooedu-schedule-selector label .required {
	color: #d63638 !important;
	font-weight: 700;
}

.wooedu-schedule-selector select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #8c8f94 !important;
	border-radius: 6px;
	font-size: 14px;
	background: #ffffff !important;
	color: #1a1a2e !important;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	-webkit-appearance: menulist;
	appearance: menulist;
}

.wooedu-schedule-selector select option {
	background: #ffffff !important;
	color: #1a1a2e !important;
	padding: 8px;
}

.wooedu-schedule-selector select option:disabled {
	color: #999999 !important;
}

.wooedu-schedule-selector select:focus {
	border-color: #2271b1 !important;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
	outline: none;
}

.wooedu-schedule-selector select.wooedu-schedule-available {
	border-color: #28a745 !important;
}

.wooedu-schedule-selector select.wooedu-schedule-full {
	border-color: #d63638 !important;
}

.wooedu-schedule-selector select.wooedu-error {
	border-color: #d63638 !important;
	box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1);
}

.wooedu-schedule-selector .wooedu-schedule-info {
	margin: 10px 0 0 0;
	font-size: 12px;
	color: #555555 !important;
}

.wooedu-schedule-selector .wooedu-schedule-info strong {
	color: #333333 !important;
}

/* Availability Messages */
.wooedu-availability-message {
	margin: 10px 0 0 0;
	padding: 10px;
	border-radius: 4px;
	font-size: 13px;
	color: #155724 !important;
	background: #d4edda !important;
}

.wooedu-error-message {
	margin: 10px 0 0 0;
	padding: 10px;
	background: #f8d7da !important;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	font-size: 13px;
	color: #721c24 !important;
}

/* ==========================================================================
   Cart & Checkout Display
   ========================================================================== */

.wooedu-schedule-checkout {
	font-size: 12px;
	color: #555 !important;
	margin-top: 5px;
	padding: 5px 10px;
	background: #e7f3ff !important;
	border-radius: 4px;
	display: inline-block;
}

.wooedu-schedule-checkout strong {
	color: #2271b1 !important;
}

/* ==========================================================================
   Admin Schedule Manager
   ========================================================================== */

.wooedu-schedule-group {
	border-top: 1px solid #eee;
}

.wooedu-schedule-group .wooedu-section-title {
	padding: 15px 12px 10px;
	margin: 0;
	border-bottom: 1px solid #eee;
	font-size: 13px;
	font-weight: 600;
	color: #23282d;
}

.wooedu-schedule-group .wooedu-section-title .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	vertical-align: text-bottom;
	margin-right: 5px;
}

.wooedu-schedule-field {
	padding: 10px 12px;
	display: none;
}

.wooedu-schedule-item {
	background: #f6f7f7;
	padding: 15px;
	margin-bottom: 10px;
	border-radius: 4px;
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	transition: all 0.3s ease;
}

.wooedu-schedule-item:hover {
	background: #eef0f2;
}

.wooedu-schedule-item select,
.wooedu-schedule-item input {
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 8px;
	font-size: 13px;
}

.wooedu-schedule-item select {
	width: 140px;
}

.wooedu-schedule-item input[type="time"] {
	width: 120px;
}

.wooedu-schedule-item input[type="number"] {
	width: 80px;
	text-align: center;
}

.wooedu-schedule-item input[type="text"] {
	flex: 1;
	min-width: 150px;
}

.wooedu-schedule-item .button {
	padding: 6px 10px;
	height: auto;
	line-height: 1.4;
}

.wooedu-schedule-item .wooedu-remove-schedule {
	color: #d63638;
}

.wooedu-schedule-item .wooedu-remove-schedule:hover {
	background: #d63638;
	color: #fff;
	border-color: #d63638;
}

#wooedu-add-schedule {
	margin-top: 10px;
}

#wooedu-add-schedule .dashicons {
	vertical-align: middle;
}

/* Field Errors */
.wooedu-field-error {
	font-size: 12px;
	margin-left: 5px;
	display: inline-block;
}

/* ==========================================================================
   Order Details Display
   ========================================================================== */

.woocommerce-order-details .wooedu-schedule-info,
.woocommerce-table--order-details .wooedu-schedule-info {
	display: inline-block;
	padding: 5px 10px;
	background: #e7f3ff;
	border-radius: 4px;
	margin-top: 5px;
	font-size: 13px;
}

/* ==========================================================================
   Email Display
   ========================================================================== */

.wooedu-schedule-email {
	margin: 10px 0;
	padding: 12px;
	background: #e7f3ff;
	border-left: 4px solid #2271b1;
	border-radius: 4px;
}

.wooedu-schedule-email strong {
	color: #2271b1;
	font-size: 14px;
}

/* ==========================================================================
   DP (Down Payment) Notice - Product Page
   ========================================================================== */

.wooedu-dp-notice {
	margin: 20px 0;
	padding: 0;
	background: #ffffff !important;
	border: 1px solid #d0d5dd;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wooedu-dp-notice__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	background: linear-gradient(135deg, #1a3fa8 0%, #2271b1 60%, #1e8bd8 100%) !important;
	color: #ffffff !important;
}

.wooedu-dp-notice__icon {
	font-size: 20px;
	line-height: 1;
}

.wooedu-dp-notice__title {
	font-size: 15px;
	font-weight: 700;
	color: #ffffff !important;
	letter-spacing: 0.3px;
}

.wooedu-dp-notice__body {
	padding: 0;
}

.wooedu-dp-notice__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f0;
}

.wooedu-dp-notice__row:last-child {
	border-bottom: none;
}

.wooedu-dp-notice__label {
	font-size: 13px;
	color: #555555 !important;
	font-weight: 500;
}

.wooedu-dp-notice__value {
	font-size: 14px;
	font-weight: 600;
	color: #1a1a2e !important;
	text-align: right;
}

/* Full price: strikethrough */
.wooedu-dp-notice__full-price {
	text-decoration: line-through;
	color: #999999 !important;
	font-weight: 400;
}

/* DP price: highlight (Biaya Pendaftaran) — row pertama, tanpa border-top */
.wooedu-dp-notice__row--highlight {
	background: linear-gradient(135deg, #e8f4fd 0%, #dbeeff 100%) !important;
	padding: 16px 18px;
	border-bottom: 1px solid #c2dcf5;
}

.wooedu-dp-notice__row--highlight .wooedu-dp-notice__label {
	color: #1e6bb8 !important;
	font-weight: 700;
	font-size: 14px;
}

.wooedu-dp-notice__dp-price {
	color: #1e4fa8 !important;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.5px;
}

.wooedu-dp-notice__dp-price .woocommerce-Price-currencySymbol {
	font-size: 16px;
	font-weight: 700;
	vertical-align: super;
}

/* Sisa Pelunasan row */
.wooedu-dp-notice__row--savings {
	background: #fffbeb !important;
	padding: 12px 18px;
	border-bottom: none;
	border-top: 1px solid #fde68a;
}

.wooedu-dp-notice__row--savings .wooedu-dp-notice__label {
	color: #92400e !important;
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.wooedu-dp-notice__savings {
	color: #b45309 !important;
	font-size: 15px;
	font-weight: 700;
}

/* Note */
.wooedu-dp-notice__note {
	padding: 12px 18px;
	background: #fefcf3 !important;
	border-top: 1px solid #f0ecdc;
	font-size: 13px;
	line-height: 1.5;
	color: #6b5900 !important;
}

.wooedu-dp-notice__note a {
	color: #1e6bb8 !important;
	text-decoration: underline;
}

.wooedu-dp-notice__note strong,
.wooedu-dp-notice__note b {
	color: #4a3d00 !important;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.wooedu-schedule-selector {
		padding: 15px;
		margin: 15px 0;
	}

	.wooedu-schedule-selector select {
		font-size: 16px;
		/* Prevent iOS zoom */
	}

	.wooedu-schedule-item {
		flex-direction: column;
		align-items: stretch;
	}

	.wooedu-schedule-item select,
	.wooedu-schedule-item input {
		width: 100% !important;
		min-width: 0 !important;
	}

	.wooedu-schedule-item .button {
		width: 100%;
	}

	/* DP Notice Mobile */
	.wooedu-dp-notice {
		margin: 15px 0;
	}

	.wooedu-dp-notice__header {
		padding: 12px 14px;
	}

	.wooedu-dp-notice__body {
		padding: 12px 14px;
	}

	.wooedu-dp-notice__row {
		flex-direction: column;
		align-items: flex-start;
		gap: 2px;
		padding: 6px 0;
	}

	.wooedu-dp-notice__row--highlight,
	.wooedu-dp-notice__row--savings {
		padding: 12px 14px;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.wooedu-dp-notice__value {
		text-align: left;
	}

	.wooedu-dp-notice__row--highlight .wooedu-dp-notice__value,
	.wooedu-dp-notice__row--savings .wooedu-dp-notice__value {
		text-align: right;
	}

	.wooedu-dp-notice__note {
		padding: 10px 14px;
		font-size: 12px;
	}
}

@media (max-width: 480px) {
	.wooedu-dp-notice__title {
		font-size: 14px;
	}

	.wooedu-dp-notice__dp-price {
		font-size: 22px;
	}

	.wooedu-dp-notice__savings {
		font-size: 13px;
	}
}

/* ==========================================================================
   Print Styles (for emails)
   ========================================================================== */

@media print {
	.wooedu-schedule-email {
		border: 1px solid #2271b1;
		page-break-inside: avoid;
	}
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
	.wooedu-schedule-selector {
		border-width: 2px;
	}

	.wooedu-schedule-selector select {
		border-width: 2px;
	}

	.wooedu-dp-notice {
		border-width: 2px;
	}
}

/* ==========================================================================
   Popup Styles (Universal)
   ========================================================================== */

.wooedu-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	z-index: 2147483647;
	/* Max Z-Index to overrule sticky footers */
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.wooedu-popup-overlay.active {
	opacity: 1;
	visibility: visible;
}

.wooedu-popup-content {
	background: #ffffff !important;
	color: #333333 !important;
	padding: 25px;
	border-radius: 8px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
	width: 100%;
	max-width: 400px;
	position: relative;
	transform: scale(0.9);
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wooedu-popup-overlay.active .wooedu-popup-content {
	transform: scale(1);
}

.wooedu-popup-open {
	overflow: hidden;
	/* Prevent body scroll */
}

.wooedu-popup-content h3 {
	margin-top: 0;
	margin-bottom: 10px;
	font-size: 18px;
	text-align: center;
	color: #000000 !important;
	font-weight: 700;
}

.wooedu-popup-content p {
	text-align: center;
	margin-bottom: 20px;
	font-size: 14px;
	color: #444444 !important;
}

.wooedu-popup-close {
	position: absolute;
	top: 10px;
	right: 15px;
	border: none;
	background: none;
	font-size: 24px;
	cursor: pointer;
	color: #999;
}

.wooedu-popup-close:hover {
	color: #333;
}