@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0a0b10;
  --panel-bg: rgba(13, 15, 23, 0.7);
  --panel-border: rgba(255, 255, 255, 0.08);
  --primary-glow: rgba(0, 242, 254, 0.15);
  
  --color-primary: #00f2fe;
  --color-secondary: #4facfe;
  --color-accent: #00ff87;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  
  --font-title: 'Outfit', 'Cairo', sans-serif;
  --font-body: 'Cairo', 'Plus Jakarta Sans', sans-serif;
  
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 
               0 0 20px rgba(0, 242, 254, 0.05);
  --glass-blur: 16px;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--color-text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#app-container {
  display: flex;
  position: relative;
  width: 100%;
  height: 100%;
}

#map {
  flex: 1;
  height: 100%;
  width: 100%;
  background-color: var(--bg-dark);
  z-index: 1;
}

/* Add OSM Note mode: crosshair cursor cues click-to-place */
#map.note-mode-active {
  cursor: crosshair;
}

/* Glassmorphism Sidebar */
#sidebar {
  position: absolute;
  top: 20px;
  right: 20px; /* Positioned on the right for RTL layout */
  bottom: 20px;
  width: 420px;
  background: var(--panel-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

#sidebar:hover {
  border-color: rgba(0, 242, 254, 0.25);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), 
              0 0 30px rgba(0, 242, 254, 0.1);
}

/* Header & Gradient Text */
header {
  margin-bottom: 24px;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.logo-glow {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 12px 3px var(--color-primary);
  animation: pulse-glow 2s infinite ease-in-out;
}

h1 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 242, 254, 0.15);
  transform: translateY(-2px);
}

.stat-val {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-val.highlight {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-lbl {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Filters and Search */
.section-title {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-group {
  margin-bottom: 24px;
}

.section-hint {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0 0 12px 0;
}

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

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 42px 12px 16px; /* Swapped padding for RTL search icon */
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

.search-icon {
  position: absolute;
  right: 14px; /* Icon positioned on the right for RTL search box */
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

/* Choice Chips / Filters */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip.active[data-religion="muslim"] {
  background: rgba(0, 255, 135, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.1);
}

.chip.active[data-religion="musalla"] {
  background: rgba(79, 172, 254, 0.15);
  border-color: var(--color-secondary);
  color: var(--color-secondary);
  box-shadow: 0 0 10px rgba(79, 172, 254, 0.1);
}

.chip.active[data-religion="other"] {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.chip.active[data-religion="all"] {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.chip.active[data-basemap] {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}


/* Range Sliders */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-muted);
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transition: background 0.3s;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--color-primary);
  transition: transform 0.1s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Info Panel for Selected Point */
#details-panel {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
  display: none; /* Shown dynamically */
  animation: slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.details-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.details-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
}

.details-title-ar {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #fff;
  text-align: right;
  font-family: 'Outfit', sans-serif;
}

.details-title-en {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.details-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.details-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.details-label {
  color: var(--color-text-muted);
}

.details-val {
  font-weight: 500;
  color: var(--color-text);
}

.details-val.accent {
  color: var(--color-accent);
}

.details-link {
  color: var(--color-primary);
  text-decoration: none;
}

.details-link:hover {
  text-decoration: underline;
}

/* Custom Zoom Controls */
.leaflet-control-zoom {
  border: 1px solid var(--panel-border) !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  background: var(--panel-bg) !important;
  backdrop-filter: blur(var(--glass-blur)) !important;
  color: var(--color-text) !important;
  border: none !important;
  transition: all 0.2s ease !important;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--color-primary) !important;
}

/* Custom Marker Styling */
.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary);
  transition: all 0.3s ease;
}

.custom-marker.muslim {
  background: rgba(0, 255, 135, 0.15);
  border-color: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
}

.custom-marker.christian {
  background: rgba(79, 172, 254, 0.15);
  border-color: var(--color-secondary);
  box-shadow: 0 0 10px var(--color-secondary);
}

.custom-marker-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

.custom-marker.muslim .custom-marker-inner {
  background: var(--color-accent);
}

.custom-marker.christian .custom-marker-inner {
  background: var(--color-secondary);
}

/* OSM Note Marker Styling */
.note-marker {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.note-marker-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 4px;
  background: rgba(255, 176, 58, 0.9);
  border: 1px solid #ffb03a;
  box-shadow: 0 0 8px rgba(255, 176, 58, 0.6);
  font-size: 12px;
  line-height: 1;
}

.note-marker.closed .note-marker-inner {
  background: rgba(150, 150, 150, 0.7);
  border-color: rgba(200, 200, 200, 0.6);
  box-shadow: none;
  opacity: 0.7;
}

/* Scrollbar Customization */
#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes pulse-glow {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
    box-shadow: 0 0 8px 1px var(--color-primary);
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 0 15px 4px var(--color-primary);
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
    box-shadow: 0 0 8px 1px var(--color-primary);
  }
}

/* Dashboard Mode Toggle Button Group */
.mode-toggle-container {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 4px;
  width: 100%;
  margin-top: 6px;
}

.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mode-btn.active {
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.05);
}

.mode-btn.active[data-mode="gap"] {
  background: rgba(255, 59, 48, 0.15);
  border-color: #ff3b30;
  color: #ff3b30;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.05);
}

/* Info Alert box style */
.info-alert {
  display: flex;
  gap: 12px;
  background: rgba(255, 59, 48, 0.06);
  border: 1px solid rgba(255, 59, 48, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 11px;
  line-height: 1.5;
  color: #ffbaba;
  margin-bottom: 24px;
  animation: fade-in 0.3s ease;
  align-items: flex-start;
}

.alert-icon {
  flex-shrink: 0;
  color: #ff3b30;
  margin-top: 2px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Loading / Error Overlay */
#loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 11, 16, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.4s ease;
}

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

#loading-overlay .loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 36px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  text-align: center;
}

#loading-overlay .loading-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
}

#loading-overlay.error .loading-spinner {
  display: none;
}

#loading-overlay #loading-text {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.5;
}

#loading-overlay.error #loading-text {
  color: #ffbaba;
}

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

/* ==========================================================================
   Qibla Compass & Toggle Switch Styles
   ========================================================================== */

/* Switch Toggle Option in Sidebar */
.switch-control-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 6px;
  transition: all 0.3s ease;
}

.switch-control-wrapper:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 242, 254, 0.15);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--color-text-muted);
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.switch input:checked + .slider-switch {
  background-color: rgba(0, 242, 254, 0.15);
  border-color: var(--color-primary);
}

.switch input:checked + .slider-switch:before {
  transform: translateX(20px);
  background-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
}

.slider-switch.round {
  border-radius: 24px;
}

.slider-switch.round:before {
  border-radius: 50%;
}

.switch-label {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
  user-select: none;
  cursor: pointer;
  flex-grow: 1;
  text-align: right;
}

.switch input:checked ~ .switch-label {
  color: var(--color-text);
}

/* Qibla Compass Center Overlay */
.qibla-compass {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5; /* Between map (1) and sidebar (10) */
  pointer-events: none; /* Allows click-through to map */
  display: flex;
  align-items: center;
  justify-content: center;
  animation: compass-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qibla-compass.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Needle Container - Sleek minimalist redesign */
.compass-needle-container {
  position: relative;
  width: 44px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.5))
          drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.compass-needle-svg {
  width: 100%;
  height: 100%;
}

@keyframes compass-fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Size Threshold Controls (Improve Mode) */
.threshold-controls {
  margin-top: 14px;
  padding: 14px;
  background: rgba(255, 176, 58, 0.05);
  border: 1px solid rgba(255, 176, 58, 0.15);
  border-radius: 12px;
}

.threshold-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.threshold-controls-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffb03a;
}

.threshold-controls .section-hint {
  margin: 0 0 10px 0;
}

.threshold-reset-btn {
  background: transparent;
  border: 1px solid rgba(255, 176, 58, 0.3);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  color: #ffb03a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.threshold-reset-btn:hover {
  background: rgba(255, 176, 58, 0.12);
  border-color: #ffb03a;
}

.threshold-fields {
  display: flex;
  gap: 10px;
}

.threshold-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.threshold-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: all 0.25s ease;
}

.threshold-input:focus {
  border-color: #ffb03a;
  background: rgba(255, 176, 58, 0.08);
  box-shadow: 0 0 10px rgba(255, 176, 58, 0.15);
}

.threshold-input.invalid {
  border-color: #ff453a;
  box-shadow: 0 0 10px rgba(255, 69, 58, 0.15);
}

/* Data Quality Mode Specific styles */
.mode-btn.active[data-mode="improve"] {
  background: rgba(255, 176, 58, 0.12);
  border: 1px solid #ffb03a;
  color: #ffb03a;
  box-shadow: 0 0 10px rgba(255, 176, 58, 0.05);
}

/* Data Quality Issues Modern UI */
.improve-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.improve-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.improve-header-badge {
  background: rgba(255, 176, 58, 0.12);
  color: #ffb03a;
  border: 1px solid rgba(255, 176, 58, 0.25);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}

.improve-reset-filter-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.improve-reset-filter-btn:hover {
  border-color: #ffb03a;
  color: #ffb03a;
  background: rgba(255, 176, 58, 0.08);
}

/* Master Hero Card for "All Issues" */
.improve-hero-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: right;
  font-family: inherit;
  color: var(--color-text);
  box-sizing: border-box;
}

.improve-hero-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 176, 58, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.improve-hero-card.active {
  background: linear-gradient(135deg, rgba(255, 176, 58, 0.16) 0%, rgba(255, 149, 0, 0.07) 100%);
  border-color: #ffb03a;
  box-shadow: 0 0 20px rgba(255, 176, 58, 0.2), inset 0 0 15px rgba(255, 176, 58, 0.05);
}

.improve-hero-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.improve-hero-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 176, 58, 0.15);
  border: 1px solid rgba(255, 176, 58, 0.3);
  color: #ffb03a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.improve-hero-card:hover .improve-hero-icon {
  transform: scale(1.05);
}

.improve-hero-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.improve-hero-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.improve-hero-subtitle {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.improve-hero-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.improve-check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 176, 58, 0.2);
  color: #ffb03a;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.improve-hero-card.active .improve-check-icon {
  opacity: 1;
  transform: scale(1);
}

/* Category Filter Tabs */
.improve-category-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 12px;
  overflow-x: auto;
}

.category-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  white-space: nowrap;
}

.category-tab:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.04);
}

.category-tab.active {
  color: #ffb03a;
  background: rgba(255, 176, 58, 0.14);
  border-color: rgba(255, 176, 58, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.category-tab-count {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.category-tab.active .category-tab-count {
  background: rgba(255, 176, 58, 0.25);
  color: #ffb03a;
}

/* Issues List & Item Cards */
.improve-issues-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.improve-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--color-text);
  text-align: right;
  font-family: inherit;
  box-sizing: border-box;
}

.improve-item:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(-2px);
}

.improve-item.active {
  background: linear-gradient(90deg, rgba(255, 176, 58, 0.15) 0%, rgba(255, 176, 58, 0.04) 100%);
  border-color: #ffb03a;
  box-shadow: 0 2px 14px rgba(255, 176, 58, 0.15);
}

.improve-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.improve-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.improve-item:hover .improve-item-icon {
  transform: scale(1.08);
}

.icon-qibla {
  background: rgba(255, 149, 0, 0.15);
  border: 1px solid rgba(255, 149, 0, 0.3);
}

.icon-ai {
  background: rgba(175, 82, 222, 0.16);
  border: 1px solid rgba(175, 82, 222, 0.35);
}

.icon-node {
  background: rgba(0, 242, 254, 0.14);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.icon-small {
  background: rgba(255, 204, 0, 0.14);
  border: 1px solid rgba(255, 204, 0, 0.3);
}

.icon-large {
  background: rgba(255, 159, 10, 0.14);
  border: 1px solid rgba(255, 159, 10, 0.3);
}

.icon-tag {
  background: rgba(48, 209, 88, 0.14);
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.icon-mosque {
  background: rgba(255, 69, 58, 0.14);
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.icon-name {
  background: rgba(255, 55, 95, 0.14);
  border: 1px solid rgba(255, 55, 95, 0.3);
}

.icon-lang {
  background: rgba(10, 132, 255, 0.14);
  border: 1px solid rgba(10, 132, 255, 0.3);
}

.icon-denom {
  background: rgba(94, 92, 230, 0.14);
  border: 1px solid rgba(94, 92, 230, 0.3);
}

.icon-stale {
  background: rgba(142, 142, 147, 0.14);
  border: 1px solid rgba(142, 142, 147, 0.3);
}

.improve-item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.improve-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.improve-item-meta {
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.improve-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.improve-count-pill {
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-title);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  min-width: 24px;
  text-align: center;
}

.improve-count-pill.highlight,
.improve-item.active .improve-count-pill {
  background: rgba(255, 176, 58, 0.2);
  color: #ffb03a;
  border-color: rgba(255, 176, 58, 0.4);
}

.improve-item-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.2s ease;
}

.improve-item.active .improve-item-indicator {
  background: #ffb03a;
  box-shadow: 0 0 8px #ffb03a;
}

.chip.active[data-improve] {
  background: rgba(255, 176, 58, 0.15);
  border-color: #ffb03a;
  color: #ffb03a;
  box-shadow: 0 0 10px rgba(255, 176, 58, 0.1);
}

/* Custom Marker - Data Quality Warning Dot */
.custom-marker.improve {
  background: rgba(255, 176, 58, 0.15);
  border-color: #ffb03a;
  box-shadow: 0 0 10px #ffb03a;
}

.custom-marker.improve .custom-marker-inner {
  background: #ffb03a;
}

/* Quality Issues Warnings Card */
.quality-issues-box {
  margin-top: 16px;
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: 12px;
  padding: 12px;
}

.quality-issues-title {
  font-size: 13px;
  font-weight: 700;
  color: #ff453a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.issues-list {
  list-style: none;
  padding-right: 0;
  margin: 0;
}

.issues-list li {
  font-size: 11.5px;
  color: #ffbaba;
  margin-bottom: 6px;
  padding-right: 14px;
  position: relative;
  text-align: right;
}

.issues-list li::before {
  content: '•';
  position: absolute;
  right: 0;
  color: #ff453a;
  font-weight: bold;
}

.issues-list li:last-child {
  margin-bottom: 0;
}

/* Mapper Editing Tools Card */
.mapper-tools-box {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.mapper-tools-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.mapper-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mapper-btn {
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

.mapper-btn:hover {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.mapper-btn.id-editor {
  background: rgba(79, 172, 254, 0.08);
  border-color: rgba(79, 172, 254, 0.2);
}

.mapper-btn.id-editor:hover {
  background: rgba(79, 172, 254, 0.15);
  border-color: var(--color-secondary);
  color: #fff;
  box-shadow: 0 0 10px rgba(79, 172, 254, 0.2);
}

.mapper-btn.josm-editor {
  background: rgba(0, 255, 135, 0.08);
  border-color: rgba(0, 255, 135, 0.2);
}

.mapper-btn.josm-editor:hover {
  background: rgba(0, 255, 135, 0.15);
  border-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.2);
}

/* Toast Notifications styling */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: rgba(13, 15, 23, 0.85);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--color-accent);
  color: var(--color-text);
  padding: 12px 20px;
  border-radius: 12px;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  animation: slide-in-left 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  direction: rtl;
}

.toast-notification.error {
  border-color: #ff3b30;
}

.toast-notification .toast-link {
  color: inherit;
  text-decoration: underline;
}

@keyframes slide-in-left {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-out-left {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-120%);
    opacity: 0;
  }
}

/* ==========================================
   OpenStreetMap Auth (OSM Auth) Styling
   ========================================== */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
}

.auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
}

.auth-card {
  position: relative;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  background: rgba(18, 20, 29, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  direction: rtl;
}

.auth-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 10;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.auth-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.15) 0%, rgba(0, 242, 254, 0) 70%);
  pointer-events: none;
}

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-icon {
  font-size: 36px;
  background: rgba(0, 242, 254, 0.1);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 242, 254, 0.25);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
  margin-bottom: 8px;
}

.auth-header h2 {
  font-family: var(--font-body);
  color: var(--color-text);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.auth-header p {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.auth-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.client-id-config {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.client-id-config label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.auth-input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  font-family: monospace;
  font-size: 13px;
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
  text-align: center;
}

.auth-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
  background: rgba(0, 0, 0, 0.4);
}

.input-help {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 0;
}

/* Note Composer: preset field groups (only one shown at a time) */
.note-preset-group.hidden {
  display: none;
}

.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: #0b0c10;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
}

.auth-submit-btn:active {
  transform: translateY(0);
}


.auth-footer {
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-text-muted);
}

/* User Profile Sidebar Widget */
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 16px;
  margin-top: 12px;
  margin-bottom: 8px;
  animation: fade-in 0.3s ease;
}

.user-avatar {
  font-size: 18px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.user-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.user-status-text {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-muted);
}

.user-status-text strong {
  color: var(--color-primary);
  font-weight: 700;
}

.user-role-text {
  font-family: var(--font-body);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 2px;
}

.osm-logout-btn {
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.25);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: #ff5b5b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.osm-logout-btn:hover {
  background: rgba(255, 59, 48, 0.18);
  color: #ff3b30;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.1);
}

/* ==========================================
   Multi-tab Auth Card & Guest Access Styles
   ========================================== */
.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 8px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

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

.auth-tab-btn.active {
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: var(--color-primary);
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: tab-fade-in 0.3s ease;
}

.tab-content.hidden {
  display: none;
}

@keyframes tab-fade-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Copy Redirect URI Button styling */
.copy-uri-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-uri-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Divider styling */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-family: var(--font-body);
  margin: 6px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider:not(:empty)::before {
  margin-left: 12px;
}

.auth-divider:not(:empty)::after {
  margin-right: 12px;
}

/* Guest Skip Button styling */
.auth-skip-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

.auth-skip-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-text);
  transform: translateY(-1px);
}

.auth-skip-btn:active {
  transform: translateY(0);
}

/* Sidebar Guest Small Login Button */
.osm-login-btn-small {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.osm-login-btn-small:hover {
  background: rgba(0, 242, 254, 0.18);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

/* Guide Container & Steps styling */
.guide-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-intro {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--color-text);
  line-height: 1.5;
  flex-grow: 1;
}

.guide-sublist {
  margin: 6px 0 0 0;
  padding-right: 18px;
  list-style-type: square;
  color: var(--color-text-muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.guide-sublist li {
  margin-bottom: 4px;
}

/* ==========================================================================
   Sidebar Collapse/Expand Toggle
   ========================================================================== */
.sidebar-toggle-btn {
  position: absolute;
  top: 20px;
  right: 440px; /* just outside the expanded sidebar's left edge (420px width + 20px margin) */
  z-index: 11; /* above #sidebar (10), below loading/auth overlays (1000/9999) */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  color: var(--color-text);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-toggle-btn:hover {
  border-color: rgba(0, 242, 254, 0.25);
  color: var(--color-primary);
}

.sidebar-toggle-btn svg {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#app-container.sidebar-collapsed .sidebar-toggle-btn {
  right: 20px;
}

#app-container.sidebar-collapsed .sidebar-toggle-btn svg {
  transform: rotate(180deg);
}

#app-container.sidebar-collapsed #sidebar {
  transform: translateX(120%);
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
  #sidebar {
    top: 12px;
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    padding: 16px;
  }

  #app-container.sidebar-collapsed .sidebar-toggle-btn {
    right: 16px;
  }

  .sidebar-toggle-btn {
    top: 16px;
    right: 16px;
  }

  .toast-notification {
    left: 16px;
    right: 16px;
  }

  .leaflet-control-zoom-in,
  .leaflet-control-zoom-out {
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    font-size: 18px !important;
  }

  .auth-card {
    padding: 20px;
  }
}

/* ==========================================================================
   CARTO Basemap Configuration & Modal Styles
   ========================================================================== */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header-row .section-title {
  margin-bottom: 0;
}

.carto-config-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.carto-config-btn:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.carto-config-btn.active-key {
  border-color: rgba(0, 255, 135, 0.4);
  color: #00ff87;
  background: rgba(0, 255, 135, 0.08);
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.15);
}

.carto-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
  font-family: var(--font-body);
}

.carto-status-box.default {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
}

.carto-status-box.active {
  background: rgba(0, 255, 135, 0.08);
  border: 1px solid rgba(0, 255, 135, 0.25);
  color: #a8ffcc;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.neutral {
  background: #888;
}

.status-dot.green {
  background: #00ff87;
  box-shadow: 0 0 8px #00ff87;
}

.carto-guide-shortcut {
  margin-top: -6px;
}

.carto-free-key-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 242, 254, 0.06);
  border: 1px dashed rgba(0, 242, 254, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.carto-free-key-link:hover {
  background: rgba(0, 242, 254, 0.15);
  border-style: solid;
  transform: translateY(-1px);
}

.carto-clear-btn {
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.25);
  color: #ff8b85;
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.carto-clear-btn:hover {
  background: rgba(255, 59, 48, 0.16);
  border-color: #ff3b30;
  color: #ff3b30;
}

/* ==========================================================================
   Wikidata Suggested Mosques Layer & Popups
   ========================================================================== */

.suggestions-count-badge {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  font-family: var(--font-body);
  letter-spacing: 0.3px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.suggestions-subcontrols {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.25s ease-out;
}

.suggestions-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.suggestions-viewport-text strong {
  color: #fbbf24;
  font-weight: 700;
}

/* Glassmorphism Dark Leaflet Popups */
.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 242, 254, 0.08) !important;
  color: #f1f5f9 !important;
  padding: 4px !important;
}

.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-container a.leaflet-popup-close-button {
  color: #94a3b8 !important;
  padding: 6px 10px !important;
  font-size: 16px !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  color: #ffffff !important;
}

/* Suggestion Cluster Markers */
.suggestion-cluster {
  background: radial-gradient(circle at 30% 30%, rgba(245, 158, 11, 0.95), rgba(180, 83, 9, 0.85));
  border: 2px solid #fef3c7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.6), 0 4px 10px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  font-family: var(--font-body);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.suggestion-cluster:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
}

/* Suggestion Popup Card */
.suggestion-popup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
  max-width: 320px;
  font-family: var(--font-body);
  direction: rtl;
  text-align: right;
  line-height: 1.4;
  padding: 4px;
}

.suggestion-popup-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
}

.suggestion-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.suggestion-subtitle {
  font-size: 12px;
  color: #94a3b8;
  direction: ltr;
  text-align: right;
  margin-top: 2px;
}

.suggestion-meta-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.suggestion-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.suggestion-meta-label {
  color: #94a3b8;
  font-size: 11px;
}

.suggestion-meta-val {
  font-weight: 600;
  color: #f8fafc;
}

.suggestion-meta-val a {
  color: #38bdf8;
  text-decoration: none;
}

.suggestion-meta-val a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.badge-sug-verified {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-sug-generic {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.suggestion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.btn-sug-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  border: 1px solid transparent;
}

.btn-sug-satellite {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.35);
  color: #4facfe;
  grid-column: span 2;
}

.btn-sug-satellite:hover {
  background: rgba(0, 242, 254, 0.22);
  border-color: #00f2fe;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-sug-copy {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.btn-sug-copy:hover {
  background: rgba(148, 163, 184, 0.22);
  border-color: #ffffff;
  color: #ffffff;
}

.btn-sug-id {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.btn-sug-id:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #ffffff;
}

.btn-sug-josm {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.btn-sug-josm:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #ffffff;
}



.data-updated {
  margin-top: 6px;
  font-size: 11px;
  color: var(--color-text-muted);
  opacity: 0.8;
}

/* ===== Header actions (language, shortcuts) ===== */
.header-actions {
  margin-inline-start: auto;
  display: flex;
  gap: 6px;
}

.header-action-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-action-btn:hover {
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ===== Review queue (N / P) ===== */
.review-nav-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 10px;
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.25);
  border-radius: 10px;
}

.review-nav-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

#review-nav-counter {
  font-size: 12px;
  font-weight: 700;
  color: #ffb03a;
}

.review-today {
  font-size: 10.5px;
  color: var(--color-text-muted);
}

.review-nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 176, 58, 0.3);
  border-radius: 8px;
  width: 32px;
  height: 28px;
  color: #ffb03a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.review-nav-btn:hover {
  background: rgba(255, 176, 58, 0.12);
  border-color: #ffb03a;
}

[dir="ltr"] .review-nav-btn {
  transform: scaleX(-1);
}

.review-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.review-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.review-option input {
  accent-color: #ffb03a;
}

/* Fixed / skip marks in the details card */
.review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.review-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent);
  margin-inline-end: auto;
}

.review-action-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.review-action-btn.fixed {
  border-color: rgba(0, 255, 135, 0.35);
  color: var(--color-accent);
}

.review-action-btn.subtle {
  color: var(--color-text-muted);
}

.review-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ===== Export ===== */
.export-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.export-btn {
  background: rgba(79, 172, 254, 0.06);
  border: 1px solid rgba(79, 172, 254, 0.25);
  border-radius: 8px;
  padding: 7px 8px;
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--color-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-btn:hover {
  background: rgba(79, 172, 254, 0.14);
  border-color: var(--color-secondary);
}

/* ===== Keyboard shortcuts modal ===== */
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 16px;
}

.shortcuts-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--color-text);
}

.shortcuts-table td:first-child {
  white-space: nowrap;
  width: 1%;
  padding-inline-end: 14px;
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 11px;
  text-align: center;
  color: var(--color-text);
}

/* Login modal: environment / client ID behind an "advanced" disclosure */
.auth-advanced {
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px 12px;
}

.auth-advanced summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-muted);
}

.auth-advanced[open] summary {
  margin-bottom: 10px;
}

/* ===== English (LTR) overrides =====
   The layout was designed RTL-first; these flip the rules that hard-code a
   side. The floating sidebar intentionally stays on the right. */
[dir="ltr"] .search-input {
  padding: 12px 16px 12px 42px;
}

[dir="ltr"] .search-icon {
  right: auto;
  left: 14px;
}

[dir="ltr"] .details-title-ar,
[dir="ltr"] .switch-label,
[dir="ltr"] .improve-hero-card,
[dir="ltr"] .improve-item,
[dir="ltr"] .issues-list li,
[dir="ltr"] .suggestion-popup,
[dir="ltr"] .suggestion-subtitle {
  text-align: left;
}

[dir="ltr"] .issues-list li {
  padding-right: 0;
  padding-left: 14px;
}

[dir="ltr"] .issues-list li::before {
  right: auto;
  left: 0;
}

[dir="ltr"] .toast-notification,
[dir="ltr"] .auth-card,
[dir="ltr"] .suggestion-popup {
  direction: ltr;
}

[dir="ltr"] .auth-card select,
[dir="ltr"] .auth-card textarea,
[dir="ltr"] .auth-card input {
  text-align: left !important;
  text-align-last: left !important;
}

/* ===== Quick fixes / edit dialog / batch ===== */
.quick-fixes-box {
  margin-top: 14px;
}

.quick-fix-hint {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.quick-fix-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-fix-btn {
  background: rgba(0, 255, 135, 0.06);
  border: 1px solid rgba(0, 255, 135, 0.3);
  border-radius: 8px;
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-accent);
  cursor: pointer;
  text-align: start;
  transition: all 0.2s ease;
}

.quick-fix-btn:hover {
  background: rgba(0, 255, 135, 0.14);
}

.edit-changes-label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.edit-diff {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 135, 0.2);
  color: var(--color-accent);
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  text-align: left;
}

.edit-comment {
  resize: vertical;
  text-align: left !important;
  font-family: var(--font-body);
}

.edit-comment-counter {
  align-self: flex-end;
}

.auth-submit-btn:disabled,
.auth-skip-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.batch-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  padding: 10px 18px;
  border-radius: 24px;
  border: 1px solid rgba(0, 255, 135, 0.45);
  background: rgba(13, 15, 23, 0.9);
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}

.batch-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 12px;
}

.batch-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.history-list li {
  justify-content: flex-start;
}

.batch-progress {
  position: relative;
  height: 22px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.batch-progress-bar {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  background: rgba(0, 255, 135, 0.3);
  transition: width 0.2s ease;
}

.batch-progress span {
  position: relative;
  display: block;
  text-align: center;
  font-size: 11px;
  line-height: 22px;
}

/* Auth Feature Cards Styling */
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 4px;
}

.auth-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: right;
}

[dir="ltr"] .auth-feature-item {
  text-align: left;
}

.auth-feature-icon {
  font-size: 18px;
  line-height: 1;
  padding-top: 2px;
}

.auth-feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-feature-text strong {
  font-size: 12px;
  color: var(--color-text);
  font-weight: 600;
}

.auth-feature-text span {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.4;
}
