/* --- CSS Variables & Reset --- */
:root {
  --primary: #990000;
  --primary-hover: #b30000;
  --primary-light: #fef2f2;
  --secondary: #1e3a8a;
  --accent-blue: #2563eb;
  --accent-blue-light: #eff6ff;
  --accent-green: #16a34a;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px -1px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.12), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 30px -10px rgba(0,0,0,0.2);
  
  --header-height: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
.wlm-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wlm-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.wlm-logo img {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #990000;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.logo-subtitle {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-main);
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stat-num {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.stat-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-item--missing .stat-num {
  color: #dc2626;
}

.stat-item--hasphoto .stat-num {
  color: var(--accent-blue);
}

.btn-about {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-about:hover {
  background: var(--bg-main);
  border-color: #cbd5e1;
}

/* --- Fixed Filter Toolbar --- */
.filter-panel {
  position: relative;
  width: 100%;
  max-width: none;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1005;
  padding: 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.search-group {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-family: inherit;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.12);
}

.btn-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid #fca5a5;
  background: var(--primary-light);
  color: #990000;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.toggle-btn .toggle-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.toggle-btn.active {
  background: #dc2626;
  color: #ffffff;
  border-color: #b91c1c;
}

.toggle-btn.active .toggle-dot {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.filter-select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.2s;
  flex-grow: 1;
  min-width: 140px;
}

.filter-select:disabled {
  background-color: #f1f5f9;
  cursor: not-allowed;
  opacity: 0.6;
}

.filter-select:focus {
  border-color: var(--primary);
}

.btn-reset {
  height: 34px;
  padding: 0 12px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-reset:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* --- Main View Area --- */
.wlm-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.map-container {
  flex: 1;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* --- Locate Button --- */
.btn-locate {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 990;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.2s;
}

.btn-locate:hover {
  background: var(--bg-main);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-locate .locate-icon {
  font-size: 1.1rem;
}

/* --- Map Legend --- */
.map-legend {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 990;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.legend-dot--red {
  background: #dc2626;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #dc2626;
}

.legend-dot--blue {
  background: #2563eb;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #2563eb;
}

/* --- Detail Drawer --- */
.detail-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
  background: #ffffff;
  z-index: 1001;
  box-shadow: var(--shadow-xl);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.drawer-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.badge-code {
  background: #f1f5f9;
  color: #334155;
  font-family: monospace;
}

.badge-cat {
  background: #fef3c7;
  color: #92400e;
}

.badge-cat-0 {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-cat-1 {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.badge-cat-2 {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-cat-3 {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-cat-a {
  background: #fdf2f8;
  color: #9d174d;
  border: 1px solid #fbcfe8;
}

.badge-cat-b {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-cat-none {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.drawer-close {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.drawer-close:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.drawer-image-box {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f172a;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0 !important;
}

.drawer-image-box a {
  display: block;
  cursor: zoom-in;
}

.drawer-image-box img {
  width: 100%;
  height: 260px;
  min-height: 260px;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.drawer-image-box:hover img {
  transform: scale(1.02);
}

.drawer-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #f1f5f9;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.85));
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.caption-zoom {
  opacity: 0.85;
  font-size: 0.72rem;
}

.missing-photo-banner {
  background: var(--primary-light);
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.82rem;
  color: #7f1d1d;
}

.missing-photo-banner .banner-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.missing-photo-banner strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 2px;
  color: #990000;
}

/* Big Commons Upload Action Button */
.btn-upload-commons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #dc2626;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
  transition: all 0.2s;
  cursor: pointer;
  text-align: center;
}

.btn-upload-commons:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.45);
}

.btn-upload-commons .upload-icon {
  font-size: 1.25rem;
}

/* Helper button for suggested filename */
.btn-copy-filename {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  width: 100%;
}

.btn-copy-filename:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #94a3b8;
}

.ext-icon-btn--blue {
  color: #2563eb !important;
  border-color: #93c5fd !important;
  background: #eff6ff !important;
}

.ext-icon-btn--blue:hover {
  background: #dbeafe !important;
  border-color: #60a5fa !important;
}

/* Info List */
.info-list {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid #edf2f7;
}

.info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.font-mono {
  font-family: monospace;
}

/* Drawer External Links: Single Row of Icon Buttons */
.drawer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.ext-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  height: 58px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #334155;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  text-align: center;
  user-select: none;
}

.ext-icon-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.ext-icon-btn:active {
  transform: translateY(0);
}

.ext-icon-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(1);
}

.ext-btn-icon {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ext-icon-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.ext-icon-btn svg {
  display: block;
}

.ext-btn-label {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: #475569;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.ext-icon-btn:hover .ext-btn-label {
  color: #0f172a;
}

/* --- Regional Heritage Portals Section («Краязнаўчыя рэсурсы») --- */
.drawer-portals-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.2s ease-out;
}

.drawer-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.drawer-section-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.portal-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (max-width: 380px) {
  .portal-buttons-grid {
    grid-template-columns: 1fr;
  }
}

/* Individual Portal Pill/Card Button */
.portal-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-height: 44px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.portal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.portal-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.portal-btn-icon-wrap {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  background: #f8fafc;
  padding: 2px;
  transition: background-color 0.2s ease;
}

.portal-btn-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.portal-btn-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.portal-btn-arrow {
  flex-shrink: 0;
  color: #94a3b8;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.portal-btn:hover .portal-btn-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
  color: inherit;
}

/* Brand-Specific Portal Accents */

/* 1. Globus of Belarus (globustut.by): Teal & Slate */
.portal-btn--globus:hover {
  background: #f0fdf4;
  border-color: #4cb6ac;
  color: #00695c;
}
.portal-btn--globus:hover .portal-btn-icon-wrap {
  background: #e0f2f1;
}
.portal-btn--globus:hover .portal-btn-title {
  color: #004d40;
}
.portal-btn--globus:hover .portal-btn-arrow {
  color: #00796b;
}

/* 2. Radzima.org: Belarusian Ethnic Red */
.portal-btn--radzima:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}
.portal-btn--radzima:hover .portal-btn-icon-wrap {
  background: #fee2e2;
}
.portal-btn--radzima:hover .portal-btn-title {
  color: #991b1b;
}
.portal-btn--radzima:hover .portal-btn-arrow {
  color: #dc2626;
}

/* 3. Sobory.ru: Church Classic Navy / Azure */
.portal-btn--sobory:hover {
  background: #f0f7ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.portal-btn--sobory:hover .portal-btn-icon-wrap {
  background: #dbeafe;
}
.portal-btn--sobory:hover .portal-btn-title {
  color: #1e40af;
}
.portal-btn--sobory:hover .portal-btn-arrow {
  color: #2563eb;
}

/* 4. Archivarta (archivarta.by): Modern Architectural Slate / Charcoal */
.portal-btn--archivarta:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}
.portal-btn--archivarta:hover .portal-btn-icon-wrap {
  background: #e2e8f0;
}
.portal-btn--archivarta:hover .portal-btn-title {
  color: #0f172a;
}
.portal-btn--archivarta:hover .portal-btn-arrow {
  color: #475569;
}

/* --- About Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-window {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #990000;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body ol {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-footer-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #fecaca;
  border-top-color: #dc2626;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* --- Custom Marker & Cluster Styles --- */
.wlm-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.wlm-marker:hover {
  transform: scale(1.3);
  z-index: 1000 !important;
}

.wlm-marker--red {
  background: #dc2626;
}

.wlm-marker--blue {
  background: #2563eb;
}

/* Marker Cluster Customization */
.marker-cluster-wlm-red {
  background-color: rgba(220, 38, 38, 0.25);
}
.marker-cluster-wlm-red div {
  background-color: rgba(220, 38, 38, 0.85);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
}

.marker-cluster-wlm-blue {
  background-color: rgba(37, 99, 235, 0.25);
}
.marker-cluster-wlm-blue div {
  background-color: rgba(37, 99, 235, 0.85);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
}

/* --- Mobile Responsive Tweaks --- */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }
  
  .header-stats {
    display: none;
  }
  
  .filter-panel {
    top: calc(var(--header-height) + 8px);
    left: 8px;
    right: 8px;
    padding: 8px 10px;
  }
  
  .detail-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 75vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--border);
  }
  
  .detail-drawer.open {
    transform: translateY(0);
  }
  
  .btn-locate {
    bottom: 16px;
    right: 16px;
    padding: 8px 12px;
  }
  
  .map-legend {
    display: none;
  }
}

/* --- View Tabs in Header --- */
.view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-main);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-badge {
  background: #fee2e2;
  color: #990000;
  padding: 1px 6px;
  border-radius: var(--radius-xl);
  font-size: 0.72rem;
  font-weight: 800;
}

/* --- No Coordinates View Container --- */
.no-coords-container {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-main);
  padding: 24px;
}

.no-coords-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.no-coords-banner {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.no-coords-banner .banner-icon {
  font-size: 2rem;
  line-height: 1;
}

.no-coords-banner h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.no-coords-banner p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.no-coords-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.monument-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  overflow: hidden;
}

.monument-card__image {
  height: 140px;
  width: 100%;
  overflow: hidden;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.monument-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.monument-card:hover .monument-card__image img {
  transform: scale(1.04);
}

.monument-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.monument-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.monument-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.monument-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.monument-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.monument-card__meta-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.monument-card__meta-icon {
  font-size: 0.9rem;
}

.monument-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.btn-card-upload {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  background: #dc2626;
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-card-upload:hover {
  background: #b91c1c;
}

.btn-card-wikidata {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  background: #f1f5f9;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
}

.btn-card-wikidata:hover {
  background: #e2e8f0;
}

.btn-card-commons {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  background: #f1f5f9;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-card-commons:hover {
  background: #e2e8f0;
  color: var(--primary);
}

/* Category exists: Blue button as requested by user */
.btn-card-commons--has-cat {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  font-weight: 700 !important;
}

.btn-card-commons--has-cat:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Category does not exist yet: Soft outline button to create */
.btn-card-commons--create {
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1px dashed #94a3b8 !important;
  font-weight: 600 !important;
}

.btn-card-commons--create:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #475569 !important;
}

/* Toast Notification */
.wlm-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  background: #0f172a;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
  text-align: center;
  line-height: 1.4;
}

.wlm-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.wlm-toast .toast-icon {
  display: flex;
  align-items: center;
  color: #22c55e;
  flex-shrink: 0;
}

.no-coords-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 0;
}

.page-btn {
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover {
  background: var(--bg-main);
  border-color: #cbd5e1;
}

.page-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Create Category Modal */
.modal-window--wide {
  max-width: 620px;
}

.create-cat-field {
  margin-bottom: 14px;
}

.create-cat-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.create-cat-input-row {
  display: flex;
  gap: 8px;
}

.create-cat-input {
  flex: 1;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-main);
}

.btn-copy-code {
  padding: 8px 14px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-copy-code:hover {
  background: #e2e8f0;
}

.create-cat-code-box {
  position: relative;
}

.create-cat-textarea {
  width: 100%;
  padding: 12px;
  font-family: monospace;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-main);
  resize: vertical;
  line-height: 1.45;
  box-sizing: border-box;
}

.btn-copy-code-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.btn-copy-code-overlay:hover {
  background: #f1f5f9;
}

.create-cat-tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.84rem;
  color: #1e3a8a;
  margin-bottom: 16px;
}

.create-cat-actions {
  display: flex;
  justify-content: flex-end;
}

.wlm-marker--orange { background: #ea580c; }
.wlm-marker--green { background: #16a34a; }

.marker-cluster-wlm-orange { background-color: rgba(234, 88, 12, 0.25); }
.marker-cluster-wlm-orange div { background-color: rgba(234, 88, 12, 0.85); color: #ffffff; font-weight: 800; font-size: 0.85rem; }

.marker-cluster-wlm-green { background-color: rgba(22, 163, 74, 0.25); }
.marker-cluster-wlm-green div { background-color: rgba(22, 163, 74, 0.85); color: #ffffff; font-weight: 800; font-size: 0.85rem; }

