/* ═══════════════════════════════════════════════════════════════════
   Mouza KMZ Builder — CSS
   Dark theme · 3-step wizard · Mobile-first
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --ov-bg:        #0f172a;
  --ov-surface:   #1e293b;
  --ov-border:    rgba(148,163,184,.18);
  --ov-accent:    #22d3ee;
  --ov-accent2:   #10b981;
  --ov-danger:    #f43f5e;
  --ov-text:      #e2e8f0;
  --ov-muted:     #94a3b8;
  --ov-radius:    14px;
  --ov-radius-sm: 8px;
  --step-bar-h:   52px;
  --bottom-bar-h: 56px;
}

/* ── Root ───────────────────────────────────────────────── */
.lt-overlay-root {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 500px;
  background: var(--ov-bg);
  font-family: 'Inter', 'Noto Serif Bengali', sans-serif;
  overflow: hidden;
  color: var(--ov-text);
  -webkit-tap-highlight-color: transparent;
}

/* ── Loader ─────────────────────────────────────────────── */
#lt-loader {
  display: none;
  position: absolute; inset: 0; z-index: 9000;
  background: rgba(15,23,42,.88);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
  backdrop-filter: blur(6px);
}

.lt-spinner {
  width: 38px; height: 38px;
  border: 3px solid var(--ov-border);
  border-top-color: var(--ov-accent);
  border-radius: 50%;
  animation: lt-spin .9s linear infinite;
}
@keyframes lt-spin { to { transform: rotate(360deg); } }

#lt-loader span {
  font-size: 13px; color: var(--ov-muted); font-weight: 500;
}

/* ── Step Progress Bar ──────────────────────────────────── */
.lt-step-bar {
  position: relative; z-index: 20;
  height: var(--step-bar-h);
  background: rgba(15,23,42,.97);
  border-bottom: 1px solid var(--ov-border);
  display: flex; align-items: center; justify-content: center;
  gap: 0;
}

.lt-step-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  transition: opacity .25s;
  opacity: .4; cursor: default;
}
.lt-step-item.active  { opacity: 1; }
.lt-step-item.done    { opacity: .7; }

.lt-step-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: rgba(148,163,184,.15);
  color: var(--ov-muted);
  transition: background .3s, color .3s;
}
.lt-step-item.active .lt-step-num {
  background: var(--ov-accent); color: #0f172a;
}
.lt-step-item.done .lt-step-num {
  background: var(--ov-accent2); color: #0f172a;
}

.lt-step-lbl {
  font-size: 12px; font-weight: 600;
  color: var(--ov-muted); white-space: nowrap;
  transition: color .25s;
}
.lt-step-item.active .lt-step-lbl { color: var(--ov-text); }
.lt-step-item.done   .lt-step-lbl { color: var(--ov-accent2); }

.lt-step-divider {
  width: 28px; height: 1px; flex-shrink: 0;
  background: var(--ov-border);
}

/* ── Steps ──────────────────────────────────────────────── */
.lt-step {
  display: none;
  flex-direction: column;
  height: calc(100dvh - var(--step-bar-h));
  width: 100%;
  overflow: hidden;
}
.lt-step.active {
  display: flex;
  animation: lt-fade .28s ease;
}
@keyframes lt-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Bottom Bar ─────────────────────────────────────────── */
.lt-bottom-bar {
  height: var(--bottom-bar-h);
  background: rgba(15,23,42,.97);
  border-top: 1px solid var(--ov-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; flex-shrink: 0; gap: 10px;
  z-index: 10;
}

.lt-status-text {
  font-size: 13px; font-weight: 600; color: var(--ov-muted);
  flex: 1; text-align: center; white-space: nowrap;
}

.lt-nav-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600; border: none;
  cursor: pointer; transition: all .2s;
  white-space: nowrap; flex-shrink: 0;
  font-family: inherit;
}
.lt-nav-next {
  background: var(--ov-accent); color: #0f172a;
  box-shadow: 0 2px 12px rgba(34,211,238,.25);
}
.lt-nav-next:not(:disabled):hover  { background: #67e8f9; }
.lt-nav-next:not(:disabled):active { transform: scale(.96); }
.lt-nav-next:disabled {
  background: rgba(148,163,184,.12);
  color: var(--ov-muted); cursor: not-allowed;
  box-shadow: none;
}
.lt-nav-back {
  background: transparent;
  border: 1px solid var(--ov-border);
  color: var(--ov-muted);
}
.lt-nav-back:hover  { background: rgba(255,255,255,.05); color: var(--ov-text); }
.lt-nav-back:active { transform: scale(.96); }

/* ══ STEP 1 — MAP SETUP ════════════════════════════════ */

#lt-upload-container {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.lt-upload-card {
  background: var(--ov-surface);
  border: 2px dashed var(--ov-border);
  border-radius: var(--ov-radius);
  padding: 44px 36px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 12px;
  max-width: 380px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.lt-upload-card:hover {
  border-color: var(--ov-accent);
  box-shadow: 0 0 0 4px rgba(34,211,238,.06);
}
.lt-upload-emoji { font-size: 44px; line-height: 1; }
.lt-upload-card h2 { font-size: 1.15rem; font-weight: 700; }
.lt-upload-card p  { font-size: 13px; color: var(--ov-muted); }

.lt-upload-btn-label {
  background: var(--ov-accent); color: #0f172a;
  padding: 11px 30px; border-radius: 999px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  display: inline-block; transition: background .2s, transform .15s;
  margin-top: 8px; font-family: inherit;
}
.lt-upload-btn-label:hover  { background: #67e8f9; }
.lt-upload-btn-label:active { transform: scale(.96); }

/* Interactive Workspace */
#lt-interactive-workspace {
  display: none;
  flex: 1;
  position: relative;
  background: #141b2d;
  overflow: hidden;
  touch-action: none;
}

#lt-transform-container {
  position: absolute; transform-origin: 0 0;
}
#lt-map-canvas {
  display: block;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}

/* SVG Pin Overlay */
#lt-svg-overlay {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; overflow: visible;
}
.lt-pin-container {
  pointer-events: all; cursor: pointer;
}
.lt-pin-text {
  fill: #fff; font-size: 11px; font-weight: bold;
  text-anchor: middle; dominant-baseline: central;
  pointer-events: none;
}
.lt-drag-handle {
  fill: rgba(34,211,238,.15);
  stroke: var(--ov-accent); stroke-width: 2; cursor: move;
}

/* Magnifier Lens */
.lt-magnifier-lens {
  display: none; position: absolute;
  width: 140px; height: 140px; border-radius: 50%;
  border: 4px solid var(--ov-accent);
  background-color: white; background-repeat: no-repeat;
  pointer-events: none; z-index: 300;
  box-shadow: 0 8px 32px rgba(0,0,0,.65),
              0 0 0 2px rgba(34,211,238,.35);
}
.lt-magnifier-lens::after {
  content: '+'; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #FF0000; font-size: 28px; font-weight: 300; line-height: 1;
  pointer-events: none;
}

/* Map Live Lens */
#lt-map-lens-container {
  display: none; position: absolute;
  width: 150px; height: 150px; border-radius: 50%;
  border: 4px solid var(--ov-accent); background: #222;
  overflow: hidden; pointer-events: none; z-index: 2000;
  box-shadow: 0 8px 32px rgba(0,0,0,.65),
              0 0 0 2px rgba(34,211,238,.35);
}
#lt-lens-map-mirrored { width: 100%; height: 100%; pointer-events: none; }
#lt-map-lens-crosshair {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #FF0000; font-size: 28px; font-weight: 300;
  z-index: 2001; pointer-events: none; line-height: 1;
}

/* Target dot */
.lt-target-dot {
  display: none; position: absolute;
  width: 12px; height: 12px;
  background: var(--ov-accent2); border: 2px solid #fff;
  border-radius: 50%; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 301;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* Floating action buttons (Google Maps style) */
#lt-ws-action-btns,
#lt-map-action-btns {
  position: absolute; left: 10px; bottom: 10px;
  z-index: 500; display: flex; flex-direction: column; gap: 6px;
}
#lt-ws-action-btns button,
#lt-map-action-btns button {
  width: 40px; height: 40px;
  background: #fff; border: none; border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; color: #555;
  transition: background .15s;
}
#lt-ws-action-btns button:hover:not(:disabled),
#lt-map-action-btns button:hover:not(:disabled) { background: #f5f5f5; }
#lt-ws-action-btns button:active:not(:disabled),
#lt-map-action-btns button:active:not(:disabled) { background: #ebebeb; }
#lt-ws-action-btns button:disabled,
#lt-map-action-btns button:disabled { opacity: .35; cursor: not-allowed; }

/* ══ STEP 2 — GEO POINTS ═══════════════════════════════ */

#lt-map-wrapper {
  flex: 1; width: 100%; position: relative;
}
#lt-map-container { width: 100%; height: 100%; }

/* Search widget */
#lt-map-search-widget {
  position: absolute; top: 10px; left: 10px;
  z-index: 500; display: flex; align-items: center;
}
#lt-map-search-toggle {
  width: 40px; height: 40px; background: #fff;
  border: none; border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; flex-shrink: 0;
  transition: background .15s;
}
#lt-map-search-toggle:active { background: #f3f4f6; }

#lt-map-search-panel {
  display: flex; align-items: center; background: #fff;
  border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.3);
  overflow: hidden; max-width: 0; opacity: 0; margin-left: 6px;
  transition: max-width .3s ease, opacity .25s ease;
}
#lt-map-search-panel.open { max-width: 270px; opacity: 1; }

#lt-map-search {
  border: none; outline: none; padding: 9px 12px;
  font-size: 14px; width: 215px; background: transparent;
  font-family: 'Inter', sans-serif; color: #111;
}
#lt-map-search::placeholder { color: #9ca3af; }

#lt-map-search-close {
  background: none; border: none; padding: 0 10px; cursor: pointer;
  color: #888; font-size: 16px; line-height: 1; box-shadow: none;
  height: 38px; display: flex; align-items: center; justify-content: center;
}
#lt-map-search-close:hover { color: #333; }

/* GPS button */
.lt-gps-btn {
  position: absolute; bottom: 126px; right: 10px;
  width: 40px; height: 40px; background: #fff;
  border-radius: 2px; display: none; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer;
  z-index: 500; border: none; transition: background .15s;
}
.lt-gps-btn:active { background: #f3f4f6; }

/* ══ STEP 3 — KMZ EXPORT ════════════════════════════════ */

.lt-export-container {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.lt-export-card {
  background: var(--ov-surface);
  border: 1px solid var(--ov-border);
  border-radius: var(--ov-radius);
  padding: 44px 36px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 18px;
  max-width: 380px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.lt-export-emoji { font-size: 44px; line-height: 1; }
.lt-export-card h2 { font-size: 1.15rem; font-weight: 700; }
.lt-export-hint  { font-size: 13px; color: var(--ov-muted); min-height: 18px; }

.lt-field { width: 100%; text-align: left; }
.lt-field label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--ov-muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 6px;
}
.lt-input {
  width: 100%;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--ov-border);
  border-radius: var(--ov-radius-sm);
  color: var(--ov-text); padding: 10px 13px;
  font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.lt-input:focus {
  border-color: var(--ov-accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,.12);
}

.lt-export-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 20px; border-radius: var(--ov-radius-sm);
  background: var(--ov-accent2); color: #0f172a;
  font-size: 14px; font-weight: 700; border: none; cursor: pointer;
  transition: background .2s, transform .15s;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(16,185,129,.3);
}
.lt-export-btn:hover  { background: #34d399; }
.lt-export-btn:active { transform: scale(.97); }

/* ── Toast ──────────────────────────────────────────────── */
.lt-toast {
  position: absolute;
  top: calc(var(--step-bar-h) + 12px);
  left: 50%; transform: translateX(-50%);
  z-index: 8000;
  background: rgba(15,23,42,.97);
  border: 1px solid var(--ov-border);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 13px; font-weight: 500;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
  white-space: nowrap;
  animation: lt-toast-in .22s ease;
  pointer-events: none;
}
.lt-toast.success { border-color: var(--ov-accent2); color: var(--ov-accent2); }
.lt-toast.error   { border-color: var(--ov-danger);  color: var(--ov-danger); }
.lt-toast.info    { border-color: var(--ov-accent);  color: var(--ov-accent); }

@keyframes lt-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 540px) {
  .lt-step-lbl  { display: none; }
  .lt-step-divider { width: 20px; }
  .lt-step-item { padding: 6px 8px; }
  .lt-nav-btn   { padding: 9px 14px; font-size: 12px; }

  .lt-upload-card  { padding: 32px 20px; }
  .lt-export-card  { padding: 32px 20px; }
}
