* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	height: 100%;
	overflow: hidden;
}

body {
	background-color: #3f2e52;
	display: flex;
	flex-direction: column;
}

/* Contenidor principal */
.main-container {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}

/* Alçada de la barra superior - AJUSTA AQUEST VALOR */
:root {
	--header-height: 45px;
}

/* Barra superior - element normal del flux */
.header-bar {
	width: 100%;
	height: var(--header-height);
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #3f2e52;
	z-index: 10;
	padding: 0 15px;
	position: relative;
}

/* Títol - centrat i estètic */
.frame-title {
	color: #ffffff;
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 2px;
	text-transform: uppercase;
	opacity: 0.9;
	transition: opacity 0.3s ease;
	margin: 0;
}

.frame-title.loading {
	opacity: 0;
}

/* Botó mapa */
.map-button {
	position: absolute;
	left: 15px;
	width: 26px;
	height: 26px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #ffffff;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease;
}

.map-button:hover {
	background: rgba(255, 255, 255, 0.2);
}

.map-button svg {
	width: 14px;
	height: 14px;
}

.map-button.hidden {
	opacity: 0;
	pointer-events: none;
}

/* Text del botó mapa (fora del botó) */
.map-button-text {
	position: absolute;
	left: 48px;
	color: rgba(255, 255, 255, 0.7);
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 12px;
	font-weight: 400;
	white-space: nowrap;
}

.map-button-text.hidden {
	opacity: 0;
	pointer-events: none;
}

/* Contenidor del frame - ocupa l'espai restant */
.frame-wrapper {
	flex: 1;
	position: relative;
	overflow: hidden;
	background-color: #2a1f38;
	margin: 0 10px 10px 10px;
	border-radius: 16px;
}

/* Spinner centrat dins el frame-wrapper */
.spinner-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1;
}

.spinner {
	width: 50px;
	height: 50px;
	border: 4px solid rgba(255, 255, 255, 0.2);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

/* Iframe amb transició */
#mainFrame {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
	z-index: 2;
	opacity: 1;
	transition: opacity 0.3s ease;
}

#mainFrame.loading {
	opacity: 0;
}

/* Responsive */
@media (max-width: 768px) {
	.frame-title {
		font-size: 12px;
		letter-spacing: 2px;
	}
}
