/* ===========================================================
   MapYourMarket REMS Stylesheet
   Version: 2025.10.22
   Purpose: Unified dashboard + map interface styling
   =========================================================== */

/* --- Root + Layout --- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f9fafb;
  color: #111827;
}

.dash-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* --- Sidebar --- */
.dash-sidebar {
  background-color: #0f172a;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  box-sizing: border-box;
}

.dash-sidebar .brand {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}

.dash-sidebar .brand img.logo {
  width: 32px;
  height: 32px;
  margin-right: 8px;
}

.dash-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-sidebar nav a {
  color: #e2e8f0;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.2s ease;
  font-size: 15px;
}

.dash-sidebar nav a.active,
.dash-sidebar nav a:hover {
  background-color: #1e293b;
  color: #fff;
}

/* --- Main Area --- */
.dash-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 14px 24px;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  z-index: 20;
}

.dash-header h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #0f172a;
}

.version-pill {
  background: #3b82f6;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
  padding: 4px 10px;
}

/* --- Control Panel --- */
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.controls input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.controls button {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease;
}

.controls button:hover {
  background: #2563eb;
}

/* --- Legend Panel --- */
#legend {
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 8px;
  width: 240px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-size: 14px;
  line-height: 1.4;
}

.legend-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: #0f172a;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  color: #1f2937;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 2px;
  border: 1px solid #1e293b;
  flex-shrink: 0;
}

/* --- Map Section --- */
.map-section {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 10;
}

.leaflet-container {
  background: #cbd5e1;
}

/* --- Footer --- */
.app-footer {
  background: #fff;
  color: #475569;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-top: 1px solid #e5e7eb;
}

/* --- Utility Colors --- */
:root {
  --color-green: #22c55e;
  --color-blue: #3b82f6;
  --color-gray: #94a3b8;
  --color-outline: #1e293b;
}

/* --- Scroll + Responsiveness --- */
.dash-sidebar,
.dash-main {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #0f172a;
}

@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    flex-direction: row;
    justify-content: space-around;
    height: 60px;
  }
  .dash-main {
    height: calc(100vh - 60px);
  }
  #legend {
    width: auto;
    display: flex;
    justify-content: space-around;
  }
  .legend-item {
    margin-right: 12px;
  }
}

/* --- Leaflet Customizations --- */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
  font-size: 13px;
  color: #111827;
}

.leaflet-bar a {
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
}

.leaflet-bar a:hover {
  background: #f3f4f6;
}
