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

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

.mhub-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;
}

.mhub-upload-thumbnail-btn,
.mhub-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;
}

.mhub-upload-thumbnail-btn::before,
.mhub-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;
}

.mhub-upload-thumbnail-btn:hover,
.mhub-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;
}

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

.mhub-upload-thumbnail-btn:focus,
.mhub-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 */
.mhub-upload-thumbnail-btn.loading,
.mhub-remove-thumbnail-btn.loading {
	opacity: 0.7;
	cursor: not-allowed;
	position: relative;
	padding-right: 42px;
}

.mhub-upload-thumbnail-btn.loading::after,
.mhub-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: mhub-spinner 0.6s linear infinite;
}

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

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

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

.mhub-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 .mhub-upload-thumbnail-btn {
	background: #10b981;
	border-color: transparent;
}

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

.has-custom-thumbnail .mhub-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 */
.mhub-upload-thumbnail-btn svg,
.mhub-remove-thumbnail-btn svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}


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

.mhub-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: mhub-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

/* Close button for error messages */
.mhub-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;
}

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

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


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

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

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

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

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

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

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


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

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

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

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

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

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


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

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

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

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

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

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

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


