/**
 * Frontend Styles for CodeNoksha Course Enrollment Customizer.
 */

.codenoksha-enrollment-box,
.cn-modal-overlay {
	font-family: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	margin-bottom: 30px;
}

/* ==========================================================================
   1. Selection Cards (Batch vs One-to-One)
   ========================================================================== */

.cn-options-toggle-group {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-bottom: 25px;
}

.cn-option-card {
	position: relative;
	display: flex;
	align-items: flex-start;
	background: #F8FAFC;
	border: 1px solid #E2E8F0;
	border-radius: 12px;
	padding: 18px 20px;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

.cn-option-card:hover {
	border-color: #CBD5E1;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

/* Selected Active State */
.cn-option-card.active {
	background: #FFFFFF;
	border: 2px solid #6230A3;
	padding: 17px 19px; /* Adjust padding to compensate for 2px border */
	box-shadow: 0 8px 20px rgba(98, 48, 163, 0.08);
}

.cn-card-selection-indicator {
	display: none;
}

.cn-card-icon {
	color: #64748B;
	margin-right: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-top: 2px;
	transition: color 0.2s;
}

.cn-option-card.active .cn-card-icon {
	color: #6230A3;
}

.cn-card-icon svg {
	width: 28px;
	height: 28px;
}

.cn-card-content {
	flex: 1;
}

.cn-card-title {
	font-size: 17px;
	font-weight: 700;
	color: #1E293B;
	margin: 0 0 6px 0;
	line-height: 1.3;
	transition: color 0.2s;
}

.cn-option-card.active .cn-card-title {
	color: #1e1b4b;
}

.cn-card-desc {
	font-size: 13px;
	color: #64748B;
	margin: 0;
	line-height: 1.5;
}


/* ==========================================================================
   2. Batch Selection Layout
   ========================================================================== */

.cn-batch-selection-wrapper {
	display: none;
	border: 1px solid #E2E8F0;
	border-radius: 10px;
	background: #FFFFFF;
	margin-bottom: 25px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.cn-batch-selection-wrapper.active {
	display: block;
}

.cn-batch-accordion-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #F8FAFC;
	padding: 12px 18px;
	border-bottom: 1px solid #E2E8F0;
	cursor: pointer;
	user-select: none;
}

.cn-accordion-title {
	font-size: 14px;
	font-weight: 600;
	color: #334155;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.cn-accordion-title .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: #64748B;
}

.cn-accordion-toggle {
	font-size: 16px;
	color: #64748B;
	transition: transform 0.2s;
}

/* Accordion open/close body classes */
.cn-batch-selection-wrapper.closed .cn-batch-list-container {
	display: none;
}

.cn-batch-selection-wrapper.closed .cn-accordion-toggle {
	transform: rotate(180deg);
}

.cn-batch-list-container {
	padding: 15px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Batch item card */
.cn-batch-item-card {
	display: flex;
	align-items: flex-start;
	background: #FFFFFF;
	border: 1px solid #E2E8F0;
	border-radius: 8px;
	padding: 15px;
	cursor: pointer;
	transition: all 0.2s;
}

.cn-batch-item-card:hover {
	border-color: #CBD5E1;
	background: #F8FAFC;
}

/* Selected state for batch item */
.cn-batch-item-card.selected {
	border-color: #E2E8F0;
	background: #FFFFFF;
	box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

/* Custom Radio design */
.cn-radio-wrapper {
	position: relative;
	margin-right: 12px;
	margin-top: 3px;
	display: inline-block;
	width: 18px;
	height: 18px;
}

.cn-radio-wrapper input[type="radio"] {
	position: absolute;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
	margin: 0;
	z-index: 2;
}

.cn-radio-checkmark {
	position: absolute;
	top: 0;
	left: 0;
	height: 18px;
	width: 18px;
	background-color: #fff;
	border: 1px solid #CBD5E1;
	border-radius: 50%;
	z-index: 1;
	transition: all 0.2s;
}

.cn-radio-wrapper input[type="radio"]:checked ~ .cn-radio-checkmark {
	background-color: #6230A3;
	border-color: #6230A3;
}

.cn-radio-checkmark:after {
	content: "";
	position: absolute;
	display: none;
}

.cn-radio-wrapper input[type="radio"]:checked ~ .cn-radio-checkmark:after {
	display: block;
}

.cn-radio-wrapper .cn-radio-checkmark:after {
	top: 5px;
	left: 5px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: white;
}

/* Details text structure inside batch card */
.cn-batch-details-block {
	flex: 1;
}

.cn-batch-name {
	font-size: 15px;
	font-weight: 700;
	color: #1E293B;
	display: block;
	margin-bottom: 6px;
}

.cn-batch-time-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 12px;
	border-bottom: 1px dashed #E2E8F0;
	padding-bottom: 8px;
}

.cn-info-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	color: #64748B;
	font-weight: 500;
}

.cn-info-badge .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: #94A3B8;
}

/* Grid columns layout */
.cn-batch-grid-row {
	display: grid;
	grid-template-columns: 1fr 1.2fr;
	gap: 15px;
}

.cn-grid-col {
	display: flex;
	flex-direction: column;
}

.cn-col-label {
	font-size: 11px;
	color: #94A3B8;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 3px;
}

.cn-col-val {
	font-size: 13px;
	color: #334155;
	font-weight: 600;
}


/* ==========================================================================
   3. Main Enrollment Actions
   ========================================================================== */

.cn-action-button-wrapper {
	margin-top: 15px;
}

.cn-btn-enroll {
	display: block;
	width: auto;
	min-width: 180px;
	background: #6230A3;
	color: #FFFFFF;
	font-size: 16px;
	font-weight: 700;
	border: none;
	border-radius: 30px;
	padding: 12px 35px;
	cursor: pointer;
	text-align: center;
	transition: all 0.2s ease-in-out;
	box-shadow: 0 4px 12px rgba(98, 48, 163, 0.25);
}

.cn-btn-enroll:hover {
	background: #4A217C;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(98, 48, 163, 0.35);
}

.cn-btn-enroll:active {
	transform: translateY(0);
}

.cn-not-purchasable-alert {
	background: #FFF5F5;
	border: 1px solid #FED7D7;
	color: #C53030;
	padding: 12px 15px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
}


/* ==========================================================================
   4. One-to-One Booking Modal
   ========================================================================== */

.cn-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cn-modal-overlay.open {
	opacity: 1;
	pointer-events: auto;
}

.cn-modal-box {
	background: #FFFFFF;
	width: 100%;
	max-width: 740px;
	border-radius: 16px;
	box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
	overflow: hidden;
	transform: scale(0.95);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	margin: 15px;
}

.cn-modal-overlay.open .cn-modal-box {
	transform: scale(1);
}

/* Modal Header */
.cn-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 18px 24px;
	background: #F8FAFC;
	border-bottom: 1px solid #F1F5F9;
}

.cn-modal-title {
	font-size: 16px;
	font-weight: 700;
	color: #1E293B;
	margin: 0;
}

.cn-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	color: #94A3B8;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color 0.15s;
}

.cn-modal-close:hover {
	color: #475569;
}

/* Modal Body Forms */
.cn-modal-body {
	padding: 24px;
}

/* Premium Side-by-Side Booking Scheduler CSS */
.cn-scheduler-container {
	display: grid;
	grid-template-columns: 310px 1fr;
	gap: 25px;
	align-items: start;
}

.cn-calendar-column {
	background: #F8FAFC;
	padding: 12px;
	border-radius: 12px;
	border: 1px solid #E2E8F0;
}

/* Flatpickr inline overrides */
.cn-calendar-column .flatpickr-calendar {
	box-shadow: none !important;
	background: transparent !important;
	border: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
}

.cn-calendar-column .flatpickr-months {
	margin-bottom: 8px;
}

.cn-calendar-column .flatpickr-months .flatpickr-month {
	color: #1E293B !important;
	font-weight: 700 !important;
	font-size: 15px !important;
}

.cn-calendar-column .flatpickr-current-month .numInputWrapper {
	display: none !important; /* Hide year picker spinner for flat look */
}

.cn-calendar-column span.flatpickr-weekday {
	color: #64748B !important;
	font-weight: 600 !important;
	font-size: 12px !important;
}

.cn-calendar-column .flatpickr-day {
	border-radius: 50% !important;
	font-weight: 600 !important;
	color: #334155 !important;
	transition: all 0.15s;
}

/* Color Sat/Sun Red as shown in Image 2 */
.cn-calendar-column .flatpickr-day.weekday.sat,
.cn-calendar-column .flatpickr-day.weekday.sun {
	color: #EF4444 !important;
}

.cn-calendar-column .flatpickr-day.today {
	border-color: #6230A3 !important;
	color: #6230A3 !important;
	background: rgba(98, 48, 163, 0.05);
}

.cn-calendar-column .flatpickr-day.selected {
	background: #6230A3 !important;
	border-color: #6230A3 !important;
	color: #FFFFFF !important;
}

.cn-calendar-column .flatpickr-day.disabled {
	color: #CBD5E1 !important;
}

.cn-slots-column {
	display: flex;
	flex-direction: column;
}

.cn-slots-section-title {
	font-size: 15px;
	font-weight: 700;
	color: #1E293B;
	margin: 0 0 15px 0;
	line-height: 1.3;
}

/* Period tabs styling matching Image 2 */
.cn-period-tabs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	margin-bottom: 20px;
}

.cn-period-tab {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 10px;
	background: #FFFFFF;
	border: 1px solid #E2E8F0;
	border-radius: 30px;
	cursor: pointer;
	transition: all 0.15s;
	font-size: 12px;
	font-weight: 600;
	color: #475569;
}

.cn-period-tab:hover {
	border-color: #CBD5E1;
	background: #F8FAFC;
}

.cn-tab-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
}

/* Pill specific custom colors when active */
.cn-period-tab[data-period="morning"].active {
	border-color: #F59E0B;
	background: #FEF3C7;
	color: #D97706;
}
.cn-period-tab[data-period="noon"].active {
	border-color: #F97316;
	background: #FFEDD5;
	color: #EA580C;
}
.cn-period-tab[data-period="afternoon"].active {
	border-color: #10B981;
	background: #D1FAE5;
	color: #059669;
}
.cn-period-tab[data-period="night"].active {
	border-color: #6230A3;
	background: #EDE9FE;
	color: #6230A3;
}

/* Slots Grid layout wrapper */
.cn-slots-grids-wrapper {
	min-height: 150px;
}

.cn-slots-grid {
	display: none;
	grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
	gap: 10px;
}

.cn-slots-grid.active {
	display: grid;
}

.cn-slot-btn {
	background: #FFFFFF;
	border: 1px solid #E2E8F0;
	border-radius: 30px;
	padding: 8px 6px;
	font-size: 12px;
	font-weight: 600;
	color: #475569;
	text-align: center;
	cursor: pointer;
	transition: all 0.15s;
}

.cn-slot-btn:hover {
	border-color: #6230A3;
	background: #FAF5FF;
	color: #6230A3;
}

.cn-slot-btn.selected {
	background: #6230A3 !important;
	border-color: #6230A3 !important;
	color: #FFFFFF !important;
	box-shadow: 0 2px 6px rgba(98,48,163,0.2);
}

.cn-no-slots {
	grid-column: 1 / -1;
	text-align: center;
	color: #94A3B8;
	font-weight: 600;
	padding: 35px 0;
	font-size: 13px;
}

.cn-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
	margin-bottom: 15px;
}

.cn-form-field {
	margin-bottom: 15px;
	display: flex;
	flex-direction: column;
}

.cn-form-field label {
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 6px;
}

.cn-form-field label .required {
	color: #EF4444;
}

.cn-form-field input[type="text"],
.cn-form-field input[type="tel"] {
	padding: 10px 14px;
	border: 1px solid #CBD5E1;
	border-radius: 6px;
	font-size: 13px;
	color: #1E293B;
	width: 100%;
	box-sizing: border-box;
	transition: all 0.2s;
}

.cn-form-field input:focus {
	outline: none;
	border-color: #6230A3;
	box-shadow: 0 0 0 2px rgba(98, 48, 163, 0.15);
}

/* Flatpickr input icon */
#cn_booking_date, #cn_booking_time {
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2394A3B8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 36px;
}

#cn_booking_time {
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2394A3B8" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>');
}

/* Modal submit button with spinner */
.cn-btn-modal-submit {
	position: relative;
	display: block;
	width: 100%;
	background: #6230A3;
	color: #FFFFFF;
	border: none;
	border-radius: 30px;
	padding: 12px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	text-align: center;
	transition: all 0.2s;
	margin-top: 10px;
}

.cn-btn-modal-submit:hover {
	background: #4A217C;
}

.cn-btn-modal-submit:disabled {
	background: #94A3B8;
	cursor: not-allowed;
}

.cn-spinner {
	display: none;
	position: absolute;
	right: 20px;
	top: calc(50% - 9px);
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255,255,255,0.3);
	border-radius: 50%;
	border-top-color: white;
	animation: spin 0.8s linear infinite;
}

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

.cn-btn-modal-submit.loading .cn-spinner {
	display: block;
}

.cn-btn-modal-submit.loading .cn-btn-text {
	visibility: hidden;
}

/* AJAX Response Box style */
.cn-response-box {
	display: none;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 15px;
	line-height: 1.4;
}

.cn-response-box.success {
	display: block;
	background: #E8F5E9;
	color: #2E7D32;
	border: 1px solid #C8E6C9;
}

.cn-response-box.error {
	display: block;
	background: #FFEBEE;
	color: #C62828;
	border: 1px solid #FFCDD2;
}

/* responsive modal alignment */
@media (max-width: 767px) {
	.cn-scheduler-container {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.cn-calendar-column {
		display: flex;
		justify-content: center;
		padding: 5px;
	}
	.cn-modal-box {
		max-width: 95%;
	}
	.cn-period-tabs {
		grid-template-columns: repeat(2, 1fr);
	}
	.cn-form-grid {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

/* ==========================================================================
   5. Batch Booking Modal Custom styles
   ========================================================================== */
.cn-modal-batch-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 15px;
	margin-top: 10px;
}

.cn-modal-batch-card {
	background: #F8FAFC;
	border: 1.5px solid #E2E8F0;
	border-radius: 12px;
	padding: 16px;
	cursor: pointer;
	transition: all 0.25s ease;
}

.cn-modal-batch-card:hover {
	border-color: #CBD5E1;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.cn-modal-batch-card.selected {
	background: #FDFEFE;
	border-color: #6230A3;
	box-shadow: 0 4px 15px rgba(98, 48, 163, 0.08);
}

.cn-modal-batch-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	border-bottom: 1px dashed #E2E8F0;
	padding-bottom: 8px;
}

.cn-modal-batch-name {
	font-size: 15px;
	font-weight: 700;
	color: #1E293B;
}

.cn-modal-batch-card.selected .cn-modal-batch-name {
	color: #6230A3;
}

.cn-modal-batch-price {
	font-size: 12px;
	font-weight: 700;
	background: #E8F5E9;
	color: #2E7D32;
	padding: 4px 10px;
	border-radius: 20px;
	border: 1px solid #C8E6C9;
}

.cn-modal-batch-card.selected .cn-modal-batch-price {
	background: #F3E5F5;
	color: #6A1B9A;
	border-color: #E1BEE7;
}

.cn-modal-batch-details {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cn-modal-batch-detail-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.cn-modal-batch-detail-item {
	font-size: 13px;
	color: #475569;
	display: inline-flex;
	align-items: center;
}

.cn-modal-batch-detail-item strong {
	color: #1E293B;
	margin-right: 4px;
}

.cn-modal-batch-detail-divider {
	color: #CBD5E1;
	font-weight: 300;
	font-size: 12px;
	user-select: none;
}

.cn-batch-student-fields {
	animation: slideDownFade 0.4s ease forwards;
}

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

/* Representative Contact buttons */
.cn-rep-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-size: 15px;
	text-shadow: none;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	transition: all 0.25s ease !important;
}

.cn-rep-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.cn-rep-btn.call:hover {
	background: #4a217c !important;
}

.cn-rep-btn.whatsapp:hover {
	background: #16a34a !important;
}

/* Ensure mobile layout order adjustments look native */
.tutor-course-single-content-wrapper > .codenoksha-enrollment-box,
.tutor-col-8 > .codenoksha-enrollment-box {
	background: #FFFFFF;
	border: 1px solid #E2E8F0;
	border-radius: 16px;
	padding: 20px;
	margin-bottom: 25px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}
