
/* Minimalist, mobile-first UI */

:root{
  --bg: rgba(255,255,255,0.78);
  --bg-strong: rgba(255,255,255,0.92);
  --text: #121212;
  --muted: rgba(18,18,18,0.70);
  --hairline: rgba(18,18,18,0.12);
  --shadow: 0 10px 30px rgba(0,0,0,0.10);
  --radius: 14px;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #fff;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

#app {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Snowout overlay (subtle) */
#snowout {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(255,255,255,0.90), rgba(255,255,255,0.00) 60%),
    radial-gradient(900px 700px at 80% 30%, rgba(255,255,255,0.55), rgba(255,255,255,0.00) 55%),
    linear-gradient(to bottom, rgba(255,255,255,0.22), rgba(255,255,255,0.10));
  mix-blend-mode: screen;
  opacity: 0.75;
}

/* Fine noise using SVG filter-like trick with repeating gradients */
#snowout::after{
  content:'';
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.06) 0px,
      rgba(255,255,255,0.06) 1px,
      rgba(255,255,255,0.00) 2px,
      rgba(255,255,255,0.00) 4px
    );
  opacity: 0.28;
}

/* Floating title block */
.title-block {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 10;
  max-width: min(320px, calc(100vw - 28px));
  padding: 0;
  user-select: none;
}

.title-block h1{
  margin: 0;
  font-size: clamp(20px, 4.8vw, 26px);
  line-height: 1.05;
  letter-spacing: -0.2px;
  font-weight: 750;
  text-shadow: 0 2px 14px rgba(255,255,255,0.85);
}

.title-block .subtitle{
  margin-top: 6px;
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 650;
  opacity: 0.75;
  text-shadow: 0 2px 14px rgba(255,255,255,0.85);
}

/* Icon button stack */
.btn-stack{
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: fit-content;
}

.icon-btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--hairline);
  background: var(--bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.icon{
  width: 18px;
  height: 18px;
  display: inline-block;
}

.icon-btn span{
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

/* Panels */
.panel{
  position: absolute;
  top: calc(max(14px, env(safe-area-inset-top)) + 88px);
  left: max(14px, env(safe-area-inset-left));
  z-index: 20;
  width: min(320px, calc(100vw - 28px));
  max-height: 60vh;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--bg-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  display: none;
}

.panel.open{ display: block; }

.panel-header{
  padding: 12px 14px 10px 14px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.panel-title{
  font-size: 14px;
  font-weight: 750;
}

.panel-body{
  padding: 12px 14px 14px 14px;
  overflow: auto;
  max-height: calc(60vh - 44px);
}

.panel small{
  color: var(--muted);
}

.section{
  margin-bottom: 12px;
}

.search{
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  padding: 10px 10px;
  font-size: 13px;
  outline: none;
  background: rgba(255,255,255,0.75);
}

.checklist{
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.check{
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 10px 10px;
  background: rgba(255,255,255,0.55);
}

.check input{
  width: 16px;
  height: 16px;
}

.check-text{
  font-size: 13px;
  font-weight: 650;
}

.swatch{
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.14);
}

.panel-footer{
  position: sticky;
  bottom: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--hairline);
  background: var(--bg-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#resultCount{
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}

.btn-clear{
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.7);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Drawer (bottom sheet) */
.drawer{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  transform: translateY(105%);
  transition: transform 220ms ease;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.drawer.open{
  transform: translateY(0%);
}

.drawer-card{
  margin: 0 10px 10px 10px;
  border-radius: 18px;
  border: 1px solid var(--hairline);
  background: var(--bg-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.drawer-handle{
  height: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
}

.drawer-handle::before{
  content:'';
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(18,18,18,0.18);
}

.drawer-body{
  padding: 12px 14px 14px 14px;
  max-height: 55vh;
  overflow: auto;
}

.drawer-top{
  display:flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.drawer h2{
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.1px;
}

.drawer-close{
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.7);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.chips{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip{
  display: inline-flex;
  align-items:center;
  gap: 8px;
  border: 1px solid var(--hairline);
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 750;
  color: var(--text);
}

.chip .tag{
  opacity: 0.55;
}

.meta{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}

.desc{
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.35;
}

.image-wrap{
  margin-top: 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--hairline);
}

.image-wrap img{
  width: 100%;
  height: auto;
  display: block;
}

.sources{
  margin-top: 12px;
  display: grid;
  gap: 8px;
  font-size: 12px;
}

.sources a{
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Loading */
#loading{
  position:absolute;
  inset:0;
  z-index: 40;
  display:none;
  align-items:center;
  justify-content:center;
  pointer-events:none;
}

.loading-card{
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 750;
  color: var(--text);
}

/* Leaflet attribution tweak: keep it tiny and quiet */
.leaflet-control-attribution{
  background: rgba(255,255,255,0.55) !important;
  border-radius: 10px !important;
  margin: 0 10px 10px 0 !important;
  padding: 6px 8px !important;
  border: 1px solid rgba(0,0,0,0.10) !important;
  backdrop-filter: blur(6px);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .drawer{ transition: none; }
}
