/* =========================
   GLOBAL
========================= */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

/* =========================
   MAP
========================= */
#map {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

/* =========================
   FILTER PANEL
========================= */
.filter-panel {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10;

  width: 300px;
  max-height: 96vh;
  overflow-y: auto;
  overflow-x: visible;

  background: white;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  box-sizing: border-box;
}

.filter-panel h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.filter-panel p {
  margin: 6px 0 16px;
  font-size: 15px;
}

.filter-panel label {
  display: block;
  margin-top: 14px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 15px;
}

.filter-panel select {
  display: none !important;
}

/* ONLY reset button should be blue */
.filter-panel > button {
  width: 100%;
  height: 44px;
  margin-top: 18px;
  padding: 0 12px;
  border-radius: 8px;
  border: none;
  background: #0b00a8;
  color: white;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

/* =========================
   CUSTOM DROPDOWN CLEAN STYLE
========================= */
.custom-dropdown {
  width: 100%;
  margin-bottom: 14px;
  position: relative;
}

.custom-dropdown-trigger {
  width: 100%;
  height: 42px;
  padding: 0 12px;

  border: 1px solid #bbb;
  border-radius: 8px;

  background: white !important;
  color: #111 !important;

  font-size: 14px;
  font-weight: 400;
  text-align: left;

  display: flex;
  align-items: center;
  justify-content: space-between;

  cursor: pointer;
  box-shadow: none;
}

.custom-dropdown-trigger::after {
  content: "▾";
  font-size: 14px;
  color: #444;
}

.custom-dropdown-menu {
  display: none;
  position: absolute;

  top: calc(100% + 6px);
  left: 0;

  width: 100%;
  max-height: 210px;
  overflow-y: auto;

  background: white;
  border: 1px solid #bbb;
  border-radius: 8px;

  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
  z-index: 999999;
}

.custom-dropdown.open .custom-dropdown-menu {
  display: block;
}

.custom-dropdown-option {
  padding: 9px 12px;
  border-radius: 7px;

  font-size: 14px;
  font-weight: 400;
  color: #111;

  cursor: pointer;
}

.custom-dropdown-option:hover {
  background: #f1f1f1;
}

.custom-dropdown-option.selected {
  background: #0b00a8;
  color: white;
}

/* =========================
   RESTAURANT COUNT
========================= */
.restaurant-count {
  margin-top: 14px;
  font-size: 16px;
  color: #222;
}

.restaurant-count span {
  color: #0b00a8;
  font-weight: 800;
}

/* =========================
   LEGEND
========================= */
.legend {
  margin-top: 22px;
}

.legend h3 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 800;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 15px;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}

.dot.mexican { background: #2a9d8f; }
.dot.italian { background: #5d6eeb; }
.dot.middle-eastern { background: #e63946; }
.dot.caribbean { background: #b83be9; }
.dot.burgers { background: #8b4801; }
.dot.indian { background: #0b00a8; }
.dot.chinese { background: #bfff00; }
.dot.american { background: #ff7700; }
.dot.vietnamese { background: #650cd9; }
.dot.southern { background: #1ac030; }
.dot.australian { background: #02c9d0; }
.dot.belgian { background: #c8aeff; }
.dot.eastern-european { background: #ff5fdc; }
.dot.colombian { background: #7b1616; }

/* =========================
   MAPBOX POPUP
========================= */
.mapboxgl-popup-content {
  border-radius: 12px;
  padding: 14px;
  max-width: 320px;
}

.popup-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 5px;
}

.popup-location {
  font-size: 12px;
  color: gray;
  margin-bottom: 10px;
}

.popup-category {
  color: #0b00a8;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.more-btn {
  margin-top: 10px;
  padding: 9px 12px;
  border: none;
  background: black;
  color: white;
  border-radius: 7px;
  cursor: pointer;
  width: 100%;
  font-weight: 700;
}

.more-btn:hover {
  background: #333;
}

/* =========================
   VIDEO MODAL
========================= */
#videoModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;

  background: rgba(0,0,0,0.9);

  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
}

#carouselWrapper {
  width: 100vw;
  height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  background: transparent;
  position: relative;
}

#carousel {
  width: 100%;
  height: 100%;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 0;
  overflow: hidden;
}

.carousel-video {
  width: 100%;
  height: 100%;

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

  text-align: center;
  color: white;
  overflow: hidden;
}

.open-tiktok {
  display: none;
}

/* =========================
   VIDEO FRAME + HEADER
========================= */
.video-frame {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;

  padding-top: 76px;
}

.video-header {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  z-index: 999999;

  min-height: 52px;
  padding: 8px 10px 8px 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  background: rgba(0,0,0,0.72);
  color: white;
  border-radius: 18px;
  backdrop-filter: blur(10px);

  animation: headerFadeIn 0.28s ease;
}

.video-info {
  min-width: 0;
  text-align: left;
}

.video-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-location {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.video-views {
  padding: 6px 9px;
  border-radius: 999px;

  background: rgba(255,255,255,0.16);
  color: white;

  font-size: 11px;
  font-weight: 700;
}

.video-close {
  width: 32px;
  height: 32px;

  border-radius: 50%;
  border: none;

  background: rgba(255,255,255,0.18);
  color: white;

  font-size: 21px;
  line-height: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

.video-frame iframe {
  width: calc(100vh * 9 / 16);
  height: calc(100vh - 96px);

  max-width: 100vw;
  max-height: 100vh;

  border-radius: 20px;
  background: black;
  border: none;
}

@keyframes headerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   VIDEO ARROWS
========================= */
.nav-buttons {
  position: absolute;
  inset: 0;
  z-index: 1002;
  pointer-events: none;
}

.nav-buttons .prev {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-buttons .next {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-buttons button {
  pointer-events: auto;

  width: 60px;
  height: 60px;

  border-radius: 50%;
  border: none;

  background: rgba(0,0,0,0.5);
  color: white;

  font-size: 26px;
  font-weight: bold;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(6px);
  transition: 0.2s ease;
  opacity: 0.7;
}

.nav-buttons button:hover {
  background: rgba(0,0,0,0.8);
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.nav-buttons button.disabled {
  opacity: 0.2;
  pointer-events: none;
}

/* Hide duplicate generated arrows/counters */
#videoCounter,
.video-counter,
.counter,
#swipeHint,
#carousel .nav-buttons,
.carousel-video .nav-buttons {
  display: none !important;
}

/* =========================
   ADD RESTAURANT BUTTON
========================= */
.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;

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

  width: auto;
  height: 52px;
  padding: 0 30px;
  border-radius: 100px;

  background: #0b00a8;
  color: white;
  border: none;
  cursor: pointer;

  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(11, 0, 168, 0.3);
  transition: 0.25s ease;
}

.fab:hover {
  transform: scale(1.07);
  background: #1a0dab;
}

.fab svg {
  flex-shrink: 0;
}

/* =========================
   DARK MODE BUTTON
========================= */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;

  padding: 10px 16px;
  border: none;
  border-radius: 100px;

  background: white;
  color: #111;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;

  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.theme-toggle.dark {
  background: #111;
  color: white;
}

/* =========================
   BACK TO INTRO BUTTON
========================= */
.back-intro-btn {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;

  display: none;

  background: white;
  color: #111;
  border: none;
  padding: 10px 16px;
  border-radius: 100px;
  font-weight: 700;
  cursor: pointer;

  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* =========================
   INTRO SCREEN
========================= */
#introScreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #0b00a8, #ff0050);

  display: flex;
  align-items: center;
  justify-content: center;

  transition: opacity 0.5s ease;
}

#introScreen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-card {
  width: 90vw;
  max-width: 900px;
  padding: 60px 50px;

  border-radius: 24px;

  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);

  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.intro-card h1 {
  margin: 0 0 20px;
  font-size: 64px;
}

.intro-card p {
  font-size: 24px;
  line-height: 1.5;
  margin-bottom: 30px;
  color: #444;
}

.intro-card button {
  margin-top: 20px;
  padding: 16px 32px;
  border: none;
  border-radius: 999px;
  background: #0b00a8;
  color: white;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
}

/* =========================
   MOBILE RESPONSIVE
========================= */
@media (max-width: 600px) {
  .filter-panel {
    width: calc(100vw - 60px);
    max-height: 60vh;
    top: 15px;
    left: 15px;
    padding: 18px;
  }

  .filter-panel h2 {
    font-size: 24px;
  }

  .filter-panel p {
    font-size: 15px;
  }

  .fab {
    left: 20px;
    right: 20px;
    bottom: 20px;
    width: auto;
  }
}

/* =========================
   PORTRAIT / KIOSK SCALE
========================= */
@media (orientation: portrait) {
  .video-frame iframe {
    width: 100vw !important;
    height: calc(100vw * 16 / 9) !important;
    max-height: calc(100vh - 96px) !important;
    max-width: 100vw !important;
  }
}

@media (orientation: portrait) and (min-width: 900px) {
  body {
    font-size: 1.4em;
  }

  .filter-panel {
    width: 420px;
    padding: 30px;
    border-radius: 24px;
  }

  .filter-panel h2 {
    font-size: 36px;
  }

  .filter-panel p {
    font-size: 22px;
  }

  .filter-panel label {
    font-size: 20px;
  }

  .filter-panel button {
    font-size: 20px;
    padding: 18px;
  }

  .custom-dropdown-trigger {
    height: 56px;
    font-size: 20px;
    padding: 0 18px;
  }

  .custom-dropdown-option {
    font-size: 18px;
    padding: 12px 14px;
  }

  .legend h3 {
    font-size: 24px;
  }

  .legend-row {
    font-size: 18px;
  }

  .dot {
    width: 18px;
    height: 18px;
  }

  .mapboxgl-popup-content {
    max-width: 420px;
    padding: 20px;
    border-radius: 16px;
  }

  .popup-title {
    font-size: 22px;
  }

  .popup-location {
    font-size: 16px;
  }

  .popup-category {
    font-size: 14px;
  }

  .more-btn {
    font-size: 18px;
    padding: 14px;
  }

  .theme-toggle,
  .back-intro-btn {
    font-size: 18px;
    padding: 14px 20px;
  }

  .fab {
    height: 70px;
    padding: 0 40px;
    font-size: 20px;
  }
}

/* =========================
   VIRAL SIZE LEGEND
========================= */
.size-legend {
  position: fixed;
  right: 20px;
  bottom: 110px;
  z-index: 10;

  width: 220px;
  background: white;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}

.size-legend h3 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
}

.size-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.size-row p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.size-dot {
  display: inline-block;
  border-radius: 50%;
  background: #0b00a8;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}

.size-dot.small {
  width: 14px;
  height: 14px;
}

.size-dot.medium {
  width: 28px;
  height: 28px;
}

.size-dot.large {
  width: 46px;
  height: 46px;
}

.size-note {
  margin-top: 10px;
  font-size: 13px;
  color: #555;
}

/* =========================
   SIMPLER VIDEO HEADER
========================= */

.video-location {
  display: none;
}

.video-header {
  min-height: 44px;
  padding: 6px 10px 6px 14px;
  border-radius: 999px;
}

.video-title {
  font-size: 15px;
}

.video-views {
  font-size: 11px;
  padding: 5px 8px;
}

.video-close {
  width: 30px;
  height: 30px;
}

.save-btn {
  margin-top: 8px;
  padding: 9px 12px;
  border: none;
  background: #0b00a8;
  color: white;
  border-radius: 7px;
  cursor: pointer;
  width: 100%;
  font-weight: 700;
}

.qr-box {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.viral-slider-card {
  margin-top: 8px;
  margin-bottom: 18px;
  padding: 14px 16px;

  background: white;
  border: 1px solid #bbb;
  border-radius: 12px;

  color: #111;
}

.viral-slider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#viralLevelLabel {
  font-size: 16px;
  font-weight: 600;
}

#viralLevelValue {
  background: #0b00a8;
  color: white;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.slider-wrap {
  position: relative;
  padding-top: 6px;
}

#viralBubble {
  display: none;
}

#viewsFilter {
  display: block !important;
  width: 100%;
  height: 6px;

  accent-color: #0b00a8;
  cursor: pointer;
}

.viral-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;

  font-size: 12px;
  color: #555;
}

.sound-hint {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);

  z-index: 999999;

  background: rgba(0,0,0,0.72);
  color: white;

  padding: 8px 14px;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;

  opacity: 1;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.sound-hint.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
}