:root {
  --accent: #ff6a3d;
  --accent-fill: rgba(255, 106, 61, 0.28);
  --accent-stroke: #e8551f;
  --ink: #1b1f24;
  --paper: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

#app-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e2e2e2;
  position: relative;
  z-index: 100;
  background: var(--paper);
}

#app-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

#app-sub {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: #666;
}

#filter-bar {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e2e2e2;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

#filter-bar label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

#filter-bar input[type="date"] {
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

#filter-reset {
  padding: 0.3rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f9f9f9;
  cursor: pointer;
  font-size: 0.9rem;
}

#filter-reset:hover {
  background: #f0f0f0;
}

#map {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  bottom: 0;
}

#load-error {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff3f0;
  border: 1px solid var(--accent-stroke);
  color: #7a2b12;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  max-width: 90vw;
}

.hidden { display: none !important; }

#rotate-2d,
#maptype-toggle {
  position: absolute;
  top: 155px;
  z-index: 10;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-size: 1rem;
}

#rotate-2d {
  left: 12px;
}

#maptype-toggle {
  left: 52px;
}

#rotate-2d:hover,
#maptype-toggle:hover {
  background: #f2f2f2;
}

/* Modal */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem 1rem;
}

#modal {
  position: relative;
  background: var(--paper);
  border-radius: 10px;
  max-width: min(960px, 96vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

#modal-image-wrap {
  position: relative;
  width: 100%;
  height: 85vh;
  background: #111;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s;
}

#modal-image[data-zoomed="true"] {
  cursor: zoom-out;
}

#zoom-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 10;
}

#zoom-controls button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

#zoom-controls button:hover {
  background: rgba(255, 255, 255, 0.3);
}

#zoom-level {
  color: #fff;
  font-size: 0.85rem;
  min-width: 45px;
  text-align: center;
}

#modal-meta {
  padding: 0.9rem 1.1rem 1.1rem;
}

#modal-filename {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  word-break: break-word;
}

#modal-details {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.5;
}

#modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

#modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}
