/**
 * Boxs.Me Google Drive - Frontend Styles
 * Preview button & Responsive Modal Viewer
 */

/* Preview Button */
.wmgd-preview-button-wrap {
	margin: 16px 0;
}

.wmgd-btn-open-preview {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: linear-gradient(135deg, #059669 0%, #047857 100%);
	color: #ffffff !important;
	font-size: 15px;
	font-weight: 600;
	padding: 10px 22px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3);
	transition: all 0.2s ease;
	text-decoration: none !important;
	width: 100%;
	box-sizing: border-box;
}

.wmgd-btn-open-preview:hover {
	background: linear-gradient(135deg, #047857 0%, #065f46 100%);
	transform: translateY(-1px);
	box-shadow: 0 6px 12px -2px rgba(5, 150, 105, 0.4);
}

.wmgd-btn-open-preview .wmgd-btn-icon {
	font-size: 18px;
}

/* Modal Viewer */
.wmgd-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wmgd-modal.is-open {
	display: flex;
	align-items: center;
	justify-content: center;
}

.wmgd-modal__backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.75);
	backdrop-filter: blur(4px);
}

.wmgd-modal__dialog {
	position: relative;
	background: #ffffff;
	width: 90%;
	max-width: 960px;
	height: 85vh;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
	animation: wmgdModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 1;
}

@keyframes wmgdModalPop {
	from {
		opacity: 0;
		transform: scale(0.95) translateY(10px);
	}

	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.wmgd-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: #0f172a;
	color: #ffffff;
	border-bottom: 1px solid #1e293b;
}

.wmgd-modal__title-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	overflow: hidden;
}

.wmgd-modal__badge {
	background: #059669;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 6px;
	white-space: nowrap;
}

.wmgd-modal__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #f8fafc;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wmgd-modal__close {
	background: transparent;
	border: none;
	color: #94a3b8;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	transition: color 0.15s;
}

.wmgd-modal__close:hover {
	color: #ffffff;
}

.wmgd-modal__body {
	flex: 1;
	position: relative;
	background: #f1f5f9;
	overflow: hidden;
}

.wmgd-modal__loading {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: #475569;
	font-size: 14px;
	font-weight: 500;
	background: #f8fafc;
	z-index: 2;
}

.wmgd-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid #cbd5e1;
	border-top-color: #059669;
	border-radius: 50%;
	animation: wmgdSpin 0.8s linear infinite;
}

@keyframes wmgdSpin {
	to {
		transform: rotate(360deg);
	}
}

.wmgd-iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.wmgd-modal__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 20px;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
	font-size: 13px;
}

.wmgd-modal__hint {
	color: #64748b;
}

#wmgd_modal_close_btn {
	background: #e2e8f0;
	color: #334155;
	border: 1px solid #cbd5e1;
	padding: 6px 14px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
}

#wmgd_modal_close_btn:hover {
	background: #cbd5e1;
}

@media (max-width: 640px) {
	.wmgd-modal__dialog {
		width: 96%;
		height: 92vh;
	}

	.wmgd-modal__hint {
		display: none;
	}
}