#map {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
}

/* ======================== */
/* HEADER */
/* ======================== */

#header {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: 600px;

  display: flex;
  align-items: center;
  gap: 10px;

  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  padding: 6px 12px;
  border-radius: 999px;

  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);

  z-index: 1000;
}

/* LEFT (logo) */
.header-left {
  display: flex;
  align-items: center;
}

/* CENTER */
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

/* INSTRUCTIONS */
#mapInstructions {
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 13px;
  opacity: 0.7;
  font-weight: 500;
  color: #333;
}

#mapInstructions span {
  white-space: nowrap;
}

/* BUTTONS */
.header-actions {
  display: flex;
  gap: 8px;
}

#header button {
  padding: 7px 14px;
  border-radius: 16px;

  background: #6b3e26;
  color: white;
  border: none;

  font-size: 14px;
  font-weight: 500;

  cursor: pointer;

  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.15s ease;
}

#header button:hover {
  background: #7a4a2f;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

#header button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* LOGO */
.logo {
  height: 50px;
}

/* ======================== */
/* PANEL */
/* ======================== */

.panel {
  position: fixed;
  top: 110px;
  left: 12px;
  width: 260px;

  background: white;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);

  display: none;
}

/* ======================== */
/* LEGEND */
/* ======================== */

#legendBar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);

  background: white;
  padding: 6px 14px;
  border-radius: 20px;

  font-size: 12px;
}

/* ======================== */
/* CLUSTERS */
/* ======================== */

.custom-cluster {
  background: transparent !important;
  border: none !important;
}

.cluster-icon {
  background: rgba(40, 40, 40, 0.85); 
  color: white;

  border-radius: 50%;
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
  font-size: 14px;

  border: 2px solid rgba(255,255,255,0.9); 
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);

  backdrop-filter: blur(4px);

  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: clusterPop 0.25s ease;
}

.cluster-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 18px rgba(0,0,0,0.3);
}

@keyframes clusterPop {
  from {
    transform: scale(0.85);
    opacity: 0.6;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Leaflet offset */
.leaflet-top.leaflet-left {
  top: 100px;
}

/* ======================== */
/* DROPDOWNS */
/* ======================== */

#submitPanel select {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

/* ======================== */
/* MOBILE */
/* ======================== */

@media (max-width: 600px) {

  #header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transform: none;

    width: 100%;
    max-width: none;

    border-radius: 0; /* 🔥 kill the bubble */
    
    background: rgba(255,255,255,0.95); /* more solid */
    backdrop-filter: blur(6px);

    padding: 10px 12px;
  }

}

/* ======================== */
/* MATCH INDEX VOTE STYLE */
/* ======================== */

.leaflet-popup-content .vote-inline {
  display: inline-flex;
  gap: 6px;
}

.leaflet-popup-content .vote-inline button {
  all: unset;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.leaflet-popup-content .vote-inline button:hover {
  transform: scale(1.2);
}

.leaflet-popup-content .vote-inline button:active {
  transform: scale(0.95);
}

.leaflet-popup-content .vote-inline button:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.leaflet-marker-icon {
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.28));
}

/* ======================== */
/* ⭐ MAP STARS */
/* ======================== */

.leaflet-popup-content .stars {
  display: inline-flex;
  gap: 4px;
}

.leaflet-popup-content .stars span {
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.leaflet-popup-content .stars span:hover {
  color: gold;
  transform: scale(1.2);
}

.leaflet-popup-content .stars span:active {
  transform: scale(0.95);
}

.leaflet-popup-content .stars span.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ======================== */
/* REPORT PANEL */
/* ======================== */

#reportPanel {
  top: 110px;
  left: 12px;
  width: 280px;
  z-index: 2000;
}

#reportPanel select,
#reportPanel textarea {
  font-family: inherit;
  font-size: 14px;
}

#reportPanel textarea {
  margin-top: 4px;
}

/* ==================================================
   COFFEE PATROL PRODUCTION MAP REDESIGN STYLES
================================================== */
#map {
  top: 72px; /* Offset for desktop header */
  height: calc(100vh - 72px);
}

@media (max-width: 768px) {
  #map {
    top: 0;
    height: calc(100vh - 65px); /* space for mobile bottom navigation */
  }
  .leaflet-top.leaflet-left {
    top: 70px !important;
  }
}

/* Floating Map Search Overlay */
.map-sim-search {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 420px;
  z-index: 1000;
}

.map-sim-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 3px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  outline: none;
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
}

.map-sim-search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

/* Sliding Side Drawer Details (Desktop) */
#mapDetailsPanel {
  position: fixed;
  top: 85px;
  bottom: 15px;
  right: 15px;
  width: 360px;
  background: var(--bg-card);
  border: 3px solid var(--border);
  z-index: 2000;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-strong);
}

#mapDetailsPanel.active {
  transform: translateX(0);
}

.drawer-header {
  background: var(--bg-header);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom: 3px solid var(--border);
}

.drawer-header * {
  color: #fff;
}

.close-drawer-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.close-drawer-btn:hover {
  background: rgba(255,255,255,0.2);
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Accuracy and Submit forms */
.panel {
  border: 3px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-strong) !important;
  background: var(--bg-card) !important;
}

/* Mobile responsive drawer */
@media (max-width: 768px) {
  #mapDetailsPanel {
    position: fixed;
    bottom: 75px; /* Offset bottom navigation */
    top: auto;
    left: 10px;
    right: 10px;
    width: auto;
    height: 300px;
    transform: translateY(120%);
    border-radius: var(--radius) var(--radius) var(--radius) var(--radius);
  }

  #mapDetailsPanel.active {
    transform: translateY(0);
  }
}


