/**
 * Meeting Controls Frontend CSS
 *
 * Styles for Jitsi meeting controls display on presentation frontend.
 * Matches the styling of video playlist for consistent UI.
 *
 * @package VirtualConference
 * @since   2.4.0
 */

/* Main Controls Container */
.vcon-meeting-controls-container {
	width: 100%;
	max-width: 1920px;
	margin: 0 auto;
}

/* Controls Panel - matches .vcon-video-playlist */
.vcon-meeting-controls {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 16px;
	margin-top: 20px;
}

/* Controls Header - matches .vcon-playlist-header */
.vcon-controls-header {
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid #dcdcde;
}

.vcon-controls-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #1d2327;
}

/* Controls Items Container */
.vcon-controls-items {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

/* Control Item - matches .vcon-playlist-item style */
.vcon-control-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #fff;
	border: 2px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.vcon-control-item:hover {
	border-color: #2271b1;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.vcon-control-item.active {
	background: #f0f6fc;
	border-color: #2271b1;
}

/* Record Button */
.vcon-record-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	background: #fff;
	border: 2px solid #dc3545;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	color: #dc3545;
	cursor: pointer;
	transition: all 0.2s ease;
}

.vcon-record-btn:hover {
	background: #dc3545;
	color: #fff;
	box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.vcon-record-btn:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.vcon-record-btn.recording {
	background: #28a745;
	border-color: #28a745;
	color: #fff;
}

.vcon-record-btn.recording:hover {
	background: #218838;
	border-color: #218838;
}

/* Record Icon */
.vcon-record-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	background: #dc3545;
	color: #fff;
	font-size: 10px;
	border-radius: 50%;
	transition: all 0.2s ease;
}

.vcon-record-btn:hover .vcon-record-icon {
	background: #fff;
	color: #dc3545;
}

.vcon-record-btn.recording .vcon-record-icon {
	background: #fff;
	color: #28a745;
	animation: blink 1s infinite;
}

/* Record Text */
.vcon-record-text {
	font-size: 14px;
	font-weight: 600;
}

/* Recording Status Indicator */
.vcon-recording-status {
	display: none;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	background: #fff5f5;
	border: 2px solid #dc3545;
	border-radius: 4px;
	color: #dc3545;
	font-size: 14px;
	font-weight: 600;
}

.vcon-recording-status.active {
	display: flex;
}

.vcon-recording-status .status-dot {
	width: 10px;
	height: 10px;
	background: #dc3545;
	border-radius: 50%;
	animation: blink 1s infinite;
}

/* Blink Animation */
@keyframes blink {
	0%, 50% {
		opacity: 1;
	}
	51%, 100% {
		opacity: 0;
	}
}

/* Meeting Info Section */
.vcon-meeting-info {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-left: auto;
	padding-left: 16px;
	border-left: 1px solid #dcdcde;
}

.vcon-meeting-info-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #646970;
}

.vcon-meeting-info-item .dashicons,
.vcon-meeting-info-item svg {
	width: 16px;
	height: 16px;
	color: #646970;
}

/* Responsive Design */
@media (max-width: 782px) {
	.vcon-meeting-controls {
		padding: 12px;
	}

	.vcon-controls-header h3 {
		font-size: 16px;
	}

	.vcon-controls-items {
		flex-direction: column;
		align-items: stretch;
	}

	.vcon-record-btn {
		width: 100%;
		justify-content: center;
	}

	.vcon-meeting-info {
		margin-left: 0;
		padding-left: 0;
		border-left: none;
		padding-top: 12px;
		border-top: 1px solid #dcdcde;
		justify-content: center;
	}
}

@media (max-width: 600px) {
	.vcon-control-item {
		flex-wrap: wrap;
		justify-content: center;
	}

	.vcon-record-btn {
		padding: 10px 16px;
		font-size: 13px;
	}

	.vcon-record-icon {
		width: 20px;
		height: 20px;
		font-size: 8px;
	}
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
	.vcon-meeting-controls {
		background: #1d2327;
		border-color: #3c434a;
	}

	.vcon-controls-header {
		border-color: #3c434a;
	}

	.vcon-controls-header h3 {
		color: #f0f0f1;
	}

	.vcon-control-item {
		background: #2c3338;
		color: #f0f0f1;
	}

	.vcon-control-item:hover {
		background: #3c434a;
	}

	.vcon-record-btn {
		background: #2c3338;
	}

	.vcon-record-btn:hover {
		background: #dc3545;
	}

	.vcon-recording-status {
		background: #3c2324;
	}

	.vcon-meeting-info {
		border-color: #3c434a;
	}

	.vcon-meeting-info-item {
		color: #c3c4c7;
	}
}

/* Accessibility */
.vcon-record-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* Loading State */
.vcon-record-btn.loading {
	opacity: 0.6;
	cursor: wait;
	pointer-events: none;
}

/* Disabled State */
.vcon-record-btn.disabled,
.vcon-record-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
	background: #f0f0f1;
	border-color: #dcdcde;
	color: #a7aaad;
}

.vcon-record-btn.disabled .vcon-record-icon,
.vcon-record-btn:disabled .vcon-record-icon {
	background: #a7aaad;
	color: #fff;
}

/* RTL Support */
body.rtl .vcon-controls-items {
	direction: rtl;
}

body.rtl .vcon-meeting-info {
	margin-left: 0;
	margin-right: auto;
	padding-left: 0;
	padding-right: 16px;
	border-left: none;
	border-right: 1px solid #dcdcde;
}

/* =================================================================
   Guest Access Button & Modal
   ================================================================= */

/* Guest Access Button */
.vcon-guest-access-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	background: #fff;
	border: 2px solid #4a90a4;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	color: #4a90a4;
	cursor: pointer;
	transition: all 0.2s ease;
}

.vcon-guest-access-btn:hover {
	background: #4a90a4;
	color: #fff;
	box-shadow: 0 2px 4px rgba(74, 144, 164, 0.2);
}

.vcon-guest-access-btn:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.vcon-guest-icon {
	font-size: 16px;
	line-height: 1;
}

.vcon-guest-text {
	font-size: 14px;
	font-weight: 600;
}

/* Guest Access Modal Overlay */
.vcon-guest-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000; /* Below WordPress media modal (160000) */
	animation: vconFadeIn 0.2s ease;
}

/* Guest Access Modal */
.vcon-guest-modal {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	width: 90%;
	max-width: 440px;
	animation: vconSlideUp 0.3s ease;
}

.vcon-guest-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid #e5e5e5;
}

.vcon-guest-modal-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #1e1e1e;
}

.vcon-guest-modal-close {
	background: none;
	border: none;
	font-size: 28px;
	color: #666;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.vcon-guest-modal-close:hover {
	background: #f0f0f1;
	color: #333;
}

.vcon-guest-modal-body {
	padding: 24px;
}

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

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

.vcon-guest-field label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	font-size: 14px;
	color: #333;
}

.vcon-guest-field label .required {
	color: #dc3232;
}

.vcon-guest-field input[type="text"],
.vcon-guest-field input[type="email"] {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.vcon-guest-field input:focus {
	outline: none;
	border-color: #4a90a4;
	box-shadow: 0 0 0 2px rgba(74, 144, 164, 0.2);
}

.vcon-guest-field input.error {
	border-color: #dc3232;
	box-shadow: 0 0 0 2px rgba(220, 50, 50, 0.2);
}

.vcon-guest-hint {
	margin: 8px 0 0;
	font-size: 12px;
	color: #666;
	line-height: 1.4;
}

.vcon-guest-result {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #e5e5e5;
}

.vcon-guest-result label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	font-size: 14px;
	color: #333;
}

.vcon-guest-uses-info {
	font-weight: 400;
	color: #666;
	font-size: 12px;
}

.vcon-guest-link-container {
	display: flex;
	gap: 8px;
}

.vcon-guest-link-container input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 13px;
	background: #f9f9f9;
	color: #333;
	min-width: 0;
}

.vcon-guest-copy-btn,
.vcon-guest-email-btn {
	padding: 10px 16px;
	background: #4a90a4;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
	transition: background 0.2s ease;
	white-space: nowrap;
}

.vcon-guest-copy-btn:hover,
.vcon-guest-email-btn:hover {
	background: #3d7a8c;
}

.vcon-guest-copy-btn:disabled,
.vcon-guest-email-btn:disabled {
	background: #a7aaad;
	cursor: not-allowed;
}

.vcon-guest-success {
	margin: 12px 0 0;
	padding: 12px;
	background: #d4edda;
	color: #155724;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.4;
}

.vcon-guest-success.error {
	background: #f8d7da;
	color: #721c24;
}

.vcon-guest-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 24px;
	border-top: 1px solid #e5e5e5;
	background: #f9f9f9;
	border-radius: 0 0 12px 12px;
}

.vcon-guest-cancel-btn {
	padding: 10px 20px;
	background: #fff;
	color: #333;
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
	transition: all 0.2s ease;
}

.vcon-guest-cancel-btn:hover {
	background: #f5f5f5;
	border-color: #ccc;
}

.vcon-guest-generate-btn {
	padding: 10px 20px;
	background: #4a90a4;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
	transition: all 0.2s ease;
}

.vcon-guest-generate-btn:hover {
	background: #3d7a8c;
}

.vcon-guest-generate-btn:disabled {
	background: #a7aaad;
	cursor: not-allowed;
}

/* Modal Animations */
@keyframes vconFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes vconSlideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Guest Modal Responsive */
@media (max-width: 600px) {
	.vcon-guest-modal {
		width: 95%;
		max-width: none;
		margin: 10px;
	}

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

	.vcon-guest-link-container {
		flex-direction: column;
	}

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

	.vcon-guest-cancel-btn,
	.vcon-guest-generate-btn {
		width: 100%;
		text-align: center;
	}
}

/* Guest Modal Dark Mode */
@media (prefers-color-scheme: dark) {
	.vcon-guest-modal {
		background: #2c3338;
	}

	.vcon-guest-modal-header {
		border-color: #3c434a;
	}

	.vcon-guest-modal-header h3 {
		color: #f0f0f1;
	}

	.vcon-guest-modal-close {
		color: #c3c4c7;
	}

	.vcon-guest-modal-close:hover {
		background: #3c434a;
		color: #f0f0f1;
	}

	.vcon-guest-field label {
		color: #f0f0f1;
	}

	.vcon-guest-field input {
		background: #1d2327;
		border-color: #3c434a;
		color: #f0f0f1;
	}

	.vcon-guest-field input:focus {
		border-color: #4a90a4;
	}

	.vcon-guest-hint {
		color: #c3c4c7;
	}

	.vcon-guest-result {
		border-color: #3c434a;
	}

	.vcon-guest-result label {
		color: #f0f0f1;
	}

	.vcon-guest-link-container input {
		background: #1d2327;
		border-color: #3c434a;
		color: #f0f0f1;
	}

	.vcon-guest-modal-footer {
		background: #1d2327;
		border-color: #3c434a;
	}

	.vcon-guest-cancel-btn {
		background: #3c434a;
		border-color: #3c434a;
		color: #f0f0f1;
	}

	.vcon-guest-cancel-btn:hover {
		background: #50575e;
	}
}
