/**
 * Vist360 admin layout glue. Visual language comes from antd (ConfigProvider);
 * this file only covers layout, the live preview, and small custom widgets.
 */

.vist360-admin-root {
	margin-left: -20px;
}

.vist360-app {
	min-height: calc(100vh - 32px);
	background: #f0f2f5;
}

.vist360-app__header {
	padding: 0;
	border-bottom: 1px solid #dcdcde;
	position: sticky;
	top: 32px;
	z-index: 100;

	@media (max-width: 782px) {
		top: 46px;
	}
}

.vist360-app__header-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	height: 100%;
	padding: 0 24px;

	@media (max-width: 782px) {
		padding: 0 12px;
	}
}

.vist360-app__brand {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

.vist360-app__logo {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: #f0f6fc;
	color: #2271b1;
	font-size: 18px;
}

.vist360-app__content {
	padding: 24px;
	width: 100%;

	@media (max-width: 782px) {
		padding: 12px;
	}
}

.vist360-view__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;

	h2.ant-typography {
		margin-bottom: 2px;
	}
}

.vist360-view__filters {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.vist360-loading {
	display: grid;
	place-items: center;
	padding: 80px 0;
}

/* Tour cards */
.vist360-tour-card__cover {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	padding: 0;
	border: none;
	background: #f6f7f7;
	cursor: pointer;
	overflow: hidden;
	font-size: 34px;
	color: #dcdcde;
	display: grid;
	place-items: center;

	img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

.vist360-tour-card__status {
	position: absolute;
	top: 10px;
	left: 10px;
	margin: 0;
}

/* Template gallery */
.vist360-template-card__cover {
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 9;
	font-size: 34px;
	color: #fff;

	&.is-blank {
		background: #f6f7f7;
		color: #2271b1;
	}

	&.is-real_estate {
		background: linear-gradient(135deg, #2271b1, #72aee6);
	}

	&.is-hotel {
		background: linear-gradient(135deg, #8c5e58, #d9a48f);
	}

	&.is-restaurant {
		background: linear-gradient(135deg, #b26205, #ecb75c);
	}

	&.is-showroom {
		background: linear-gradient(135deg, #3c434a, #8f979e);
	}

	&.is-locked-cover {
		background: #f0f0f1;
		color: #a7aaad;
		aspect-ratio: 16 / 9;
		border-radius: 8px 8px 0 0;
		margin: -1px -1px 12px;
	}
}

.vist360-template-card__initial {
	font-size: 44px;
	font-weight: 700;
	opacity: 0.9;
}

.vist360-template-card__cta {
	padding-left: 0;
	margin-top: 8px;
}

.vist360-template-card.is-locked {
	opacity: 0.75;
}

/* Editor */
.vist360-editor__title {
	width: min(420px, 60vw);
	font-size: 15px;
	font-weight: 600;
}

.vist360-editor__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 20px;
	align-items: start;

	@media (max-width: 992px) {
		grid-template-columns: 1fr;
	}
}

.vist360-editor__main {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.vist360-editor__sidebar {
	position: sticky;
	top: 96px;
}

.vist360-preview {
	position: relative;
	border-radius: 8px;
	overflow: hidden;

	.vist360-viewer {
		height: 420px;

		@media (max-width: 600px) {
			height: 260px;
		}
	}

	&--empty {
		display: grid;
		place-items: center;
		height: 300px;
		background: #fff;
		border: 1px dashed #dcdcde;
	}
}

.vist360-preview__hint {
	position: absolute;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	padding: 4px 14px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 12px;
	pointer-events: none;
	white-space: nowrap;
	z-index: 5;

	@media (max-width: 600px) {
		white-space: normal;
		text-align: center;
		max-width: 80%;
	}
}

.vist360-editor__scenes-header h5.ant-typography {
	margin: 0;
}

.vist360-scene-strip {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 4px;
}

.vist360-scene-thumb {
	position: relative;
	flex: 0 0 auto;
	width: 128px;
	height: 76px;
	border-radius: 8px;
	border: 2px solid transparent;
	background: #fff;
	cursor: pointer;
	overflow: hidden;
	display: grid;
	place-items: center;
	color: #a7aaad;
	font-size: 20px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);

	img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	&.is-active {
		border-color: #2271b1;
	}

	&--add {
		border: 2px dashed #dcdcde;
		background: transparent;

		&:hover {
			border-color: #2271b1;
			color: #2271b1;
		}
	}
}

.vist360-scene-thumb__label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 2px 6px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 11px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: flex;
	align-items: center;
	gap: 4px;

	.anticon {
		color: #ffd700;
	}
}

.vist360-scene-thumb--add .vist360-scene-thumb__label {
	background: transparent;
	color: inherit;
	position: static;
	padding: 0;
}

.vist360-hotspot-list {
	margin-top: 14px;
}

.vist360-toggle-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	width: 100%;
}

/* Analytics */
.vist360-chart-card {
	margin: 16px 0;
}

.vist360-bar-chart {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 180px;
}

.vist360-bar-chart__bar {
	flex: 1;
	min-width: 3px;
	background: #2271b1;
	border-radius: 3px 3px 0 0;
	opacity: 0.85;
	transition: opacity 0.15s ease;

	&:hover {
		opacity: 1;
	}
}

/* Settings */
.vist360-settings__card {
	max-width: 680px;
}

/* Editor preview must not show frontend viewer border radius conflicts. */
.vist360-app .vist360-label {
	display: block;
	font-size: 12px;
	color: #646970;
}


/* Neutralize wp-admin form styles that bleed into antd components. */
.vist360-app,
.ant-modal-root,
.ant-drawer,
.ant-popover,
.ant-dropdown {
	input[type='text'],
	input[type='search'],
	input[type='url'],
	input[type='password'],
	input[type='number'],
	select,
	textarea {
		min-height: 0;
		max-width: none;
		margin: 0;
		background-image: none;
	}

	input:focus,
	select:focus,
	textarea:focus {
		outline: none;
	}

	select {
		-webkit-appearance: none;
		appearance: none;
	}
}
