/* Light-O-Rama Global Showcase widget.
   Tokens match store.lightorama.com: Poppins, #3294eb accent, #484b57 / #6b6f81 text. */
:root {
  --blue: #3294eb;
  --blue-dark: #1f78c8;
  --ink: #292929;
  --heading: #484b57;
  --text: #6b6f81;
  --line: #e6e8ee;
  --soft: #f6f7f9;
  --red: #990000;
  --bulb-red: #ff3b3b;
  --night-1: #173a6e;
  --night-2: #0a1c3d;
  --night-3: #040b1a;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(8, 20, 45, 0.28);
  --topbar-h: 84px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.5 Poppins, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--heading); font-weight: 500; margin: 0; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 18px;
  font-size: 14px; font-weight: 500; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { border-color: var(--blue); color: var(--blue); background: #fff; }
.btn-outline:hover { background: #eef6fe; }
.btn-ghost { border-color: var(--line); background: #fff; color: var(--heading); }
.btn-ghost:hover { border-color: var(--heading); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App shell ---------- */
.app { display: flex; flex-direction: column; height: 100%; min-height: 600px; }

.topbar {
  display: grid; grid-template-columns: minmax(220px, 400px) auto 1fr; align-items: center; gap: 24px;
  height: var(--topbar-h); padding: 0 20px; flex: none;
}

.search { position: relative; }
.search input {
  width: 100%; height: 50px; padding: 0 84px 0 22px;
  border: 2px solid var(--ink); border-radius: 999px; background: #fff;
  font: 500 17px Poppins, sans-serif; color: var(--ink); outline: none; transition: box-shadow .15s;
}
.search input::placeholder { color: #9a9daa; font-weight: 400; }
.search input:focus { box-shadow: 0 0 0 4px rgba(50, 148, 235, .18); }
.search-go, .search-clear {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer; color: var(--ink); display: grid; place-items: center;
}
.search-go { right: 12px; width: 36px; height: 36px; }
.search-go svg { width: 24px; height: 24px; }
.search-clear { right: 48px; width: 28px; height: 28px; font-size: 22px; color: #9a9daa; visibility: hidden; }
.search.has-value .search-clear { visibility: visible; }

.search-suggest, .place-suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px;
  list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(20, 30, 60, .16); max-height: 360px; overflow: auto;
}
.search-suggest li, .place-suggest li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.search-suggest li:hover, .search-suggest li.active, .place-suggest li:hover, .place-suggest li.active { background: #eef6fe; }
.search-suggest li.none, .place-suggest li.none { color: var(--text); cursor: default; background: none; }
.ss-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 14px; background: #eef6fe; color: var(--blue); }
.ss-icon.show { background: #fff1f1; color: var(--bulb-red); }
.ss-text { display: grid; line-height: 1.3; min-width: 0; }
.ss-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-text small { color: var(--text); font-size: 12px; }

.stats { display: flex; gap: 14px; }
.stat {
  display: grid; justify-items: center; align-content: center; min-width: 82px; height: 64px; padding: 0 12px;
  background: var(--blue); color: #fff; border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12);
}
.stat-label { font-size: 12px; font-weight: 500; letter-spacing: .02em; opacity: .95; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }

.brand { justify-self: end; display: grid; justify-items: end; }
.brand img { width: 210px; height: auto; display: block; }
.brand span { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: -4px; letter-spacing: .02em; }

.layout {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 360px; gap: 16px; padding: 0 20px 20px;
}

/* ---------- Stage (globe + map) ---------- */
.stage {
  position: relative; overflow: hidden; border-radius: var(--radius); min-height: 420px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 48%, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%);
  isolation: isolate;
}
/* Starfield */
.stage::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .8; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 72%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 84%, #cfe6ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 81% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 61%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 88%, #ffe9b0 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 46%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 20% 44%, #cfe6ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 96% 92%, #fff 50%, transparent 51%);
  background-size: 340px 300px;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .45; } to { opacity: .9; } }

.stage .view { position: absolute; inset: 0; transition: opacity .65s ease, transform .75s cubic-bezier(.3, .6, .2, 1); }
.view-globe { opacity: 0; transform: scale(.94); }
.stage.ready .view-globe { opacity: 1; transform: none; }
.view-map { opacity: 0; pointer-events: none; }
.stage.is-map .view-globe { opacity: 0; transform: scale(1.7); pointer-events: none; }
.stage.is-map .view-map { opacity: 1; pointer-events: auto; }
.stage.is-map .stage-hint { opacity: 0; }

.globe-tip {
  display: grid; background: rgba(8, 18, 40, .9); color: #fff; padding: 6px 10px; border-radius: 8px;
  font: 12px/1.35 Poppins, sans-serif; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .12);
}
.globe-tip b { font-weight: 600; }
.globe-tip span { opacity: .75; }

/* Christmas-light loader */
.stage-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 16px; pointer-events: none; transition: opacity .4s; z-index: 5; }
.stage.ready:not(.loading-map) .stage-loader { opacity: 0; }
.stage.loading-map .stage-loader { opacity: 1; }
.stage-loader span { width: 12px; height: 18px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; animation: bulb 1.2s ease-in-out infinite; }
.stage-loader span:nth-child(5n+1) { --c: #ff3b3b; }
.stage-loader span:nth-child(5n+2) { --c: #ffc93c; animation-delay: .15s; }
.stage-loader span:nth-child(5n+3) { --c: #3ddc84; animation-delay: .3s; }
.stage-loader span:nth-child(5n+4) { --c: #5ab4ff; animation-delay: .45s; }
.stage-loader span:nth-child(5n+5) { --c: #ff8a3d; animation-delay: .6s; }
@keyframes bulb { 0%, 100% { background: var(--c); box-shadow: 0 0 14px 3px var(--c); } 50% { background: color-mix(in srgb, var(--c) 30%, #111); box-shadow: none; } }

.chip {
  position: absolute; top: 14px; left: 14px; z-index: 6;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px;
  border: 0; border-radius: 999px; background: #fff; color: var(--heading); font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18); cursor: pointer;
}
.chip svg { width: 20px; height: 20px; color: var(--blue); }
.chip:hover { color: var(--blue); }

.zoom-controls {
  position: absolute; right: 14px; bottom: 14px; z-index: 6; display: grid;
  background: rgba(255, 255, 255, .95); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
.stage.is-map .zoom-controls { bottom: 34px; }
.zoom-controls button { width: 40px; height: 40px; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--heading); }
.zoom-controls button + button { border-top: 1px solid var(--line); }
.zoom-controls button:hover { background: #eef6fe; color: var(--blue); }

.stage-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; margin: 0;
  padding: 6px 14px; border-radius: 999px; background: rgba(4, 11, 26, .55); color: rgba(255, 255, 255, .85);
  font-size: 12px; white-space: nowrap; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(4px);
}

/* MapLibre tweaks */
.view-map .maplibregl-ctrl-attrib { font: 11px Poppins, sans-serif; }

/* ---------- Popup card ---------- */
.popup { position: absolute; left: 0; top: 0; z-index: 10; pointer-events: none; will-change: transform; }
.popup.behind { opacity: 0; }
.pop-card {
  position: relative; width: 300px; background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  pointer-events: auto; animation: pop-in .22s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.pop-card::after {
  content: ''; position: absolute; left: var(--arrow-x, 50%); bottom: -7px; width: 14px; height: 14px; margin-left: -7px;
  background: #fff; transform: rotate(45deg); border-radius: 2px;
}
.popup.below .pop-card::after { bottom: auto; top: -7px; }
.popup.docked { left: 10px; right: 10px; top: auto; bottom: 10px; transform: none !important; }
.popup.docked .pop-card { width: auto; max-width: 440px; margin: 0 auto; }
.popup.docked .pop-card::after { display: none; }

.pop-close {
  position: absolute; right: 8px; top: 8px; z-index: 2; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; backdrop-filter: blur(4px);
}
.pop-close:hover { background: rgba(0, 0, 0, .7); }
.pop-media { position: relative; height: 140px; border-radius: 14px 14px 0 0; overflow: hidden; background: #0a1c3d; }
.popup.docked .pop-media { height: 110px; }
.pop-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.pop-placeholder { background: radial-gradient(ellipse at 50% 120%, #1b4a8a, #081733 70%); display: grid; align-items: center; }
.pop-placeholder svg { width: 100%; height: 90px; }
.pop-play {
  position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border: 0; border-radius: 50%;
  background: rgba(255, 0, 0, .9); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
.pop-play svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }
.pop-body { padding: 12px 16px 14px; }
.pop-body h3 { font-size: 18px; line-height: 1.25; font-weight: 600; color: var(--ink); padding-right: 10px; }
.pop-loc { display: flex; align-items: center; gap: 4px; margin: 4px 0 0; font-size: 14px; color: var(--heading); }
.pop-loc svg { width: 15px; height: 15px; fill: var(--bulb-red); flex: none; }
.pop-meta { margin: 2px 0 0; font-size: 13px; }
.pop-desc { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
.pop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pop-actions:empty { display: none; }
.pop-pager { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 4px 6px; font-size: 12px; }
.pop-pager button { width: 34px; height: 30px; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--blue); border-radius: 8px; }
.pop-pager button:hover { background: #eef6fe; }

/* ---------- Side panel ---------- */
.panel {
  display: flex; flex-direction: column; min-height: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 17px; font-weight: 600; line-height: 1.2; }
.panel-head p { margin: 0; font-size: 12px; }
.show-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.show-item {
  display: flex; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; border: 0; background: none; cursor: pointer;
}
.show-item:hover, .show-item:focus-visible { background: var(--soft); outline: none; }
.bulb {
  flex: none; width: 10px; height: 14px; margin-top: 8px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--c); box-shadow: 0 0 8px 1px var(--c);
}
.si-body { display: grid; min-width: 0; line-height: 1.4; }
.si-name { font-size: 18px; font-weight: 400; color: var(--ink); margin-bottom: 2px; }
.si-line { font-size: 14px; color: var(--heading); }
.si-link { font-size: 14px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; margin-top: 2px; }
.list-empty, .list-more { padding: 24px 16px; text-align: center; font-size: 14px; }
.list-more { padding: 12px 16px 18px; font-size: 13px; }

/* ---------- Modals ---------- */
.modal {
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text);
}
.modal::backdrop { background: rgba(4, 11, 26, .6); backdrop-filter: blur(2px); }
.modal[open] { animation: pop-in .2s ease-out; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 8px; }
.modal-head h2 { font-size: 22px; font-weight: 600; color: var(--ink); }
.modal-head p { margin: 2px 0 0; font-size: 14px; }
.modal-x { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--text); padding: 0 4px; }
.modal-x:hover { color: var(--ink); }

.submit-form { padding: 8px 24px 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--heading); align-content: start; }
.form-grid em { color: var(--red); font-style: normal; }
.opt { font-weight: 400; color: var(--text); }
.span2 { grid-column: span 2; }
.form-grid input:not([type="checkbox"]):not([type="file"]), .form-grid select, .form-grid textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d4d7df; border-radius: 10px; background: #fff;
  font: 14px Poppins, sans-serif; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.form-grid textarea { resize: vertical; min-height: 76px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(50, 148, 235, .18); }
.form-grid .invalid { border-color: var(--red) !important; }
.form-grid input[type="file"] { font: 13px Poppins, sans-serif; }
.hint { font-size: 12px; font-weight: 400; color: var(--text); }
.field-error { font-size: 12px; font-weight: 400; color: var(--red); }
.field-error:empty { display: none; }
.char-count { float: right; margin-left: 8px; font-weight: 400; font-size: 12px; color: var(--text); }
.place-picker { position: relative; }
.photo-preview img { max-height: 120px; border-radius: 10px; margin-top: 4px; display: block; }
.check { display: flex !important; gap: 10px !important; align-items: flex-start; font-weight: 400 !important; font-size: 13px !important; color: var(--text) !important; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--blue); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-alert { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #fdecec; color: var(--red); font-size: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.submit-success { padding: 12px 24px 32px; text-align: center; }
.submit-success h3 { font-size: 20px; font-weight: 600; color: var(--ink); }
.submit-success p { margin: 6px auto 20px; max-width: 380px; }
.success-bulbs { display: flex; justify-content: center; gap: 14px; margin: 10px 0 16px; }
.success-bulbs i { width: 14px; height: 20px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; animation: bulb 1.2s ease-in-out infinite; }
.success-bulbs i:nth-child(1) { --c: #ff3b3b; }
.success-bulbs i:nth-child(2) { --c: #ffc93c; animation-delay: .15s; }
.success-bulbs i:nth-child(3) { --c: #3ddc84; animation-delay: .3s; }
.success-bulbs i:nth-child(4) { --c: #5ab4ff; animation-delay: .45s; }
.success-bulbs i:nth-child(5) { --c: #ff8a3d; animation-delay: .6s; }

.video-modal { width: min(900px, calc(100vw - 24px)); background: #000; }
.video-modal .modal-head { padding: 12px 16px; }
.video-modal .modal-head h2 { color: #fff; font-size: 16px; }
.video-modal .modal-x { color: #fff; }
.video-frame { aspect-ratio: 16 / 9; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr 300px; }
  .brand img { width: 170px; }
  .si-name { font-size: 16px; }
}
@media (max-width: 860px) {
  :root { --topbar-h: auto; }
  .app { height: auto; }
  .topbar { grid-template-columns: 1fr auto; gap: 12px; padding: 12px 16px; }
  .brand { grid-row: 1; grid-column: 1; justify-self: start; }
  .brand img { width: 150px; }
  .stats { grid-row: 1; grid-column: 2; gap: 8px; }
  .stat { min-width: 64px; height: 52px; }
  .stat-value { font-size: 20px; }
  .search { grid-column: 1 / -1; }
  .search input { height: 46px; font-size: 16px; }
  .layout { grid-template-columns: 1fr; padding: 0 12px 12px; gap: 12px; }
  .stage { height: 68vh; min-height: 380px; }
  .panel { max-height: 520px; }
  .stage-hint { display: none; }
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .modal-head, .submit-form { padding-left: 16px; padding-right: 16px; }
  .panel-head .btn { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.lbl { display: block; }
