/**
 * Shared UI Shell — FAB, Upload Modal, Lightbox, Toast
 *
 * @package WPMediaVerse
 */

/* ─── Floating Action Button ─── */
.mvs-fab-container {
	position: fixed;
	bottom: 100px;
	right: 24px;
	z-index: 99999;
}

.mvs-fab {
	width: 56px;
	height: 56px;
	padding: 0;
	border-radius: 50%;
	background: #0073aa;
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.mvs-fab:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
	background: #005d8c;
}

.mvs-fab:active {
	transform: scale(0.95);
}

.mvs-fab svg {
	pointer-events: none;
}

/* ─── Modal Overlay ─── */
.mvs-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: mvs-fade-in 0.2s ease;
}

.mvs-modal-overlay[hidden] {
	display: none !important;
}

.mvs-modal {
	background: #fff;
	border-radius: 16px;
	width: 90vw;
	max-width: 560px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
	animation: mvs-slide-up 0.3s ease;
}

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

.mvs-modal-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
}

.mvs-modal-close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: #666;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}

.mvs-modal-close:hover {
	background: #f0f0f0;
	color: #333;
}

/* ─── Modal Tabs ─── */
.mvs-modal-tabs {
	display: flex;
	gap: 0;
	border-bottom: 1px solid #eee;
	padding: 0 20px;
}

.mvs-modal-tab {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 16px;
	background: none;
	border: none;
	border-radius: 0;
	border-bottom: 2px solid transparent;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	color: #666;
	transition: color 0.15s, border-color 0.15s;
	white-space: nowrap;
	border-radius: 0;
}

.mvs-modal-tab:hover,
.mvs-modal-tab:focus {
	color: #333;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	border-bottom-color: #0073aa;
	border-radius: 0;
}

.mvs-modal-tab.active {
	color: #0073aa;
	border-bottom-color: #0073aa;
}

.mvs-modal-tab svg {
	pointer-events: none;
	flex-shrink: 0;
}

/* ─── Modal Body ─── */
.mvs-modal-body {
	padding: 20px;
}

/* ─── Album Fields ─── */
.mvs-modal-album-fields {
	margin-bottom: 16px;
}

.mvs-modal-album-fields[hidden] {
	display: none !important;
}

/* ─── Dropzone ─── */
.mvs-modal-dropzone {
	border: 2px dashed #ccc;
	border-radius: 12px;
	padding: 32px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
	margin-bottom: 16px;
	min-height: 160px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

.mvs-modal-dropzone:hover {
	border-color: #0073aa;
	background: #f8fbfd;
}

.mvs-modal-dropzone[hidden] {
	display: none !important;
}

.mvs-modal-dropzone-placeholder {
	color: #999;
}

.mvs-modal-dropzone-placeholder[hidden] {
	display: none !important;
}

.mvs-modal-dropzone-placeholder svg {
	color: #ccc;
	margin-bottom: 12px;
}

.mvs-modal-dropzone-placeholder p {
	margin: 0;
	font-size: 14px;
}

/* ─── Previews ─── */
.mvs-modal-previews {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.mvs-modal-previews[hidden] {
	display: none !important;
}

.mvs-modal-preview-thumb {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 8px;
	border: 2px solid #eee;
}

/* ─── Progress ─── */
.mvs-modal-progress {
	padding: 32px 0;
	text-align: center;
}

.mvs-modal-progress[hidden] {
	display: none !important;
}

.mvs-modal-progress-bar {
	height: 6px;
	background: #eee;
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 12px;
}

.mvs-modal-progress-fill {
	height: 100%;
	background: #0073aa;
	border-radius: 3px;
	transition: width 0.3s ease;
}

.mvs-modal-progress-text {
	margin: 0;
	font-size: 14px;
	color: #666;
}

/* ─── Fields ─── */
.mvs-modal-fields[hidden] {
	display: none !important;
}

.mvs-modal-field {
	margin-bottom: 12px;
}

.mvs-modal-field label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 4px;
	color: #333;
}

.mvs-modal-field input,
.mvs-modal-field textarea,
.mvs-modal-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

.mvs-modal-field input:focus,
.mvs-modal-field textarea:focus,
.mvs-modal-field select:focus {
	border-color: #0073aa;
	outline: none;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

.mvs-modal-field-row {
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
}

.mvs-modal-field-row input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
}

.mvs-modal-field-row select {
	width: auto;
	min-width: 140px;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
}

.mvs-modal-field-row input:focus,
.mvs-modal-field-row select:focus {
	border-color: #0073aa;
	outline: none;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

/* ─── Modal Footer ─── */
.mvs-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 20px;
	border-top: 1px solid #eee;
}

.mvs-modal-footer[hidden] {
	display: none !important;
}

/* ─── Buttons ─── */
.mvs-btn--primary {
	background: #0073aa;
	color: #fff;
	border: none;
	padding: 10px 24px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s;
}

.mvs-btn--primary:hover {
	background: #005d8c;
}

.mvs-btn--secondary {
	background: #f0f0f0;
	color: #333;
	border: none;
	padding: 10px 24px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s;
}

.mvs-btn--secondary:hover {
	background: #e0e0e0;
}

/* ─── Lightbox ─── */
.mvs-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: mvs-fade-in 0.2s ease;
}

.mvs-lightbox-overlay[hidden] {
	display: none !important;
}

.mvs-lightbox {
	display: flex;
	max-width: 95vw;
	max-height: 95vh;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	animation: mvs-slide-up 0.3s ease;
}

.mvs-lightbox-close {
	position: fixed;
	top: 16px;
	right: 16px;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 8px;
	border-radius: 50%;
	z-index: 10;
	transition: background 0.15s;
}

.mvs-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.mvs-lightbox-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 300px;
	min-height: 300px;
}

.mvs-lightbox-loading[hidden] {
	display: none !important;
}

.mvs-lightbox-media {
	position: relative;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 65vw;
	max-height: 95vh;
	background: #000;
}

.mvs-lightbox-media[hidden] {
	display: none !important;
}

.mvs-lightbox-media img {
	max-width: 100%;
	max-height: 95vh;
	object-fit: contain;
}

.mvs-lightbox-media img[hidden],
.mvs-lightbox-media video[hidden],
.mvs-lightbox-media audio[hidden] {
	display: none !important;
}

.mvs-lightbox-video {
	max-width: 100%;
	max-height: 80vh;
	display: block;
	margin: 0 auto;
	border-radius: 8px;
}

.mvs-lightbox-audio {
	width: 100%;
	max-width: 500px;
	margin: 0 auto;
	display: block;
}

/* Lightbox gallery navigation arrows */
.mvs-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 12px 8px;
	border-radius: 4px;
	z-index: 5;
	transition: background 0.15s;
}

.mvs-lightbox-nav:hover {
	background: rgba(0, 0, 0, 0.8);
}

.mvs-lightbox-nav[hidden] {
	display: none !important;
}

.mvs-lightbox-nav--prev {
	left: 8px;
}

.mvs-lightbox-nav--next {
	right: 8px;
}

.mvs-lightbox-nav svg {
	pointer-events: none;
}

/* Lightbox position indicator */
.mvs-lightbox-position {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 500;
	z-index: 5;
}

.mvs-lightbox-position[hidden] {
	display: none !important;
}

.mvs-lightbox-sidebar {
	width: 340px;
	padding: 20px;
	overflow-y: auto;
	border-left: 1px solid #eee;
}

.mvs-lightbox-sidebar[hidden] {
	display: none !important;
}

.mvs-lightbox-author {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.mvs-lightbox-author-avatar {
	border-radius: 50%;
}

.mvs-lightbox-title {
	font-size: 16px;
	margin: 0 0 16px;
}

/* ─── Spinner ─── */
.mvs-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid #eee;
	border-top-color: #0073aa;
	border-radius: 50%;
	animation: mvs-spin 0.8s linear infinite;
}

/* ─── Toast ─── */
.mvs-toast {
	position: fixed;
	bottom: 96px;
	right: 24px;
	padding: 12px 20px;
	border-radius: 8px;
	font-size: 14px;
	z-index: 100000;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	animation: mvs-slide-up 0.3s ease;
}

.mvs-toast[hidden] {
	display: none !important;
}

.mvs-toast--success {
	background: #00a32a;
	color: #fff;
}

.mvs-toast--error {
	background: #d63638;
	color: #fff;
}

.mvs-toast-close {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	font-size: 18px;
	padding: 0;
	opacity: 0.7;
}

.mvs-toast-close:hover {
	opacity: 1;
}

/* ─── Animations ─── */
@keyframes mvs-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes mvs-slide-up {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}

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

/* ─── Responsive ─── */
@media (max-width: 768px) {
	.mvs-modal {
		width: 100vw;
		max-width: 100vw;
		max-height: 100vh;
		border-radius: 0;
		height: 100vh;
	}

	.mvs-modal-tabs {
		overflow-x: auto;
		padding: 0 12px;
	}

	.mvs-modal-tab {
		padding: 10px 12px;
		font-size: 12px;
	}

	.mvs-modal-body {
		padding: 16px;
	}

	.mvs-modal-field-row {
		flex-direction: column;
	}

	.mvs-lightbox {
		flex-direction: column;
		max-width: 100vw;
		max-height: 100vh;
		border-radius: 0;
	}

	.mvs-lightbox-media {
		max-width: 100vw;
		max-height: 60vh;
	}

	.mvs-lightbox-sidebar {
		width: 100%;
		border-left: none;
		border-top: 1px solid #eee;
	}

	.mvs-fab-container {
		bottom: 80px;
	}

	.mvs-fab {
		width: 48px;
		height: 48px;
	}

	.mvs-fab svg {
		width: 18px;
		height: 18px;
	}
}
