/**
 * Recording Thumbnail Uploader Styles
 *
 * Styles for custom thumbnail upload controls and notifications.
 *
 * @package SOVLIX\ZMEET
 * @since   1.0.0
 */

/* ========================================
   Thumbnail Control Buttons
   ======================================== */

.zmeet-thumbnail-controls {
	margin-top: 12px;
	padding: 12px 16px;
	text-align: center;
	border-top: 1px solid #e5e7eb;
	background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
	border-radius: 0 0 8px 8px;
	display: flex;
	gap: 8px;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
}

.zmeet-upload-thumbnail-btn,
.zmeet-remove-thumbnail-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 18px;
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	font-weight: 600;
	border: 2px solid transparent;
	border-radius: 6px;
	background: #2563eb;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
	position: relative;
	overflow: hidden;
	min-width: 160px;
	white-space: nowrap;
}

.zmeet-upload-thumbnail-btn::before,
.zmeet-remove-thumbnail-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
	pointer-events: none;
}

.zmeet-upload-thumbnail-btn:hover,
.zmeet-remove-thumbnail-btn:hover {
	background: #1d4ed8;
	transform: translateY(-1px);
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
	color: #fff;
}

.zmeet-upload-thumbnail-btn:active,
.zmeet-remove-thumbnail-btn:active {
	transform: translateY(0);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.zmeet-upload-thumbnail-btn:focus,
.zmeet-remove-thumbnail-btn:focus {
	outline: none;
	border-color: #60a5fa;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Loading state */
.zmeet-upload-thumbnail-btn.loading,
.zmeet-remove-thumbnail-btn.loading {
	opacity: 0.7;
	cursor: not-allowed;
	position: relative;
	padding-right: 42px;
}

.zmeet-upload-thumbnail-btn.loading::after,
.zmeet-remove-thumbnail-btn.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 14px;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: zmeet-spinner 0.6s linear infinite;
}

@keyframes zmeet-spinner {
	to {
		transform: rotate(360deg);
	}
}

/* Remove button styling */
.zmeet-remove-thumbnail-btn {
	background: #ef4444;
	border-color: transparent;
}

.zmeet-remove-thumbnail-btn:hover {
	background: #dc2626;
	border-color: transparent;
}

.zmeet-remove-thumbnail-btn:focus {
	border-color: #fca5a5;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Custom thumbnail state */
.has-custom-thumbnail .zmeet-upload-thumbnail-btn {
	background: #10b981;
	border-color: transparent;
}

.has-custom-thumbnail .zmeet-upload-thumbnail-btn:hover {
	background: #059669;
	border-color: transparent;
}

.has-custom-thumbnail .zmeet-upload-thumbnail-btn::before {
	content: '✓';
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-right: 4px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	font-size: 12px;
	font-weight: bold;
}

/* Icon styles */
.zmeet-upload-thumbnail-btn svg,
.zmeet-remove-thumbnail-btn svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}


/* ========================================
   Notification Messages
   ======================================== */

.zmeet-thumbnail-notice {
	position: fixed;
	top: 32px;
	right: 20px;
	z-index: 999999;
	padding: 16px 48px 16px 20px;
	border-left: 4px solid;
	background: #fff;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	font-size: 14px;
	line-height: 1.6;
	max-width: 420px;
	border-radius: 8px;
	animation: zmeet-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zmeet-slide-in {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.zmeet-thumbnail-notice-success {
	border-left-color: #10b981;
	background: linear-gradient(to right, #ecfdf5 0%, #fff 100%);
}

.zmeet-thumbnail-notice-error {
	border-left-color: #ef4444;
	background: linear-gradient(to right, #fef2f2 0%, #fff 100%);
}

/* Close button for error messages */
.zmeet-thumbnail-notice-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	background: rgba(0, 0, 0, 0.05);
	color: #6b7280;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	border-radius: 6px;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.zmeet-thumbnail-notice-close:hover {
	background: rgba(0, 0, 0, 0.1);
	color: #111827;
}

.zmeet-thumbnail-notice-close:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}


/* ========================================
   Recording Card Wrapper
   ======================================== */

.zmeet-recording-card-wrapper {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
}

.zmeet-recording-card-wrapper:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ensure card has proper border radius */
.zmeet-recording-card-wrapper .zmeet-recording-card {
	border-radius: 8px 8px 0 0;
}

/* Featured recording wrapper */
.zmeet-recording-card-wrapper .zmeet-featured-card {
	border-radius: 8px 8px 0 0;
}

/* Sidebar item wrapper */
.zmeet-recording-card-wrapper .zmeet-archive-sidebar-item {
	border-radius: 8px 8px 0 0;
}

/* Adjust controls for featured and sidebar items */
.zmeet-recording-card-wrapper .zmeet-thumbnail-controls {
	border-radius: 0 0 8px 8px;
}


/* ========================================
   Responsive Styles
   ======================================== */

@media screen and (max-width: 768px) {
	.zmeet-thumbnail-controls {
		padding: 10px 12px;
		flex-direction: column;
		gap: 6px;
	}

	.zmeet-upload-thumbnail-btn,
	.zmeet-remove-thumbnail-btn {
		width: 100%;
		justify-content: center;
	}

	.zmeet-thumbnail-notice {
		top: 10px;
		right: 10px;
		left: 10px;
		max-width: none;
	}
}

@media screen and (max-width: 600px) {
	.zmeet-thumbnail-notice {
		font-size: 13px;
		padding: 14px 42px 14px 16px;
	}

	.zmeet-upload-thumbnail-btn,
	.zmeet-remove-thumbnail-btn {
		padding: 9px 16px;
		font-size: 13px;
	}
}


/* ========================================
   Accessibility
   ======================================== */

/* Hide controls for non-logged-in users */
body:not(.logged-in) .zmeet-thumbnail-controls {
	display: none;
}

/* Ensure keyboard focus is visible */
.zmeet-upload-thumbnail-btn:focus-visible,
.zmeet-remove-thumbnail-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.zmeet-upload-thumbnail-btn,
	.zmeet-remove-thumbnail-btn {
		border-width: 2px;
	}

	.zmeet-thumbnail-notice {
		border-left-width: 6px;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.zmeet-upload-thumbnail-btn,
	.zmeet-remove-thumbnail-btn {
		transition: none;
	}

	@keyframes zmeet-spinner {
		to {
			transform: rotate(360deg);
		}
	}
}
