/* =========================
   Itinero – app.css (FULL)
   UI25 – mobile/tablet, iOS/Android safe areas
   MapKit JS map frame + RIGHT POI panel + LEFT FAB toggle
   Modern bottom tabs (icon + label) + TOP blue active highlight
   ========================= */

:root{
  --bg:#0b0f14;
  --card:#0f1620;
  --text:#e7eef7;
  --muted:#9fb0c3;
  --line:rgba(255,255,255,.08);
  --glass:rgba(15,22,32,.72);
  --radius:16px;

  --top:64px;      /* topbar height (without safe-area) */
  --tabh:56px;     /* bottom tab height (icon+label) */
  --pad:14px;

  /* Accent (blue) */
  --accent:#3c82ff;
  --accent2:#78aaff;
  --accentLine:rgba(120,170,255,.45);
  --accentSoft:rgba(60,130,255,.18);
  --accentGlow:rgba(60,130,255,.28);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:14px/1.35 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

a{color:inherit}
svg{display:block}

/* padding for safe-areas */
.topbar, .bottombar{
  padding-left: calc(var(--pad) + env(safe-area-inset-left));
  padding-right: calc(var(--pad) + env(safe-area-inset-right));
}

/* =========================
   TOPBAR
   ========================= */
.topbar{
  position:fixed; left:0; right:0; top:0;
  height: calc(var(--top) + env(safe-area-inset-top));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:nowrap;
  padding-top: env(safe-area-inset-top);
  background:var(--glass);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  z-index:100;
}

.topbar-left{
  display:flex; align-items:center; gap:10px;
  flex:1 1 auto; min-width:0;
  height: var(--top);
}
.topbar-right{
  display:flex; align-items:center; gap:10px;
  flex:0 0 auto; white-space:nowrap;
  height: var(--top);
}

/* Search */
.search{
  flex:1 1 auto;
  min-width:0;
  width:100%;
  max-width:520px;
  height:40px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:0 14px;
  outline:none;
}
.search::placeholder{color:rgba(231,238,247,.55)}
.search:disabled{opacity:.75}

/* Icon buttons */
.iconbtn{
  width:40px;height:40px;
  display:grid;place-items:center;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.08);
  text-decoration:none;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}
.iconbtn svg{width:20px;height:20px; fill:var(--text); opacity:.95}

/* Home SVG in topbar */
.tabico{
  width:22px;
  height:22px;
  fill: currentColor;
  opacity:.95;
}

/* Language select */
.langsel{
  width:72px;
  height:40px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:0 10px;
  outline:none;
}

/* =========================
   CONTENT (normal pages)
   ========================= */
.content{
  padding:
    calc(var(--top) + env(safe-area-inset-top) + 10px)
    var(--pad)
    calc(env(safe-area-inset-bottom) + var(--tabh) + 14px);
}

/* =========================
   HERO
   ========================= */
.hero{
  position:relative;
  border-radius: var(--radius);
  overflow:hidden;
  border:1px solid var(--line);
  background:#000;
  min-height:220px;
}
.hero img{
  width:100%;
  height:260px;
  object-fit:cover;
  display:block;
  opacity:.98;
  transform: scale(1.02);
}
.hero::before{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,.55) 0%,
    rgba(0,0,0,.15) 40%,
    rgba(0,0,0,.75) 100%);
  z-index:1;
}
.hero-overlay{
  position:absolute; inset:0;
  z-index:2;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding:16px;
}
.hero-title{
  font-size:24px;
  font-weight:800;
  letter-spacing:.2px;
  text-shadow: 0 2px 18px rgba(0,0,0,.55);
}
.hero-sub{
  margin-top:6px;
  color:rgba(231,238,247,.9);
  text-shadow: 0 2px 18px rgba(0,0,0,.55);
}
.hero-actions{margin-top:12px}

.btn-primary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:42px;
  padding:0 16px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:var(--text);
  font-weight:800;
  text-decoration:none;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

/* =========================
   CARDS
   ========================= */
.cards{margin-top:12px; display:grid; gap:12px}
.card{
  border-radius: var(--radius);
  border:1px solid var(--line);
  background:var(--card);
  padding:14px;
}
.card-title{font-weight:700; margin-bottom:6px}
.card-text{color:var(--muted)}

/* =========================
   BOTTOMBAR (tabs) – TOP blue accent
   ========================= */
.bottombar{
  position:fixed; left:0; right:0; bottom:0;
  background:var(--glass);
  backdrop-filter: blur(10px);
  border-top:1px solid var(--line);
  z-index:100;

  display:flex;
  gap:10px;
  align-items:center;

  padding-top: 7px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 7px);
}

/* platform tweaks */
body.platform-android .bottombar{ padding-bottom: 7px; }
body.platform-ios .bottombar{ padding-bottom: calc(env(safe-area-inset-bottom) * 0.5 + 7px); }

.tab{
  position:relative;
  flex:1 1 0;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;

  height: var(--tabh);
  border-radius: 16px;

  text-decoration:none;
  color: rgba(159,176,195,.92);

  border:1px solid rgba(255,255,255,0);
  background: rgba(255,255,255,.00);

  user-select:none;
  -webkit-tap-highlight-color: transparent;

  padding:7px 0 9px;

  transition:
    transform .16s ease,
    background .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    color .16s ease,
    filter .16s ease;
}

/* default icon */
.tab .tabicon{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  opacity:.92;
  transition: transform .16s ease, opacity .16s ease;
}

/* ak sú ikonky "filled" path-y, tak toto ich zjednotí */
.tab .tabicon path{
  fill:none;
  stroke:currentColor;
}

.tab span{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
  font-size:12px;
  font-weight:900;
  letter-spacing:.2px;
  line-height:1;
  transition: transform .16s ease, opacity .16s ease;
}

/* subtle press */
.tab:active{
  transform: translateY(0px) scale(.985);
}

/* ACTIVE – “TOP” */
.tab.active,
.tab[aria-current="page"]{
  color: var(--text);

  /* pill gradient */
  background:
    radial-gradient(120% 140% at 50% 0%,
      rgba(120,170,255,.38) 0%,
      rgba(60,130,255,.18) 36%,
      rgba(255,255,255,.08) 70%,
      rgba(255,255,255,.06) 100%);

  border-color: var(--accentLine);

  box-shadow:
    0 14px 28px rgba(0,0,0,.32),
    0 0 0 1px rgba(120,170,255,.20) inset,
    0 0 24px rgba(60,130,255,.16);
  transform: translateY(-2px);
}

/* ACTIVE icon + label pop */
.tab.active svg,
.tab[aria-current="page"] svg{
  transform: scale(1.10);
  opacity: .98;
}
.tab.active span,
.tab[aria-current="page"] span{
  transform: translateY(0px);
  opacity: 1;
}

/* ACTIVE “glow rail” (soft) */
.tab.active::before,
.tab[aria-current="page"]::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: 18px;
  pointer-events:none;
  background:
    linear-gradient(180deg,
      rgba(120,170,255,.30) 0%,
      rgba(60,130,255,.14) 50%,
      rgba(0,0,0,0) 100%);
  filter: blur(10px);
  opacity:.55;
  z-index:-1;
}

/* ACTIVE dot under label */
.tab.active::after,
.tab[aria-current="page"]::after{
  content:"";
  width:7px; height:7px;
  border-radius:999px;
  background: var(--accent2);
  box-shadow: 0 0 0 3px rgba(60,130,255,.16), 0 0 18px rgba(60,130,255,.28);
  opacity:.98;
  margin-top:2px;
}

/* Desktop hover (safe) */
@media (hover:hover){
  .tab:hover{
    color: rgba(231,238,247,.92);
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.08);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .tab, .tab svg, .tab span{ transition:none !important; }
  .tab.active, .tab[aria-current="page"]{ transform:none !important; }
}

/* =========================
   MAP PAGE (MapKit JS)
   ========================= */
body.map-page{
  height: 100dvh;
  overflow:hidden;
}

/* frame between topbar & bottombar */
.map-frame{
  position:fixed;
  left: var(--pad);
  right: var(--pad);
  top: calc(var(--top) + env(safe-area-inset-top) + 10px);

  bottom: calc(env(safe-area-inset-bottom) + var(--tabh) + 14px);

  border-radius: var(--radius);
  overflow:hidden;
  border:1px solid var(--line);
  background:rgba(0,0,0,.25);
  z-index:1;

  /* IMPORTANT: create stacking context so overlays don't disappear */
  isolation:isolate;
}

/* iOS / Android bottom tuned */
body.platform-ios .map-frame{
  bottom: calc(env(safe-area-inset-bottom) * 0.5 + var(--tabh) + 14px);
}
body.platform-android .map-frame{
  bottom: calc(var(--tabh) + 14px);
}

/* Map container */
.map-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:1;
}
#map{width:100%; height:100%}

/* =========================
   POI PANEL (RIGHT)
   ========================= */
.map-panel{
  position:absolute;
  right:10px;
  top:10px;
  left:auto;

  width:min(330px, calc(100% - 20px));
  background:rgba(15,22,32,.82);
  backdrop-filter: blur(10px);
  border:1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding:10px;
  z-index:50;

  transform: translateX(0);
  opacity:1;
  pointer-events:auto;
  transition: transform .18s ease, opacity .18s ease;
}

/* collapse -> slide out to the right */
.map-panel.collapsed{
  transform: translateX(calc(100% + 14px));
  opacity:0;
  pointer-events:none;
}
.map-panel.collapsed .panel-body{ display:none; }
.map-panel.collapsed .panel-title{ display:none; }

.panel-head{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  margin-bottom:8px;
}
.panel-title{
  font-weight:900;
  font-size:14px;
}

/* =========================
   PANEL FAB (LEFT)
   ========================= */
.panel-fab{
  position:absolute;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  z-index:55;

  width:44px;
  height:44px;
  border-radius:16px;

  background: rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.20);
  box-shadow: 0 6px 16px rgba(0,0,0,.22);

  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;

  font-weight:900;
  font-size:18px;
  line-height:1;

  user-select:none;
  -webkit-tap-highlight-color: transparent;
  cursor:pointer;
}
.panel-fab:active{ transform:translateY(-50%) scale(.98); }

/* controls inside panel */
.checkrow{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 2px;
  color:var(--text);
}
.checkrow input{ width:18px; height:18px; }

.btn{
  width:100%;
  height:38px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:var(--text);
  font-weight:800;
  margin-top:6px;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

.map-status{
  margin-top:6px;
  color:var(--muted);
  font-size:12px;
  min-height:16px;
}

/* =========================
   TABLET tweaks
   ========================= */
@media (min-width: 920px){
  :root{
    --pad:18px;
    --tabh:60px;
  }
  .content{
    max-width: 980px;
    margin: 0 auto;
  }
  .map-frame{
    left: calc(var(--pad) + 60px);
    right: calc(var(--pad) + 60px);
  }
}

/* =========================
   Auth UI tweaks
   ========================= */
.authui .search{
  font-size:17px;
  line-height:1.2;
  padding:12px 14px;
  height:48px;
}

.authui .search::placeholder{
  font-size:17px;
  opacity:.75;
}

/* aj select (štát) nech vyzerá rovnako */
.authui select.search{
  font-size:17px;
  height:48px;
  padding:12px 14px;
}

body.authui input.search,
body.authui select.search{
  font-size:18px !important;
  line-height:1.2 !important;
  padding:12px 14px !important;
  height:52px !important;
}
body.authui input.search::placeholder{
  font-size:18px !important;
  opacity:.75;
}

/* Auth UI – väčšie písmo na tlačidlách */
body.authui button{
  font-size:18px !important;
  letter-spacing:.2px !important;
  height:52px !important;
}

.card button{
  font-size:14px;
  font-weight:900;
  letter-spacing:.2px;
}

/* =========================
   Platform borders
   ========================= */
body.platform-ios .topbar{border-bottom-color:rgba(255,255,255,.10)}
body.platform-android .topbar{border-bottom-color:rgba(255,255,255,.07)}
