/**
 * LIOS 3D Globe Centralized Stylesheet
 *
 * Consolidates all 3D WebGL Globe styles across the LIOS platform:
 * 1. Shared WebGL Keyframes & Loader / Spinner
 * 2. Hero Rotating World Globe (Meet the Experts / Directory Hero)
 * 3. Country Hub Fast-Facts 3D Globe Card
 * 4. Fullscreen 42-Country Explorer Modal & Country Drawer
 * 5. Globe.gl Interactive Hover Tooltips (.scene-tooltip & .lios-globe-tooltip)
 * 6. Responsive Breakpoints
 *
 * @package JNews_Child
 */

/* ==============================================================
   1. SHARED WEBGL LOADER & ANIMATION
   ============================================================== */
@keyframes lios-globe-spin {
	to {
		transform: rotate(360deg);
	}
}

.countries-hero-globe__loader {
	display: grid;
	position: absolute;
	top: 50%;
	left: 50%;
	place-items: center;
	gap: 12px;
	transform: translate(-50%, -50%);
	color: rgba(255, 255, 255, 0.72);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	transition: opacity 0.4s ease, visibility 0.4s ease;
	will-change: opacity;
	z-index: 5;
}

.countries-hero-globe__spinner {
	width: 48px;
	height: 48px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: var(--lios-gold, #f2bd3d);
	border-radius: 50%;
	animation: lios-globe-spin 1.1s linear infinite;
}

.countries-hero-globe.is-globe-webgl-ready .countries-hero-globe__loader,
.fast-facts-globe-box.is-globe-rendered .countries-hero-globe__loader,
.fast-facts-globe-box.is-globe-ready .countries-hero-globe__loader,
.fast-facts-globe-box.is-globe-webgl-ready .countries-hero-globe__loader,
.fast-facts-globe-box.is-globe-error .countries-hero-globe__loader,
.modal-globe-stage.is-globe-rendered .countries-hero-globe__loader,
.modal-globe-stage.is-globe-ready .countries-hero-globe__loader,
.modal-globe-stage.is-globe-error .countries-hero-globe__loader {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* ==============================================================
   2. HERO ROTATING WORLD GLOBE (WebGL)
   ============================================================== */
.countries-hero-globe {
	position: relative;
	z-index: 3;
	width: 100%;
	max-width: 480px;
	height: 480px;
	margin: 0 auto;
	justify-self: center;
	overflow: visible;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.countries-hero-globe::after {
	position: absolute;
	z-index: -1;
	inset: -10%;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(0, 105, 169, 0.08) 55%, transparent 75%);
	filter: blur(48px);
	content: "";
	pointer-events: none;
}

.countries-hero-globe__canvas {
	position: absolute;
	inset: 0;
	overflow: visible;
}

.countries-hero-globe__canvas canvas {
	display: block;
	max-width: none !important;
	opacity: 0;
	transform: none !important;
	transform-origin: center;
	transition: opacity 0.8s ease;
	will-change: opacity;
}

.countries-hero-globe.is-globe-webgl-ready .countries-hero-globe__canvas canvas {
	opacity: 1;
	pointer-events: auto;
}

/* ==============================================================
   3. COUNTRY HUB FAST-FACTS GLOBE CARD
   ============================================================== */
.fast-facts-globe-box {
	background: radial-gradient(circle at 50% 50%, #0a3a5e 0%, #051a2a 75%, #020c15 100%);
	border-radius: 12px;
	position: relative;
	overflow: hidden;
	min-height: 280px;
	display: flex;
	flex-direction: column;
	box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.globe-controls-overlay {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	pointer-events: none;
	z-index: 10;
}

.globe-hint {
	background: rgba(6, 29, 45, 0.75);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: rgba(255, 255, 255, 0.85);
	font-size: 10px;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 12px;
	text-transform: uppercase;
}

.btn-expand-globe {
	pointer-events: auto;
	background: var(--lios-gold, #f2bd3d);
	border: 1px solid var(--lios-gold, #f2bd3d);
	color: #061d2d;
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 800;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	transition: all 0.2s ease;
	white-space: nowrap;
}

.btn-expand-globe:hover {
	background: #ffffff;
	border-color: #ffffff;
	color: #061d2d;
	transform: translateY(-1px);
}

.fast-facts-globe-box .globe-canvas-wrap {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	cursor: grab;
}

.fast-facts-globe-box .globe-canvas-wrap:active {
	cursor: grabbing;
}

.fast-facts-globe-box canvas {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	opacity: 1 !important;
	pointer-events: auto;
}

.fast-facts-globe-box .countries-hero-globe__loader {
	position: absolute;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	z-index: 5;
}

.globe-footer-caption {
	margin-top: auto;
	position: relative;
	z-index: 10;
	background: linear-gradient(180deg, transparent 0%, rgba(5, 24, 38, 0.95) 100%);
	padding: 10px 14px;
	font-size: 11px;
	color: rgba(255, 255, 255, 0.8);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}

.globe-footer-caption strong {
	color: var(--lios-gold, #f2bd3d);
}

/* ==============================================================
   4. FULLSCREEN 42-COUNTRY EXPLORER MODAL & DRAWER
   ============================================================== */
.globe-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(3, 14, 23, 0.94);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	z-index: 999999;
	display: none;
	flex-direction: column;
}

.globe-modal-overlay.active,
.globe-modal-overlay:not([hidden]) {
	display: flex !important;
}

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

body.globe-modal-open {
	overflow: hidden;
}

.modal-topbar {
	padding: 16px 28px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(6, 29, 45, 0.85);
}

.modal-brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.modal-brand h3 {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 18px;
	color: #fff;
	margin: 0;
}

.modal-brand span {
	color: var(--lios-gold, #f2bd3d);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
}

.btn-close-modal {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	padding: 8px 16px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 700;
	font-size: 13px;
	transition: all 0.2s ease;
}

.btn-close-modal:hover {
	background: var(--lios-red, #d9383a);
	border-color: var(--lios-red, #d9383a);
}

.modal-body {
	flex: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	position: relative;
	overflow: hidden;
}

.modal-globe-stage {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 320px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: grab;
}

.modal-globe-stage:active {
	cursor: grabbing;
}

.modal-globe-stage canvas {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	outline: none;
}

.modal-globe-stage .countries-hero-globe__loader {
	position: absolute;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	z-index: 5;
}

.modal-country-drawer {
	background: #061c2d;
	border-left: 1px solid rgba(255, 255, 255, 0.12);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.drawer-search {
	padding: 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-search input {
	width: 100%;
	background: #0b2c45;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	padding: 10px 14px;
	color: #fff;
	font-size: 13px;
	outline: none;
}

.drawer-search input:focus {
	border-color: var(--lios-gold, #f2bd3d);
}

.drawer-list {
	flex: 1;
	overflow-y: auto;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.country-list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 8px;
	color: #e2e8f0;
	cursor: pointer;
	text-decoration: none !important;
	transition: all 0.2s ease;
}

.country-list-item:hover {
	background: #0b3652;
	border-color: rgba(242, 189, 61, 0.4);
	color: #fff;
}

.country-list-item.selected {
	background: #0d4166;
	border-color: var(--lios-gold, #f2bd3d);
	box-shadow: 0 0 0 1px rgba(242, 189, 61, 0.35);
	color: #fff;
}

.country-list-item:focus-visible {
	outline: 2px solid var(--lios-gold, #f2bd3d);
	outline-offset: 1px;
}

.country-item-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.country-item-left img {
	width: 24px;
	height: 16px;
	object-fit: cover;
	border-radius: 2px;
}

.country-item-left strong {
	font-size: 13px;
	color: #fff;
}

.country-item-region {
	font-size: 10px;
	color: #94a3b8;
	text-transform: uppercase;
}

.country-item-cta {
	font-size: 11px;
	font-weight: 800;
	color: var(--lios-gold, #f2bd3d);
	display: none;
}

.country-list-item.selected .country-item-cta {
	display: inline-block;
}

/* ==============================================================
   5. GLOBE HOVER TOOLTIPS (Globe.gl scene-tooltip)
   ============================================================== */
.scene-tooltip {
	z-index: 1000000 !important;
	pointer-events: none;
}

.lios-globe-tooltip {
	background: rgba(6, 28, 45, 0.94);
	border: 1px solid var(--lios-gold, #f2bd3d);
	border-radius: 6px;
	padding: 8px 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	text-align: center;
	pointer-events: none;
	user-select: none;
}

.lios-globe-tooltip-name {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 14px;
	font-weight: 700;
	color: #ffffff;
	margin-bottom: 2px;
	letter-spacing: 0.2px;
}

.lios-globe-tooltip-region {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #94a3b8;
	margin-bottom: 4px;
}

.lios-globe-tooltip-cta {
	font-size: 11px;
	font-weight: 700;
	color: var(--lios-gold, #f2bd3d);
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

/* ==============================================================
   6. GLOBE RESPONSIVE MEDIA QUERIES
   ============================================================== */
@media (max-width: 1100px) {
	.countries-hero-globe {
		max-width: 390px;
		height: 390px;
		margin: 10px auto 0;
	}
}

@media (max-width: 1050px) {
	.fast-facts-globe-box {
		min-height: 280px;
	}
}

@media (max-width: 800px) {
	.modal-body {
		grid-template-columns: 1fr;
		grid-template-rows: 1fr 240px;
	}
	.modal-country-drawer {
		border-left: none;
		border-top: 1px solid rgba(255, 255, 255, 0.12);
	}
}

@media (max-width: 767px) {
	.countries-hero-globe {
		max-width: 270px;
		height: 270px;
		margin: 14px auto 0;
	}
	.fast-facts-globe-box {
		min-height: 260px;
	}
}
