/* ===================================================
   FitoAlimurgia — Plant Map Styles
   map.css v2
   =================================================== */

/* ---- Map Hero ---- */
.map-hero {
  background: linear-gradient(135deg, var(--green-800) 0%, var(--green-700) 100%);
  color: var(--white);
  padding: 30px 20px;
  text-align: center;
}

.map-hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.map-hero p {
  font-size: 1rem;
  color: var(--green-200);
  margin-bottom: 16px;
}

.map-hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.btn-find-me {
  background: var(--white);
  color: var(--green-800);
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}

.btn-find-me:hover {
  background: var(--green-200);
  transform: translateY(-1px);
}

.btn-find-me:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--green-300);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.3);
}

.legend-high { background: #2d6a4f; }
.legend-med { background: #e8a817; }
.legend-low { background: #d94d3d; }

/* ---- Map Layout ---- */
.map-layout {
  display: flex;
  height: calc(100vh - 70px - 106px);
  min-height: 400px;
  position: relative;
}

/* ---- Sidebar ---- */
.sidebar-header {
  display: none;
  width: 100%;
  background: var(--green-800);
  position: relative;
  z-index: 60;
}

.sidebar-toggle-btn {
  width: 100%;
  background: transparent;
  color: var(--white);
  border: none;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-panel {
  width: 340px;
  min-width: 300px;
  background: var(--white);
  border-right: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
}

.sidebar-filters {
  padding: 16px;
  border-bottom: 2px solid var(--green-200);
  background: var(--green-100);
  flex-shrink: 0;
}

.sidebar-filters h3 {
  font-size: 1rem;
  color: var(--green-800);
  margin-bottom: 4px;
}

.sf-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sf-group {
  margin-bottom: 10px;
}

.sf-group:last-child { margin-bottom: 0; }

.sf-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 2px;
}

.sf-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-primary);
  font-size: 0.88rem;
  cursor: pointer;
}

.sf-select:focus {
  border-color: var(--green-600);
  outline: none;
}

.sidebar-plants {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

/* ---- Sidebar Plant Card ---- */
.sidebar-plant-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid var(--green-400);
}

.sidebar-plant-card:hover {
  box-shadow: var(--shadow-sm);
  border-left-color: var(--green-700);
}

.sidebar-plant-card.safe {
  border-left-color: var(--green-700);
}

.sidebar-plant-card.danger {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}

.sb-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.sb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.sb-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--green-800);
  line-height: 1.2;
}

.sb-sci {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
}

.sb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sb-rating {
  font-size: 0.78rem;
  font-weight: 700;
}

.sb-region {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sb-months {
  display: flex;
  gap: 3px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.sb-month {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--green-200);
  color: var(--green-900);
}

.sb-detail-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green-700);
  display: inline-block;
  margin-top: 4px;
}

.sb-detail-link:hover {
  color: var(--green-900);
}

.sidebar-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- Map Column ---- */
.map-col {
  flex: 1;
  position: relative;
}

#mapContainer {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ---- Map Marker ---- */
.map-plant-marker {
  background: transparent !important;
  border: none !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
  border: 1px solid var(--green-100) !important;
}

.leaflet-popup-content {
  margin: 14px 16px !important;
  font-family: var(--font-main) !important;
}

.plant-popup {
  min-width: 180px;
}

.popup-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-800);
  margin-bottom: 2px;
}

.popup-sci {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.popup-edibility {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.popup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.popup-regs {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.popup-harvest {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}

.popup-month {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--gray-300);
  border: 1px solid var(--gray-100);
}

.popup-month.active {
  background: var(--green-600);
  color: var(--white);
  border-color: var(--green-600);
}

.popup-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-700);
  display: inline-block;
}

.popup-link:hover {
  color: var(--green-900);
}

/* ---- User location ---- */
.user-location-marker {
  background: transparent !important;
  border: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sidebar-header { display: block; }

  .sidebar-panel {
    position: fixed;
    top: 0;
    left: -100%;
    bottom: 0;
    width: 300px;
    height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-xl);
  }

  .sidebar-panel.sidebar-open {
    left: 0;
  }

  .map-layout {
    height: auto;
  }

  .map-col {
    width: 100%;
    flex: none;
  }

  #mapContainer {
    height: 50vh;
    min-height: 350px;
  }
}

@media (max-width: 600px) {
  .map-hero h1 { font-size: 1.4rem; }
  .map-hero p { font-size: 0.9rem; }

  .map-hero-row {
    flex-direction: column;
    gap: 10px;
  }

  .map-legend { font-size: 0.72rem; }

  #mapContainer {
    height: 40vh;
    min-height: 280px;
  }
}
