/**
 * Meeting Edit Modal Styles
 *
 * @package VirtualConference
 * @since 3.1.0
 */

/* WordPress Media Library z-index: reinforces values from media-views.css
 * in case theme CSS overrides them on the frontend. */
.media-modal-backdrop {
	z-index: 159900;
}
.media-modal {
	z-index: 160000;
}

/* Modal Overlay */
.vcon-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000; /* Below WordPress media modal (160000) */
	display: none;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.vcon-modal.vcon-modal-open {
	display: flex;
	pointer-events: auto;
}

.vcon-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	background: var(--vcon--custom--modal-overlay-background, rgba(0, 0, 0, 0.7));
	cursor: pointer;
	z-index: 1;
	pointer-events: auto;
}

/* Modal Container */
.vcon-modal-container {
	position: relative;
	background: #fff;
	background: var(--vcon--custom--modal-background, #fff);
	border: 1px solid #e2e8f0;
	border-color: var(--vcon--custom--modal-border-color, #e2e8f0);
	border-radius: 8px;
	border-radius: var(--vcon--custom--modal-border-radius, 8px);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	box-shadow: var(--vcon--custom--modal-shadow, 0 10px 40px rgba(0, 0, 0, 0.3));
	max-width: 600px;
	max-width: var(--vcon--custom--modal-max-width, 600px);
	width: 90%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	z-index: 10;
	pointer-events: auto;
}

/* Modal Header */
.vcon-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #e5e7eb;
}

.vcon-modal-header h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	color: #111827;
	color: var(--vcon--custom--modal-title-color, #111827);
}

.vcon-modal-close {
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	color: #6b7280;
	color: var(--vcon--custom--modal-text-color, #6b7280);
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	border-radius: var(--vcon--custom--button-border-radius, 4px);
	transition: all 0.2s;
}

.vcon-modal-close:hover {
	background: #f3f4f6;
	color: #111827;
	color: var(--vcon--custom--modal-title-color, #111827);
}

/* Modal Body */
.vcon-modal-body {
	padding: 24px;
	overflow-y: auto;
	flex: 1;
}

/* Modal Footer */
.vcon-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 24px;
	border-top: 1px solid #e5e7eb;
	border-top-color: var(--vcon--custom--modal-border-color, #e5e7eb);
	background: #f9fafb;
	background: var(--vcon--custom--modal-background, #f9fafb);
	border-radius: 0 0 8px 8px;
}

/* Form Fields */
.vcon-form-field {
	margin-bottom: 20px;
}

.vcon-form-field:last-child {
	margin-bottom: 0;
}

.vcon-form-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: #374151;
	color: var(--vcon--custom--modal-text-color, #374151);
	font-size: 14px;
}

.vcon-form-field .required {
	color: #dc2626;
	color: var(--vcon--custom--error-color, #dc2626);
	margin-left: 2px;
}

/* Form Row - Side by side fields */
.vcon-form-row {
	display: flex;
	gap: 16px;
	margin-bottom: 20px;
}

.vcon-form-field-half {
	flex: 1;
	margin-bottom: 0;
}

.vcon-input,
.vcon-textarea,
.vcon-select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-color: var(--vcon--custom--modal-border-color, #d1d5db);
	border-radius: 6px;
	border-radius: var(--vcon--custom--button-border-radius, 6px);
	font-size: 14px;
	line-height: 1.5;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.vcon-input:focus,
.vcon-textarea:focus,
.vcon-select:focus {
	outline: none;
	border-color: #3b82f6;
	border-color: var(--vcon--custom--primary-button-color, #3b82f6);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.vcon-textarea {
	resize: vertical;
	min-height: 100px;
}

/* Buttons */
.vcon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
	border-radius: 6px;
	border-radius: var(--vcon--custom--button-border-radius, 6px);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	border: none;
	text-decoration: none;
	white-space: nowrap;
}

.vcon-button-primary {
	background: #3b82f6;
	background: var(--vcon--custom--primary-button-color, #3b82f6);
	color: #fff;
}

.vcon-button-primary:hover {
	background: #2563eb;
	background: var(--vcon--custom--primary-button-hover, #2563eb);
}

.vcon-button-primary:disabled {
	background: #93c5fd;
	cursor: not-allowed;
}

.vcon-button-secondary {
	background: #fff;
	background: var(--vcon--custom--modal-background, #fff);
	color: #374151;
	color: var(--vcon--custom--modal-text-color, #374151);
	border: 1px solid #d1d5db;
	border-color: var(--vcon--custom--modal-border-color, #d1d5db);
}

.vcon-button-secondary:hover {
	background: #f9fafb;
	border-color: #9ca3af;
}

/* Notices */
.vcon-notice {
	padding: 12px 16px;
	border-radius: 6px;
	border-radius: var(--vcon--custom--button-border-radius, 6px);
	margin-bottom: 16px;
	border-left: 4px solid;
}

.vcon-notice p {
	margin: 0;
	font-size: 14px;
}

.vcon-notice-info {
	background: #eff6ff;
	border-color: #3b82f6;
	border-color: var(--vcon--custom--primary-button-color, #3b82f6);
	color: #1e40af;
}

.vcon-notice-success {
	background: #f0fdf4;
	border-color: #22c55e;
	border-color: var(--vcon--custom--success-color, #22c55e);
	color: #166534;
	color: var(--vcon--custom--success-color, #166534);
}

.vcon-notice-error {
	background: #fef2f2;
	border-color: #ef4444;
	border-color: var(--vcon--custom--error-color, #ef4444);
	color: #991b1b;
	color: var(--vcon--custom--error-color, #991b1b);
}

.vcon-notice-warning {
	background: #fffbeb;
	border-color: #f59e0b;
	color: #92400e;
	color: var(--vcon--custom--modal-text-color, #92400e);
}

/* PPV Section */
.vcon-ppv-section {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 16px;
	margin-top: 8px;
}

.vcon-ppv-header {
	margin-bottom: 0;
}

.vcon-checkbox-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-weight: 500;
	color: #374151;
	color: var(--vcon--custom--modal-text-color, #374151);
}

.vcon-checkbox {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: #3b82f6;
	accent-color: var(--vcon--custom--primary-button-color, #3b82f6);
}

.vcon-ppv-price-field {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e5e7eb;
}

.vcon-ppv-price-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: #374151;
	color: var(--vcon--custom--modal-text-color, #374151);
	font-size: 14px;
}

.vcon-field-help {
	margin: 6px 0 0 0;
	font-size: 12px;
	color: #6b7280;
	color: var(--vcon--custom--modal-text-color, #6b7280);
	line-height: 1.4;
}

/* The meeting edit modal is wider than the standard modal to accommodate
 * the PPV discount breakdown table. This uses a specific selector so it
 * is not overridden by the Customizer's --vcon--custom--modal-max-width value. */
#vcon-edit-meeting-modal .vcon-modal-container {
	max-width: 860px;
}

/* PPV discount breakdown table — inherit color is white from the theme,
 * so explicitly set black to ensure all text (heading, th, td) is readable. */
#vcon-meeting-ppv-discount-breakdown {
	color: #000;
}

/* Spin animation for loading */
@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

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

/* Responsive */
@media (max-width: 640px) {
	.vcon-modal-container {
		width: 95%;
		max-height: 95vh;
	}

	.vcon-modal-header,
	.vcon-modal-body,
	.vcon-modal-footer {
		padding: 16px;
	}

	.vcon-modal-footer {
		flex-direction: column;
	}

	.vcon-button {
		width: 100%;
	}

	.vcon-form-row {
		flex-direction: column;
		gap: 0;
	}

	.vcon-form-field-half {
		margin-bottom: 20px;
	}

	.vcon-form-field-half:last-child {
		margin-bottom: 0;
	}
}

/* Same Divi white-inherit hazard as the discount-breakdown rule above,
 * extended to the whole PPV section (its own h3/labels were uncovered). */
.vcon-ppv-section {
	color: var(--vcon--custom--modal-text-color, #50575e);
}

.vcon-ppv-section h3,
.vcon-ppv-section h4,
.vcon-ppv-section strong,
.vcon-ppv-discount-table th,
.vcon-ppv-discount-table td {
	color: var(--vcon--custom--modal-title-color, #1e1e1e);
}
