:root {
  --bg: #f4f7f9;          /* Nagyon halvány, tiszta kékesszürke a fő háttérnek */
  --panel: #ffffff;       /* Tiszta fehér a paneleknek és kártyáknak */
  --ink: #111e29;         /* Nagyon sötét kékesszürke a főszövegeknek (lágyabb, mint a fekete) */
  --ink-soft: #5a6e7f;    /* Középszürke kék tónussal a másodlagos szövegeknek */
  --accent: #1e3448;       /* Az alapszíned: a mély sötétkék mint fő kiemelőszín */
  --accent-deep: #132230;  /* Még mélyebb, sötétebb kék az accent interakcióihoz (pl. hover) */
  --water: #3498db;       /* Élénkebb, világos kék a kiegészítő funkcióknak, gomboknak */
  --line: #e2e8f0;        /* Finom, világos szürke választóvonalakhoz */
  --shadow-sm: 0 1px 3px rgba(30,52,72,0.08), 0 1px 1px rgba(30,52,72,0.04);   /* Lágy, kék tónusú árnyékok */
  --shadow-lg: 0 12px 32px rgba(30,52,72,0.12);                                /* Elegáns, finom nagy árnyék */
  --radius: 14px;
  --sidebar-w: 392px;
  --red: #e74c3c;
  --black: #000000;
  --white: #ffffff;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  width: 100%;
  height: 100%;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  font-family: verdana, sans-serif;
}

#app{ position: relative; width: 100%; height: 100%; }
#map{ position: absolute; inset: 0; }

/* ---------- Generic icon: any element with class "icon" renders the
    SVG file given in its --icon-url custom property as a CSS mask, so
    its color follows normal CSS `color` (currentColor) rather than
    anything baked into the file. All icon files live in /icons/. ---------- */
.icon{
  display: inline-block;
  flex: none;
  background-color: currentColor;
  -webkit-mask-image: var(--icon-url);
  mask-image: var(--icon-url);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* ---------- MapLibre control repositioning ---------- */
.maplibregl-ctrl-top-right{ display:none; } /* zoom moved to bottom-right, nothing else lives here */
.maplibregl-ctrl-bottom-right{ margin-bottom: 18px; margin-right: 16px; }
.maplibregl-ctrl-group{
  border-radius: 10px !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
}
.maplibregl-ctrl-attrib{ font-size: 11px; }

/* ---------- Logo, top-right, solid fill ---------- */
.logo-badge{
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.legal-box{
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 999;
  display: flex;
  align-items: right;
  gap: 8px;
  user-select: none;
  font-size: 10px;
  padding: 1px 20px 1px 10px;
  backdrop-filter: blur(10px);
  background-color: rgba(0, 0, 0, 0.1);
}

.legal-box button {
  color: var(--black);
  text-decoration: none;
  background: none;
  border: none;
  font-size: 10px;
  cursor: pointer;
}
.legal-box button:hover{ text-decoration: underline; }

.language-box span, .language-box .btn-languauge {
  white-space: nowrap;
  border-radius: 8px;
  background: var(--white);
  border: 1px var(--line) solid;
  color: var(--ink-soft);
  cursor: pointer;
  margin: 0 0 10px 0;
  text-decoration: none;
  font-size: 11px;
  padding: 10px;
}

.language-box .btn-languauge:hover {
  border: 1px var(--ink) solid;
  color: var(--ink);
}

.language-box span {
  border: 1px var(--ink) solid;
   color: var(--ink);
  font-weight: bold;
}

.language-flag {
  width: 12px;
  margin: 3px 6px 0 0;
  float: left;
}

/* ---------- Sidebar ---------- */
#sidebar{
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: var(--sidebar-w);
  max-width: calc(100% - 32px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.search-card{
  pointer-events: auto;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  flex: none;
}

.search-row{
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-row-plus{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 6px 4px 12px;
}

.search-row input{
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  padding: 9px 0;
}
.search-row input::placeholder{ color: var(--ink-soft); }

.search-btn{
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease;
}
.search-btn:hover{ background: var(--accent-deep); }
.search-btn:active{ transform: translateY(1px); }
.search-btn .icon{ width: 17px; height: 17px; }

.search-btn2{
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--white);
  border: 1px var(--line) solid;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease;
}
.search-btn2:hover{ background: var(--white); color: var(--accent); border: 1px var(--accent) solid; transform: translateY(0px); }
.search-btn2:active{ transform: translateY(1px); }
.search-btn2 .icon{ width: 17px; height: 17px; }

.chip-row-wrap{
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.chip-row{
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.chip-row::-webkit-scrollbar{ display: none; }

/* Prev/next chip-row scroll arrows — only rendered as usable when the
   row actually overflows (chip-row-wrap.scrollable) and only enabled
   on the side there's still something to scroll to; JS toggles the
   [disabled] attribute as the row scrolls. */
.chip-arrow{
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  display: none;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: opacity .15s ease, background .15s ease;
}
.chip-row-wrap.scrollable .chip-arrow{ display: grid; }
.chip-arrow:hover{ background: var(--bg); }
.chip-arrow:active{ transform: translateY(1px); }
.chip-arrow .icon{ width: 11px; height: 11px; }
.chip-arrow-right .icon{ transform: scaleX(-1); }
.chip-arrow[disabled]{
  opacity: .3;
  cursor: default;
  pointer-events: none;
}

.chip{
  flex: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.chip:hover{ border-color: var(--accent); color: var(--ink); }
.chip.active{
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip-error{
  flex: none;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 7px 2px;
}

/* ---------- Subcategory checklist — shown under the chip row once a
    main category with subcategories is active. ---------- */
.subcat-panel{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.subcat-panel-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.subcat-panel-title{
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
}
.subcat-toggle-all{
  flex: none;
  border: none;
  background: transparent;
  color: var(--water);
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
}
.subcat-toggle-all:hover{ text-decoration: underline; }

.subcat-list{
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.subcat-item{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.subcat-item input[type="checkbox"]{
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Results / detail panel ---------- */
.results-panel{
  pointer-events: auto;
  margin-top: 10px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  flex: 1 1 auto;
  min-height: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .32s cubic-bezier(.2,.8,.2,1), opacity .22s ease;
}
#sidebar.open .results-panel{
  max-height: 100%;
  opacity: 1;
}

.view{
  height: 100%;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.view.active{ display: flex; }

/* -- list view -- */
.list-head{
  flex: none;
  padding: 14px 16px 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.list-head h2{
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-soft);
}
.list-head .count{ font-weight: 500; font-size: 12px; color: var(--ink-soft); }

.result-list{
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 8px;
}

.result-card{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease;
  border-bottom: 1px solid var(--line);
}
.result-list .result-card:last-child{ border-bottom: none; }
.result-card:hover{ background: var(--bg); }

.result-pin{
  flex: none;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
}
.result-pin .icon{ width: 16px; height: 16px; color: #fff; }

.result-body{ min-width: 0; }
.result-body h3{
  margin: 0 0 2px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
}
.result-body p{
  margin: 0;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-tag{
  display: inline-block;
  margin-top: 6px;
  font-weight: 500;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent-deep);
}

.empty-state, .loading-state{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.empty-state .icon{ width: 34px; height: 34px; opacity: .5; color: var(--ink-soft); }
.loading-state .spinner{
  width: 22px; height: 22px;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* -- detail view -- */
.detail-head{
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.back-btn{
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  padding: 7px 10px 7px 6px;
  border-radius: 8px;
}
.back-btn:hover{ background: var(--bg); }
.back-btn .icon{ width: 16px; height: 16px; }

.swipe-counter{
  margin-left: auto;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.swipe-track{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.swipe-track::-webkit-scrollbar{ display: none; }

.detail-card{
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  overflow-y: auto;
  padding: 18px 20px 24px;
}

.detail-card .cat-icon{
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.detail-card .cat-icon .icon{ width: 22px; height: 22px; color: #fff; }

.detail-card h2{
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 21px;
}
.detail-card .detail-tag{
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent-deep);
}
.detail-card .detail-desc{
  margin: 14px 0 0;
  font-weight: 400;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}

.detail-meta{
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.detail-meta .row{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  font-size: 13px;
  color: var(--ink);
}
.detail-meta .row .icon{ width: 16px; height: 16px; margin-top: 1px; color: var(--ink-soft); }
.detail-meta a{ color: var(--water); text-decoration: none; }
.detail-meta a:hover{ text-decoration: underline; }

/* ---------- User location marker (person icon, live-tracked) ---------- */
.user-location-marker{
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--water);
  box-shadow: 0 0 0 5px rgba(52,152,219,.25), var(--shadow-sm);
  display: grid;
  place-items: center;
}
.user-location-glyph{
  width: 14px;
  height: 14px;
  color: #fff;
}

/* ---------- "Where am I" control button (bottom-right, above zoom) ---------- */
.maplibregl-ctrl-locate .icon{
  width: 17px;
  height: 17px;
  color: var(--ink);
  margin-top: 3px;
}

/* ---------- POI markers on the map ---------- */
.poi-marker{
  position: relative;
  width: 30px;
  height: 42px;
  cursor: pointer;
  transform-origin: bottom center;
  transition: transform .15s ease;
}
.poi-marker:hover{ transform: scale(1.08); }
.poi-marker.active{ transform: scale(1.22); }

.poi-marker .halo{
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 20px;
  height: 8px;
  margin-left: -10px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0;
}
.poi-marker.active .halo{
  opacity: .28;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse{
  0%{ transform: scale(0.6); opacity: .28; }
  100%{ transform: scale(1.6); opacity: 0; }
}

.poi-marker .pin-pole{
  position: absolute; inset: 0;
  width: 30px; height: 42px;
  color: #2b2b28;
}
.poi-marker .pin-flag{
  position: absolute; inset: 0;
  width: 30px; height: 42px;
  color: var(--accent);
  transition: color .15s ease;
}
.poi-marker.active .pin-flag{ color: var(--red); }
.poi-marker .pin-glyph{
  position: absolute;
  left: 8px; top: 6px;
  width: 11px; height: 11px;
  color: #fff;
}

/* ---------- Cluster bubble — replaces overlapping/crowded pins when
    several POIs sit within CLUSTER_PIXEL_RADIUS of each other on
    screen; tap to zoom in and split it apart. ---------- */
.poi-cluster{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(30,52,72,.18), var(--shadow-sm);
  transition: transform .15s ease;
}
.poi-cluster:hover{ transform: scale(1.08); }
.poi-cluster-count{ pointer-events: none; }

/* ---------- Mobile bottom-sheet drag handle (hidden on desktop) ---------- */
.sheet-handle{ display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 720px){
  :root{ --sidebar-w: auto; }

  /* The sidebar is now just a full-viewport positioning context — the
     search card and the results sheet are placed independently within
     it, so the map is always visible between them (Google Maps style). */
  #sidebar{
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    display: block;
    pointer-events: none;
  }

  .search-card{
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 2;
  }

  .results-panel{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin-top: 0;
    z-index: 3;
    border-radius: 18px 18px 0 0;
    max-height: none;
    opacity: 1;
    display: none;
    flex-direction: column;
    height: 50vh; /* default/fallback; JS drives the actual snap height */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: height .28s cubic-bezier(.2,.8,.2,1);
  }
  #sidebar.open .results-panel{ display: flex; }
  .results-panel.dragging{ transition: none; }
  .results-panel.dragging,
  .results-panel.dragging *{ user-select: none; }

  /* Drag handle — grab and pull the sheet between peek / half / full. A
     tap (no movement) toggles between half and full. */
  .sheet-handle{
    display: flex;
    flex: none;
    justify-content: center;
    padding: 9px 0 6px;
    cursor: grab;
    touch-action: none;
  }
  .results-panel.dragging .sheet-handle{ cursor: grabbing; }
  .sheet-handle-bar{
    width: 36px;
    height: 4px;
    border-radius: 3px;
    background: var(--line);
  }

  .view{ height: auto; flex: 1 1 auto; min-height: 0; }

  .logo-badge span.logo-text{ display: none; }
  /* Only hide the logo once the sheet is pulled all the way up. */
  body.sheet-full .logo-badge{ display: none; }
}

/**/

.mw150 {
  max-width: 150px;
  height: auto;
}

.mw50 {
  max-width: 50px;
  height: auto;
}

.mw30 {
  max-width: 30px;
  height: auto;
}

/* modal */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(7px) saturate(30%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: #ffffff;
    border-radius: 8px;
    width: 80vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    border: 5px var(--primary) solid;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px #000000 solid;
    font-size: 16px;
    font-weight: bold;
}

.modal-header-close {
    font-size: 14px;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.modal-close:hover {
    color: #000000;
}

.modal-content {
    padding: 10px 20px 20px 20px;
    overflow-y: auto;
    flex-grow: 1;
    color: #000000;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px #000000 solid;
    text-align: center;
    font-size: 12px;
    color: #aaaaaa;
}

/**/

@media only screen and (min-width: 10px) and (max-width: 400px) {
  .language-box {
    display: grid;
    grid-template-columns: repeat(1, 1fr); 
    gap: 10px;
  }
}

@media only screen and (min-width: 401px) and (max-width: 600px) {
  .language-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px;
  }
}

@media only screen and (min-width: 601px) and (max-width: 750px) {
  .language-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px;
  }
}

@media only screen and (min-width: 751px) and (max-width: 900px) {
  .language-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px;
  }
}

@media only screen and (min-width: 901px) and (max-width: 1100px) {
  .language-box {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 10px;
  }
}

@media (min-width: 1101px) {
  .language-box {
    display: grid;
    grid-template-columns: repeat(6, 1fr); 
    gap: 10px;
  }
}