/* ============================================================
   DEMO YAPI — Proje Haritası
   Tasarım sistemi: tokenlar, iskelet, header, footer, ortak öğeler
   ============================================================ */
@import url("sidebar.css");
@import url("info-popup.css");
@import url("dialog.css");
@import url("mobile.css");

:root {
	--sidebar-w: 400px;
	--vh: 1vh;
	--top-offset: 64px;

	--bg-body: #f5f5f5;
	--bg-panel: rgba(255, 255, 255, 0.96);
	--bg-card: #ffffff;
	--bg-hover: #f3f4f6;
	--bg-input: #ffffff;

	--text-main: #0b1220;
	--text-sub: #4b5563;
	--text-inv: #ffffff;

	--border-color: #e5e7eb;
	--shadow-soft: 6px 0 24px rgb(0 0 0 / 0.06);
	--shadow-card: 0 16px 40px rgb(0 0 0 / 0.22);

	--chip-bg: #ffffff;
	--chip-text: #0f172a;
	--chip-active-bg: #0b1220;
	--chip-active-text: #ffffff;

	--accent-red: #ef4444;
	--accent-blue: #2563eb;

	--btn-bg: rgba(255, 255, 255, 0.96);
	--btn-text: #0b1220;
	--btn-dark-bg: #0b1220;
	--btn-dark-text: #f1f5f9;

	--base-speed: 0.5s;
	--anim-speed-multiplier: 0.3;
	--t: calc(var(--base-speed) * var(--anim-speed-multiplier));
	--ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark {
	--bg-body: #0f172a;
	--bg-panel: rgba(15, 23, 42, 0.96);
	--bg-card: #1e293b;
	--bg-hover: #334155;
	--bg-input: #1e293b;

	--text-main: #f1f5f9;
	--text-sub: #94a3b8;
	--text-inv: #0f172a;

	--border-color: #334155;
	--shadow-soft: 6px 0 24px rgb(0 0 0 / 0.3);
	--shadow-card: 0 16px 40px rgb(0 0 0 / 0.6);

	--chip-bg: #1e293b;
	--chip-text: #e2e8f0;
	--chip-active-bg: #38bdf8;
	--chip-active-text: #0f172a;

	--accent-red: #f87171;
	--btn-bg: #0b1220;
	--btn-text: #f1f5f9;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

body {
	font-family: Raleway, system-ui, -apple-system, sans-serif;
	background: var(--bg-body);
	width: 100%;
	height: 100dvh;
	overflow: hidden;
	touch-action: pan-x pan-y;
	color: var(--text-main);
}

/* ---------- Harita alanı ---------- */
#map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: var(--bg-body);
	z-index: 1;
}

/* MapLibre'ın kendi kontrollerini ve atıf kutusunu gizle — kendi kredimizi yazıyoruz */
.maplibregl-map {
	font-family: inherit;
}
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-attrib {
	display: none !important;
}
.maplibregl-canvas {
	outline: none;
}

/* Atıf (attribution) — tasarıma uygun, sağ altta ince satır */
.map-credit {
	position: fixed;
	right: 12px;
	bottom: 2px;
	z-index: 400;
	font: 500 10px/1.4 Raleway, system-ui, sans-serif;
	color: var(--text-sub);
	opacity: 0.65;
	pointer-events: none;
	letter-spacing: 0.01em;
}

/* ---------- Ortak buton ---------- */
button,
.btn {
	background: var(--btn-bg);
	color: var(--btn-text);
	font: 700 14px/1.2 Raleway, system-ui, sans-serif;
	padding: 12px 14px;
	border-radius: 12px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	border: 1px solid var(--border-color);
	text-decoration: none;
	transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease),
		background-color var(--t) var(--ease), color var(--t) var(--ease);
	letter-spacing: -0.01em;
	will-change: transform;
	backface-visibility: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
button:hover,
.btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}
button:active,
.btn:active {
	transform: translateY(0) scale(0.985);
}
.btn-dark {
	background: var(--btn-dark-bg) !important;
	color: var(--btn-dark-text) !important;
	border-color: var(--btn-dark-bg) !important;
}
.btn-whatsapp {
	background: #25d366 !important;
	color: #fff !important;
	border-color: #25d366 !important;
}
.btn-ghost {
	background: var(--bg-card);
	color: var(--text-main);
	border: 1px solid var(--border-color);
}

/* ---------- Durum etiketi ---------- */
.pill {
	padding: 3px 8px;
	border-radius: 8px;
	font: 700 11px/1.4 Raleway, system-ui, sans-serif;
	white-space: nowrap;
}
.pill-open {
	background: #dcfce7;
	color: #166534;
}
.pill-closed {
	background: #fee2e2;
	color: #991b1b;
}
body.dark .pill-open {
	background: rgba(34, 197, 94, 0.18);
	color: #86efac;
}
body.dark .pill-closed {
	background: rgba(239, 68, 68, 0.18);
	color: #fca5a5;
}

/* ---------- Üst sağ header ---------- */
.top-bar {
	position: fixed;
	top: 12px;
	right: 10px;
	z-index: 1300;
	display: flex;
	gap: 8px;
	align-items: center;
	max-width: calc(100vw - 20px);
}
.top-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	min-width: 0;
}
.top-actions svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}
.top-bar button {
	height: 40px;
	flex-shrink: 0;
}
.mode-switch {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	padding: 0;
	flex-shrink: 0;
}
.mode-switch svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.icon-sun {
	display: none;
}
body.dark .icon-sun {
	display: block;
}
body.dark .icon-moon {
	display: none;
}

/* ---------- Marka / logo ---------- */
.brand {
	background: var(--bg-panel);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	padding: 8px 14px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: 4px;
	flex-shrink: 0;
	color: var(--text-main);
}
.brand .logo {
	height: 42px;
	width: auto;
	display: block;
}
.brand .logo .house {
	stroke: #e02424;
}
.brand .logo .house-fill {
	fill: #e02424;
}
.brand .logo .wm {
	fill: currentColor;
	font-family: Raleway, system-ui, sans-serif;
}

/* ---------- Alt sağ footer ---------- */
.bottom-bar {
	position: fixed;
	right: 10px;
	bottom: 20px;
	z-index: 1300;
	background: var(--bg-hover);
	border-radius: 12px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
	padding: 4px;
	display: flex;
	gap: 4px;
}
.bottom-bar svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------- Marker ---------- */
.pin {
	display: block;
	transition: transform var(--t) var(--ease), filter var(--t) var(--ease);
	transform-origin: 50% 100%;
	cursor: pointer;
}
.pin-wrap {
	cursor: pointer;
	will-change: transform;
}
.pin-wrap:hover .pin {
	transform: scale(1.12);
	filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}
.pin-bounce {
	animation: pinBounce 0.9s infinite var(--ease);
}
@keyframes pinBounce {
	0%, 100% { transform: translateY(0); }
	30% { transform: translateY(-13px); }
	55% { transform: translateY(0); }
	70% { transform: translateY(-5px); }
	85% { transform: translateY(0); }
}

/* ---------- Yükleniyor ---------- */
.boot {
	position: fixed;
	inset: 0;
	z-index: 5000;
	display: grid;
	place-items: center;
	background: var(--bg-body);
	transition: opacity 0.35s ease, visibility 0.35s ease;
}
.boot.hide {
	opacity: 0;
	visibility: hidden;
}
.boot .spin {
	width: 34px;
	height: 34px;
	border: 3px solid var(--border-color);
	border-top-color: var(--text-main);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}
@keyframes spin {
	to { transform: rotate(360deg); }
}

/* ---------- 3D drone turu ---------- */
.tour-bar {
	position: fixed;
	left: 50%;
	bottom: 22px;
	transform: translateX(-50%) translateY(10px);
	z-index: 1400;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 10px 12px 10px 18px;
	border-radius: 16px;
	background: rgba(11, 18, 32, 0.82);
	backdrop-filter: blur(14px) saturate(160%);
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
	color: #f1f5f9;
	opacity: 0;
	transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
	max-width: calc(100vw - 24px);
}
.tour-bar.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
.tour-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.tour-tag {
	font: 700 10px/1.2 Raleway, system-ui, sans-serif;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #7dd3fc;
}
.tour-name {
	font: 700 15px/1.25 Raleway, system-ui, sans-serif;
	letter-spacing: -0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tour-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}
.tour-btn {
	background: rgba(255, 255, 255, 0.12);
	color: #f1f5f9;
	border: 1px solid rgba(255, 255, 255, 0.16);
	box-shadow: none;
	padding: 10px 14px;
	font-size: 13px;
}
.tour-btn:hover {
	background: rgba(255, 255, 255, 0.2);
	box-shadow: none;
}
.tour-btn svg {
	width: 15px;
	height: 15px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.tour-btn .ico-play {
	fill: currentColor;
	stroke: none;
}
.tour-exit {
	background: rgba(239, 68, 68, 0.9);
	border-color: rgba(239, 68, 68, 0.9);
}
.tour-exit:hover {
	background: #ef4444;
}
/* Duraklatıldığında ikon değişir */
.tour-bar .ico-play { display: none; }
.tour-bar.paused .ico-play { display: block; }
.tour-bar.paused .ico-pause { display: none; }

/* Tur sırasında sinematik görünüm: ikincil kontroller gizlenir */
body.touring .top-actions,
body.touring .bottom-bar,
body.touring .sidebar-open-btn,
body.touring .map-credit {
	display: none !important;
}
body.touring .sidebar {
	transform: translateX(-100%);
}
/* Tur sırasında pin'ler sahneyi kapatmasın — projeyi mavi hacim zaten gösteriyor.
   MapLibre marker öğelerine satır içi `opacity` yazdığı için !important gerekir. */
body.touring .pin-wrap {
	opacity: 0 !important;
	pointer-events: none;
}
.pin-wrap {
	transition: opacity var(--t) var(--ease);
}

.boot-msg {
	max-width: 460px;
	padding: 28px;
	text-align: center;
	color: var(--text-main);
	user-select: text;
}
.boot-msg h1 {
	font: 700 19px/1.3 Raleway, system-ui, sans-serif;
	margin-bottom: 10px;
	letter-spacing: -0.02em;
}
.boot-msg p {
	font: 500 13.5px/1.65 Raleway, system-ui, sans-serif;
	color: var(--text-sub);
	margin-bottom: 14px;
}
.boot-msg .boot-hint {
	margin: 16px 0 6px;
	font-size: 12.5px;
}
.boot-msg code {
	display: block;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 10px 12px;
	font: 600 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
	color: var(--text-main);
	word-break: break-all;
}
.boot-msg p code {
	display: inline;
	background: none;
	border: none;
	padding: 0 2px;
	font-size: 12.5px;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
