/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #252836;
  --surface: #2d3143;
  --border: #3a3f55;
  --accent: #2563eb;
  --accent2: #3b82f6;
  --text: #e8eaf6;
  --text2: #9ba3c8;
  --text3: #5c6285;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --panel-w: 380px;
  --header-h: 60px;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html, body { height: 100%; font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }

/* === HEADER === */
#header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  z-index: 1010; /* above map and panel */
  backdrop-filter: blur(12px);
  /* overflow: visible so country/lang dropdowns show below header */
  overflow: visible;
  flex-wrap: nowrap;
}

.logo {
  display: flex; align-items: center; gap: 8px; font-weight: 900;
  font-size: 19px; white-space: nowrap; color: var(--text);
  text-decoration: none; letter-spacing: -0.3px;
}
.logo span:first-of-type { color: var(--accent2); font-weight: 700; }

#search-bar {
  flex: 1; max-width: 320px; min-width: 0;
  position: relative; display: flex; align-items: center;
}
#search-input {
  width: 100%; padding: 8px 36px 8px 14px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; outline: none; transition: border-color .2s;
}
#search-input:focus { border-color: var(--accent); }
#search-input::placeholder { color: var(--text3); }
.search-icon { position: absolute; right: 10px; color: var(--text3); pointer-events: none; }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
/* Progressively hide text labels as viewport narrows */
@media (max-width: 1200px) {
  #api-label { display: none; }
}
@media (max-width: 1050px) {
  #refresh-btn span, #add-listing-btn span { display: none; }
  #country-name-display { display: none; }
}

#country-selector {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font-size: 14px; color: var(--text);
  position: relative;
}
#country-selector:hover { border-color: var(--accent); }
#country-flag { font-size: 18px; }
#country-name-display { font-weight: 500; }

#country-dropdown {
  position: fixed; top: var(--header-h);
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 180px; overflow: hidden; box-shadow: var(--shadow);
  display: none; z-index: 9999;
}
#country-dropdown.open { display: block; }
.country-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  cursor: pointer; font-size: 14px; transition: background .15s;
}
.country-option:hover { background: var(--bg3); }
.country-option.active { background: rgba(79,142,247,.15); color: var(--accent); }
.country-option-flag { font-size: 18px; }

.btn {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg3); color: var(--text2); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: all .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface); color: var(--text); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #3a7de8; }

#toggle-panel-btn { display: none; }

/* === LAYOUT === */
#app {
  display: flex; height: 100vh; padding-top: var(--header-h);
}

/* === SIDE PANEL === */
#panel {
  width: var(--panel-w); flex-shrink: 0; min-width: 0;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .28s ease, transform .3s ease;
  position: relative;
}
#panel.collapsed { width: 0 !important; border-right: none; }
#panel.collapsed > * { opacity: 0; pointer-events: none; }

/* === PANEL HEADER ============================================= */
#panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 0 0; border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg2);
}

/* Filters toggle — left side of panel header */
#filters-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--text2); text-transform: uppercase; letter-spacing: .5px;
  flex: 1; user-select: none; transition: color .15s;
}
#filters-toggle:hover { color: var(--text); }
#filters-chevron { transition: transform .25s ease; margin-left: auto; }
#filters-toggle.collapsed #filters-chevron { transform: rotate(-90deg); }

/* Hide-panel button — right side of panel header */
#panel-collapse-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 10px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg3); color: var(--text2); font-size: 12px; font-weight: 500;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: all .15s;
}
#panel-collapse-btn:hover { background: var(--surface); color: var(--text); border-color: var(--accent); }
#panel-collapse-btn svg { flex-shrink: 0; }

/* Show-panel button — fixed on left edge, only shown when panel is collapsed */
#panel-show-btn {
  position: fixed; left: 0; top: calc(var(--header-h) + 40%);
  width: 22px; height: 64px; z-index: 950;
  background: var(--bg3); border: 1px solid var(--border);
  border-left: none; border-radius: 0 10px 10px 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2);
  box-shadow: 4px 0 12px rgba(0,0,0,.4);
  transition: color .15s, background .15s;
}
#panel-show-btn:hover { color: var(--text); background: var(--surface); border-color: var(--accent); }

/* Drag-to-resize handle */
#panel-resizer {
  position: absolute; right: 0; top: 0; bottom: 0; width: 5px;
  cursor: col-resize; z-index: 11; transition: background .15s;
}
#panel-resizer:hover, #panel-resizer:active { background: var(--accent); opacity: .5; }

#filters {
  padding: 14px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; overflow-x: hidden; flex-shrink: 0;
  transition: height .3s ease, opacity .25s ease;
}
/* JS sets height/overflow inline; CSS provides opacity + padding reset */
#filters.collapsed {
  opacity: 0;
  padding-top: 0; padding-bottom: 0;
  border-bottom: none;
}

/* Filters */
#filters {
  padding: 14px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; max-height: 58vh;
}

.filter-row { display: flex; gap: 8px; }
.filter-group { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
select, input[type=number] {
  width: 100%; padding: 7px 10px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: 13px; outline: none; transition: border-color .2s;
}
select:focus, input[type=number]:focus { border-color: var(--accent); }
select option { background: var(--bg3); }

/* Price range */
.range-row { display: flex; align-items: center; gap: 6px; }
.range-row input { flex: 1; }
.range-sep { color: var(--text3); font-size: 12px; }

/* Sources toggle */
.sources-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.source-chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border-radius: 7px; border: 1px solid var(--border); cursor: pointer;
  font-size: 12px; font-weight: 500; transition: all .15s; user-select: none;
  background: var(--bg3); color: var(--text2);
}
.source-chip .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.source-chip.active { background: rgba(79,142,247,.1); border-color: var(--accent); color: var(--text); }
.source-chip:hover { border-color: var(--accent); }

.filter-actions { display: flex; gap: 8px; }

/* Tabs */
#results-tabs {
  display: flex; border-bottom: 1px solid var(--border); padding: 0 14px;
  flex-shrink: 0;
}
.tab {
  padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--text3);
  cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text2); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg3); color: var(--text2); font-size: 11px;
  padding: 1px 6px; border-radius: 10px; margin-left: 4px;
}
.tab.active .tab-count { background: rgba(79,142,247,.2); color: var(--accent); }

/* Sort row */
#sort-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
#sort-row .sort-label { font-size: 12px; color: var(--text3); }
#sort-select { width: auto; padding: 4px 8px; font-size: 12px; border-radius: 6px; }

/* Listings */
#listings-container { flex: 1; overflow-y: auto; padding: 10px; }
#listings-container::-webkit-scrollbar { width: 4px; }
#listings-container::-webkit-scrollbar-track { background: transparent; }
#listings-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.listing-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; overflow: hidden; cursor: pointer;
  transition: all .18s; display: flex; flex-direction: column;
}
.listing-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,142,247,.15); }
.listing-card.highlighted { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,142,247,.3); }

.card-img {
  width: 100%; height: 140px; object-fit: cover; display: block;
  background: var(--surface);
}
.card-img-placeholder {
  width: 100%; height: 140px; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--text3);
}

.card-body { padding: 10px 12px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.card-title { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); }
.card-price { font-size: 15px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.card-price.rent::after { content: '/mėn'; font-size: 10px; font-weight: 400; color: var(--text3); }

.card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.meta-tag {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text2); background: var(--surface);
  padding: 2px 6px; border-radius: 4px;
}
.meta-tag svg { opacity: .7; }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid var(--border); margin-top: 6px;
}
.card-source {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px;
  color: #fff;
}
.card-address { font-size: 11px; color: var(--text3); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; text-align: center; color: var(--text3);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* Loading */
.skeleton {
  background: var(--bg3); border-radius: var(--radius); margin-bottom: 8px;
  height: 200px; border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--bg3) 25%, var(--surface) 50%, var(--bg3) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* === MAP === */
#map-container { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

/* Map controls overlay */
#map-controls {
  position: absolute; top: 12px; left: 12px; z-index: 500;
  display: flex; flex-direction: column; gap: 6px;
}

.map-btn {
  width: 36px; height: 36px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); font-size: 16px; transition: all .15s;
  box-shadow: var(--shadow);
}
.map-btn:hover { background: var(--surface); color: var(--text); }

/* City quick nav */
#city-nav {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 500; display: flex; gap: 6px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 20px; padding: 6px 10px;
  box-shadow: var(--shadow);
}
.city-btn {
  padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 500;
  cursor: pointer; color: var(--text2); transition: all .15s; white-space: nowrap;
}
.city-btn:hover, .city-btn.active { background: var(--accent); color: #fff; }

/* Cluster count bubble */
.cluster-bubble {
  background: var(--accent); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
  background: var(--bg2) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important; box-shadow: var(--shadow) !important;
  padding: 0 !important; overflow: hidden;
}
.leaflet-popup-content { margin: 0 !important; width: 260px !important; }
.leaflet-popup-tip { background: var(--bg2) !important; }
.leaflet-popup-close-button { color: var(--text2) !important; top: 6px !important; right: 8px !important; font-size: 18px !important; }

.popup-img { width: 100%; height: 120px; object-fit: cover; }
.popup-body { padding: 10px 12px; }
.popup-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.popup-price { font-size: 16px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.popup-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.popup-tag { font-size: 11px; background: var(--surface); color: var(--text2); padding: 2px 7px; border-radius: 4px; }
.popup-source { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; color: #fff; margin-bottom: 8px; }
.popup-link {
  display: block; text-align: center;
  background: var(--accent); color: #fff !important;
  text-decoration: none; padding: 9px 12px; border-radius: 7px;
  font-size: 13px; font-weight: 700; letter-spacing: .2px;
  transition: background .15s, transform .1s;
  border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 2px 8px rgba(37,99,235,.45);
}
.popup-link:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.6); }

/* === DEAL TYPE BADGE === */
.deal-badge {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .5px;
}
.deal-badge.sell { background: rgba(34,197,94,.15); color: var(--green); }
.deal-badge.rent { background: rgba(245,158,11,.15); color: var(--yellow); }

/* === STATS BAR === */
#stats-bar {
  display: none; align-items: center; gap: 16px; padding: 6px 14px;
  background: var(--bg3); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text3); flex-shrink: 0;
}
#stats-bar.visible { display: flex; }
.stat-item strong { color: var(--text); margin-left: 4px; }

/* Refresh button spin */
.btn.loading #refresh-icon {
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === NOTIFICATIONS === */
#notification {
  position: fixed; bottom: 20px; right: 20px; z-index: 3000;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; font-size: 13px; box-shadow: var(--shadow);
  transform: translateY(80px); opacity: 0; transition: all .3s; pointer-events: none;
}
#notification.show { transform: translateY(0); opacity: 1; }

/* === MOBILE === */
@media (max-width: 768px) {
  :root { --panel-w: 100vw; }

  #header { padding: 0 10px; gap: 6px; }
  /* Don't let search eat all space — cap at 160px on mobile */
  #search-bar { max-width: 160px; flex: 1; }
  .header-actions .btn span { display: none; }
  #country-name-display, #lang-btn-text > span:last-child { display: none; }
  /* Hide lang selector on very small screens — use country selector only */
  #lang-selector { display: none; }

  #toggle-panel-btn { display: flex; }

  #app { position: relative; }
  #panel {
    position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
    z-index: 600; transform: translateX(-100%);
  }
  #panel.open { transform: translateX(0); }

  #map-container { width: 100%; }

  #city-nav { max-width: 90vw; overflow-x: auto; }
}

/* Leaflet overrides for dark theme */
.leaflet-control-zoom a {
  background: var(--bg2) !important; color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { background: var(--surface) !important; }
.leaflet-bar { border: 1px solid var(--border) !important; }

/* === LANGUAGE SELECTOR === */
#lang-selector {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font-size: 13px; color: var(--text2);
  position: relative; white-space: nowrap;
}
#lang-selector:hover { border-color: var(--accent); color: var(--text); }
#lang-dropdown {
  position: fixed; top: var(--header-h);
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 160px; overflow: hidden; box-shadow: var(--shadow);
  display: none; z-index: 9999;
}
#country-dropdown.open, #lang-dropdown.open { display: block; }
.lang-option {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  cursor: pointer; font-size: 13px; transition: background .12s;
}
.lang-option:hover { background: var(--bg3); }
.lang-option.active { background: rgba(37,99,235,.15); color: var(--accent); }

/* === ADD LISTING BUTTON === */
#add-listing-btn {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
#add-listing-btn:hover { background: #1d4ed8; }
#add-listing-btn svg { flex-shrink: 0; }

/* === WIZARD MODAL === */
#wizard-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 4000;
  opacity: 0; pointer-events: none; transition: opacity .25s;
  backdrop-filter: blur(3px);
}
#wizard-modal {
  position: fixed; top: 50%; left: 50%; z-index: 4001;
  transform: translate(-50%, -48%) scale(.96);
  opacity: 0; pointer-events: none; transition: all .25s;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  overflow: hidden;
}
#wizard-overlay.open, #wizard-modal.open {
  opacity: 1; pointer-events: auto;
}
#wizard-modal.open { transform: translate(-50%, -50%) scale(1); }

/* Wizard header */
.wiz-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.wiz-header-left { display: flex; flex-direction: column; gap: 4px; }
.wiz-title { font-size: 17px; font-weight: 700; }
#wizard-step-title { font-size: 13px; color: var(--text2); }
.wiz-close {
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 18px; line-height: 1;
  transition: all .15s;
}
.wiz-close:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Step dots */
.wiz-steps {
  display: flex; align-items: center; gap: 6px; padding: 12px 22px 0; flex-shrink: 0;
}
.wiz-step-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: all .2s;
  flex-shrink: 0;
}
.wiz-step-dot.active { background: var(--accent); transform: scale(1.4); }
.wiz-step-dot.done { background: var(--green); }
.wiz-step-line { flex: 1; height: 1px; background: var(--border); }
.wiz-step-line.done { background: var(--green); }

/* Wizard body */
#wizard-body {
  flex: 1; overflow-y: auto; padding: 18px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
#wizard-body::-webkit-scrollbar { width: 4px; }
#wizard-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Wizard map */
#wizard-map {
  width: 100%; height: 240px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); flex-shrink: 0;
  background: var(--bg3);
}

/* Wizard fields */
.wiz-map-hint {
  font-size: 12px; color: var(--text3); text-align: center;
  padding: 6px; background: var(--bg3); border-radius: 6px;
}
.wiz-map-hint.error { color: var(--red); background: rgba(239,68,68,.08); }
.wiz-row { display: flex; gap: 12px; }
.wiz-row .wiz-field { flex: 1; }
.wiz-field { display: flex; flex-direction: column; gap: 5px; }
.wiz-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.wiz-input {
  width: 100%; padding: 8px 11px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 13px; outline: none; font-family: inherit;
  transition: border-color .2s;
}
.wiz-input:focus { border-color: var(--accent); }
.wiz-input::placeholder { color: var(--text3); }
.wiz-textarea { resize: vertical; min-height: 72px; }

/* Review table */
.wiz-review-table { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.wiz-review-row { display: flex; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.wiz-review-row:last-child { border-bottom: none; }
.wiz-review-key { color: var(--text2); width: 140px; flex-shrink: 0; font-size: 12px; }
.wiz-review-val { color: var(--text); font-weight: 500; }
.wiz-error { color: var(--red); font-size: 12px; }

/* Wizard footer */
.wiz-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 22px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.wiz-footer button { min-width: 90px; justify-content: center; }
#wiz-submit { background: var(--accent); color: #fff; border-color: var(--accent); }
#wiz-submit:hover { background: #1d4ed8; }
#wiz-submit:disabled { background: var(--bg3); color: var(--text3); border-color: var(--border); cursor: not-allowed; }

/* Custom marker */
.custom-marker {
  border-radius: 8px 8px 0 8px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; padding: 3px 6px;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.5);
  transform: rotate(0deg); border: 2px solid rgba(255,255,255,.3);
  cursor: pointer; transition: transform .15s;
}
.custom-marker:hover { transform: scale(1.1); }
.custom-marker.highlighted { transform: scale(1.15); box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(0,0,0,.5); }

/* ═══ PHOTO UPLOAD (wizard step 3) ═══ */
.wiz-drop-zone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--bg3);
}
.wiz-drop-zone:hover, .wiz-drop-zone.drag-over {
  border-color: var(--accent); background: rgba(37,99,235,.06);
}
.wiz-drop-zone.uploading { opacity: .6; pointer-events: none; }
.wiz-drop-icon { font-size: 32px; margin-bottom: 8px; }
.wiz-drop-text { font-size: 13px; color: var(--text2); margin-bottom: 10px; }
.wiz-browse-btn { font-size: 12px; padding: 6px 16px; }

.wiz-photo-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.wiz-photo-thumb {
  position: relative; width: 88px; height: 66px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--border); flex-shrink: 0;
}
.wiz-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wiz-photo-remove {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; font-size: 10px;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.wiz-photo-thumb:hover .wiz-photo-remove { opacity: 1; }
.wiz-photo-primary {
  position: absolute; bottom: 3px; left: 4px;
  font-size: 11px; color: #fbbf24; text-shadow: 0 1px 3px rgba(0,0,0,.8);
  pointer-events: none;
}

.wiz-url-toggle {
  font-size: 12px; color: var(--text3); margin-top: 8px;
}
.wiz-url-toggle summary {
  cursor: pointer; user-select: none;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.wiz-url-toggle summary::before { content: '+ '; opacity: .6; }
.wiz-url-toggle[open] summary::before { content: '− '; }

.wiz-review-photos {
  display: flex; gap: 6px; margin-bottom: 14px; overflow: hidden; border-radius: 10px;
}
.wiz-review-photos img {
  flex: 1; height: 120px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border);
}
.wiz-review-title {
  font-size: 16px; font-weight: 700; margin-bottom: 10px;
}

/* ═══ AUTH (login button + modal) ═══ */
#login-btn {
  gap: 6px; font-size: 13px;
}
#login-btn.authenticated {
  background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); color: var(--green);
}
#login-btn.authenticated:hover {
  background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: var(--red);
}

/* Login / Change-password modal */
#auth-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 5000;
  opacity: 0; pointer-events: none; transition: opacity .2s; backdrop-filter: blur(3px);
}
#auth-modal {
  position: fixed; top: 50%; left: 50%; z-index: 5001;
  transform: translate(-50%, -48%) scale(.96);
  opacity: 0; pointer-events: none; transition: all .2s;
  width: min(400px, calc(100vw - 32px));
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
#auth-modal-overlay.open, #auth-modal.open { opacity: 1; pointer-events: auto; }
#auth-modal.open { transform: translate(-50%, -50%) scale(1); }
.auth-modal-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.auth-modal-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.auth-modal-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.auth-modal-input {
  width: 100%; padding: 9px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px; outline: none;
  transition: border-color .2s; font-family: inherit;
}
.auth-modal-input:focus { border-color: var(--accent); }
.auth-error { color: var(--red); font-size: 12px; margin-top: 4px; display: none; }
.auth-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.auth-footer button { min-width: 90px; justify-content: center; }
.auth-change-pw-link {
  font-size: 12px; color: var(--text3); text-align: center;
  cursor: pointer; margin-top: 10px; text-decoration: underline;
}
.auth-change-pw-link:hover { color: var(--text); }

/* ═══ EDIT/DELETE on user cards ═══ */
.card-actions {
  display: flex; gap: 4px; margin-left: auto;
}
.card-action-btn {
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all .15s; flex-shrink: 0;
  color: var(--text2);
}
.card-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.card-action-btn.delete:hover { border-color: var(--red); color: var(--red); background: rgba(239,68,68,.08); }

/* Delete confirm overlay inside card */
.card-delete-confirm {
  position: absolute; inset: 0; background: rgba(15,23,42,.92);
  border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  z-index: 10; padding: 16px; text-align: center;
}
.card-delete-confirm p { font-size: 13px; color: var(--text); margin: 0; }
.card-delete-confirm .confirm-btns { display: flex; gap: 8px; }
