/* ── Directory Page — shared styles ──────────────────────────────────────── */
:root {
  --dir-bg:       #0a1612;
  --dir-bg2:      #0f1e18;
  --dir-glass:    rgba(16,32,32,0.75);
  --dir-border:   rgba(34,211,238,0.22);
  --dir-accent:   #22d3ee;
  --dir-accent2:  #06b6d4;
  --dir-text:     #f0fdf4;
  --dir-muted:    #94a3b8;
  --dir-radius:   14px;
  --dir-shadow:   0 4px 20px rgba(0,0,0,0.5);
}

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

body {
  background: linear-gradient(135deg, var(--dir-bg) 0%, var(--dir-bg2) 100%);
  color: var(--dir-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.dir-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10,22,18,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--dir-border);
  padding: 0.85rem 1rem;
  padding-top: calc(0.85rem + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dir-back {
  background: none;
  border: none;
  color: var(--dir-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  min-width: 2.5rem;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.dir-back:active {
  transform: scale(0.9);
}
.dir-title-text {
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Filter chips ─────────────────────────────────────────────────────────── */
.dir-chips-wrap {
  padding: 0.65rem 1rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dir-chips-wrap::-webkit-scrollbar { display: none; }

/* Filter čipovi: tanak vidljiv skrolbar samo na računaru (miš); dodir ostaje bez skrolbara */
@media (hover: hover) and (pointer: fine) {
  .dir-chips-wrap {
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.5) rgba(255, 255, 255, 0.07);
    padding-bottom: 0.2rem;
  }
  .dir-chips-wrap::-webkit-scrollbar {
    display: block;
    height: 8px;
  }
  .dir-chips-wrap::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
  }
  .dir-chips-wrap::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.45);
    border-radius: 4px;
  }
  .dir-chips-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 211, 238, 0.65);
  }
}

#dir-chips {
  display: flex;
  gap: 0.4rem;
  white-space: nowrap;
  padding-bottom: 0.1rem;
}
.dir-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(34,211,238,0.18);
  color: var(--dir-muted);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.dir-chip.active, .dir-chip:hover {
  background: rgba(34,211,238,0.18);
  border-color: var(--dir-accent);
  color: var(--dir-accent);
}

/* ── Main body ────────────────────────────────────────────────────────────── */
.dir-body {
  max-width: 520px;
  margin: 0 auto;
  padding: 1rem 1rem calc(2rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Section header ───────────────────────────────────────────────────────── */
.dir-sec-hdr {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dir-muted);
  margin-bottom: 0.5rem;
}

/* ── Loading / empty ──────────────────────────────────────────────────────── */
#dir-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--dir-muted);
  font-size: 0.9rem;
  display: none;
}
#dir-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--dir-muted);
  font-size: 0.9rem;
  display: none;
}

/* ── PREMIUM — hero cards ─────────────────────────────────────────────────── */
.dir-premium-wrap { display: flex; flex-direction: column; gap: 0.75rem; }

.dir-card--premium {
  display: flex;
  flex-direction: column;
  background: var(--dir-glass);
  border: 1px solid rgba(34,211,238,0.25);
  border-radius: var(--dir-radius);
  overflow: hidden;
  box-shadow: var(--dir-shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.dir-card--premium:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.6); }

.dir-card-img {
  width: 100%;
  height: 180px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(10,22,18,0.9);
}
.dir-video-wrap {
  position: relative;
  overflow: hidden;
}
.dir-card-img.dir-video-wrap  { height: 180px; }
.dir-feat-img.dir-video-wrap  { height: 130px; }
.dir-video-wrap iframe,
.dir-video-wrap > div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.dir-card-img--placeholder {
  background: linear-gradient(135deg, rgba(34,211,238,0.12) 0%, rgba(6,182,212,0.06) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dir-card-img--placeholder::after {
  content: '📷';
  font-size: 2.5rem;
  opacity: 0.3;
}
.dir-card-body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dir-card-badge {
  display: inline-block;
  background: rgba(34,211,238,0.15);
  color: var(--dir-accent);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.65rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dir-card-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.dir-card-info { flex: 1; min-width: 0; overflow: hidden; }
.dir-card-desc { font-size: 0.82rem; color: var(--dir-muted); line-height: 1.5; margin-bottom: 0.7rem; display: block; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; white-space: normal; }
.dir-card-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.5rem; }

/* ── FEATURED — horizontal scroll ────────────────────────────────────────── */
.dir-featured-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}
.dir-featured-scroll::-webkit-scrollbar { display: none; }

/* Popularno: na računaru (miš) tanak vidljiv skrolbar; na dodirnim uređajima ostaje sakriven gore */
@media (hover: hover) and (pointer: fine) {
  .dir-featured-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.5) rgba(255, 255, 255, 0.07);
    padding-bottom: 0.35rem;
  }
  .dir-featured-scroll::-webkit-scrollbar {
    display: block;
    height: 8px;
  }
  .dir-featured-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
  }
  .dir-featured-scroll::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.45);
    border-radius: 4px;
  }
  .dir-featured-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 211, 238, 0.65);
  }
}

.dir-feat-card {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  background: var(--dir-glass);
  border: 1px solid var(--dir-border);
  border-radius: var(--dir-radius);
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: var(--dir-shadow);
  cursor: pointer;
  transition: transform 0.2s;
}
.dir-feat-card:hover { transform: scale(1.02); }

.dir-feat-img {
  width: 100%;
  height: 130px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(10,22,18,0.9);
}
.dir-feat-img--placeholder {
  background: linear-gradient(135deg, rgba(34,211,238,0.1) 0%, rgba(6,182,212,0.04) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dir-feat-img--placeholder::after { content: '🏞️'; font-size: 2rem; opacity: 0.3; }
.dir-feat-body { padding: 0.65rem 0.75rem 0.75rem; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dir-feat-cat { font-size: 0.7rem; color: var(--dir-accent); font-weight: 600; margin-bottom: 0.2rem; text-transform: uppercase; letter-spacing: 0.04em; }
.dir-feat-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.3rem; line-height: 1.3; flex: 1; min-width: 0; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.dir-feat-desc { font-size: 0.75rem; color: var(--dir-muted); line-height: 1.4; margin-bottom: 0.5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.dir-feat-btns { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.4rem; }

/* ── BOOK NOW pill button ────────────────────────────────────────────────── */
@keyframes bookNowPulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(34,211,238,0.2)); }
  50%       { filter: drop-shadow(0 0 12px rgba(34,211,238,1)) drop-shadow(0 0 20px rgba(34,211,238,0.5)); }
}
.dir-btn-book-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1rem;
  background: var(--dir-accent);
  color: var(--dir-bg);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  margin-left: 0.85rem;
  animation: bookNowPulse 2.5s ease-in-out infinite;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.dir-btn-book-now:hover { opacity: 0.85; transform: scale(1.04); }
.dir-btn-book-now:active { transform: scale(0.96); }
.dir-feat-booknow { margin-top: 0.45rem; }
.dir-feat-booknow .dir-btn-book-now { margin-left: 0; }

/* ── STANDARD — compact list ──────────────────────────────────────────────── */
.dir-standard-wrap { display: flex; flex-direction: column; gap: 0.4rem; }

.dir-row {
  background: rgba(16,32,32,0.6);
  border: 1px solid rgba(34,211,238,0.12);
  border-radius: 10px;
  padding: 0.7rem 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 88px;
  gap: 0.55rem;
  cursor: pointer;
  transition: background 0.15s;
}
.dir-row:hover { background: rgba(34,211,238,0.07); }
.dir-row-top  { display: flex; align-items: flex-start; gap: 0.5rem; }
.dir-row-main { flex: 1; min-width: 0; }
.dir-row-name  { display: block; font-size: 0.88rem; font-weight: 600; white-space: normal; line-height: 1.3; word-break: break-word; }
.dir-row-cat   { display: none; }
.dir-row-desc  { display: block; font-size: 0.75rem; color: var(--dir-muted); white-space: normal; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; margin-top: 0.15rem; }
.dir-row-btns  { display: flex; gap: 0.3rem; flex-wrap: wrap; }

/* ── Shared buttons ───────────────────────────────────────────────────────── */
.dir-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 7px;
  text-decoration: none;
  border: 1px solid;
  transition: all 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
.dir-btn-call  { background: rgba(34,211,238,0.12); color: var(--dir-accent);  border-color: rgba(34,211,238,0.3); }
.dir-btn-wa    { background: rgba(34,197,94,0.12);  color: #4ade80;             border-color: rgba(34,197,94,0.3); }
.dir-btn-book  { background: rgba(168,85,247,0.12); color: #c084fc;             border-color: rgba(168,85,247,0.3); }
.dir-btn-call:hover  { background: rgba(34,211,238,0.25); }
.dir-btn-wa:hover    { background: rgba(34,197,94,0.25); }
.dir-btn-book:hover  { background: rgba(168,85,247,0.25); }

/* ── Logo avatar ──────────────────────────────────────────────────────────── */
.dir-logo {
  width: 65px;
  height: 65px;
  min-width: 65px;
  min-height: 65px;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  border: 1px solid rgba(34,211,238,0.2);
  padding: 4px;
  box-sizing: border-box;
  background: rgba(255,255,255,0.04);
}
.dir-logo--placeholder {
  width: 65px;
  height: 65px;
  min-width: 65px;
  min-height: 65px;
  background: linear-gradient(135deg, rgba(34,211,238,0.18) 0%, rgba(6,182,212,0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dir-accent);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid rgba(34,211,238,0.2);
}

/* ── Website link (premium card) ──────────────────────────────────────────── */
.dir-website-link {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--dir-muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.dir-website-link:hover { opacity: 1; color: var(--dir-accent); }

/* ── Website button ───────────────────────────────────────────────────────── */
.dir-btn-web { background: rgba(148,163,184,0.1); color: #94a3b8; border-color: rgba(148,163,184,0.25); }
.dir-btn-web:hover { background: rgba(148,163,184,0.2); }

/* Standard row logo alignment */
.dir-row { align-items: flex-start; }
.dir-row .dir-logo,
.dir-row .dir-logo--placeholder { margin-top: 0.1rem; }

@media (max-width: 360px) {
  .dir-feat-card { flex: 0 0 200px; }
  .dir-card-img  { height: 150px; }
}

/* ── Vertical centering fix — scoped to activities / food / taxi ──────────── */
/* Standard row: stretch children so logo stays left; center logo vertically with text */
body[data-dir-type="activities"] .dir-row,
body[data-dir-type="food"]       .dir-row,
body[data-dir-type="taxi"]       .dir-row       { align-items: stretch; }
/* Also center the inner top row so logo aligns with name regardless of text length */
body[data-dir-type="activities"] .dir-row-top,
body[data-dir-type="food"]       .dir-row-top,
body[data-dir-type="taxi"]       .dir-row-top   { align-items: center; }
body[data-dir-type="activities"] .dir-row .dir-logo,
body[data-dir-type="activities"] .dir-row .dir-logo--placeholder,
body[data-dir-type="food"]       .dir-row .dir-logo,
body[data-dir-type="food"]       .dir-row .dir-logo--placeholder,
body[data-dir-type="taxi"]       .dir-row .dir-logo,
body[data-dir-type="taxi"]       .dir-row .dir-logo--placeholder { margin-top: 0; }

/* Premium card: vertically center info block so title doesn't hug top */
body[data-dir-type="activities"] .dir-card-info,
body[data-dir-type="food"]       .dir-card-info,
body[data-dir-type="taxi"]       .dir-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Featured card: vertically center name inline with logo */
body[data-dir-type="activities"] .dir-feat-name,
body[data-dir-type="food"]       .dir-feat-name,
body[data-dir-type="taxi"]       .dir-feat-name { flex: unset; }

/* ── Restaurant Location button ──────────────────────────────────────────── */
.dir-btn-map { background: rgba(52,211,153,0.12); color: #6ee7b7; border-color: rgba(52,211,153,0.3); }
.dir-btn-map:hover { background: rgba(52,211,153,0.25); }

/* ── Icon-only card actions — match main app znamenitosti (.attr-icon-btn) ─ */
.dir-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
  white-space: nowrap;
  cursor: pointer;
  color: #374151;
}
.dir-icon-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  pointer-events: none;
}
.dir-icon-btn.dir-icon-map { color: #e53935; }
.dir-icon-btn.dir-icon-phone { color: #16a34a; }
.dir-icon-btn.dir-icon-web { color: #0369a1; }
.dir-icon-btn.dir-icon-wa { color: #25d366; }
.dir-icon-btn.dir-icon-book { color: #a855f7; }
.dir-icon-btn:hover {
  background: #f0f9ff;
  border-color: #bae6fd;
  transform: scale(1.08);
}
.dir-icon-btn:active { transform: scale(0.94); }
