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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
  z-index: 10;
}

#header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.logo {
  margin-right: 8px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #555;
  background: transparent;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: #888;
  color: #fff;
}

.filter-btn.active {
  border-color: var(--cat-color, #666);
  background: color-mix(in srgb, var(--cat-color, #444) 20%, transparent);
  color: #fff;
  font-weight: 600;
}

.filter-btn.all-btn {
  border-color: #666;
  color: #999;
}

.filter-btn.all-btn.active {
  background: #444;
  color: #fff;
  border-color: #888;
}

#btn-refresh {
  background: none;
  border: 1px solid #555;
  color: #ccc;
  font-size: 18px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

#btn-refresh:hover {
  border-color: #888;
  color: #fff;
}

#btn-refresh.spinning {
  animation: spin 0.6s linear;
}

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

#main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#map-container {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

#sidebar {
  width: 340px;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  background: #16213e;
  border-left: 1px solid #0f3460;
}

.sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid #0f3460;
}

.sidebar-header h2 {
  font-size: 15px;
  font-weight: 600;
}

#report-count {
  color: #888;
  font-weight: 400;
  margin-left: 4px;
}

#report-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

#report-list::-webkit-scrollbar {
  width: 6px;
}

#report-list::-webkit-scrollbar-track {
  background: transparent;
}

#report-list::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.report-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: #1a1a3e;
  cursor: pointer;
  transition: background 0.15s;
}

.report-card:hover {
  background: #22224a;
}

.report-card .symbol {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.report-card .info {
  flex: 1;
  min-width: 0;
}

.report-card .info .title {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.report-card .info .meta {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.report-card .votes {
  text-align: right;
  flex-shrink: 0;
}

.report-card .votes .up {
  color: #4caf50;
  font-size: 12px;
}

.report-card .votes .down {
  color: #f44336;
  font-size: 12px;
}

.sidebar-footer {
  padding: 8px 16px;
  border-top: 1px solid #0f3460;
  font-size: 11px;
  color: #666;
  text-align: center;
}

/* popup */
#popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  transition: opacity 0.2s, transform 0.2s;
}

#popup.popup-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
}

.popup-content {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.popup-header .badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.popup-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
}

.popup-close:hover {
  color: #fff;
}

.popup-body .popup-row {
  font-size: 13px;
  margin-bottom: 4px;
}

.popup-label {
  color: #888;
}

/* maplibre */
.maplibregl-ctrl-attrib {
  background: rgba(22, 33, 62, 0.85) !important;
  color: #888 !important;
  font-size: 10px !important;
}

.maplibregl-ctrl-attrib a {
  color: #aaa !important;
}

@media (max-width: 720px) {
  #sidebar {
    display: none;
  }
}
