:root {
  --bg: #1e1e1e;
  --fg: #e5e5e5;
  --muted: #9aa0a6;
  --accent: #4f8cff;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

#toolbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(24,24,24,0.9), rgba(16,16,16,0.9));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #2a2a2a;
  position: sticky;
  top: 0;
  z-index: 10;
}

#toolbar button {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #1f1f1f;
  color: var(--fg);
  cursor: pointer;
  transition: transform .08s ease, filter .08s ease, background .08s ease;
}
#toolbar button:active { transform: translateY(1px); }
#toolbar button.primary { background: var(--accent); border-color: #3f73ff; color: #fff; box-shadow: 0 6px 18px rgba(79,140,255,0.25); }
#toolbar button.ghost { background: #181818; color: var(--muted); }
#toolbar button.circle { width: 34px; padding: 0; border-radius: 50%; }

.image-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 8px;
  background: rgba(79, 140, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(79, 140, 255, 0.3);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.image-counter:hover {
  background: rgba(79, 140, 255, 0.25);
  border-color: rgba(79, 140, 255, 0.5);
}

#toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #3a3a3a;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  display: none;
}

#toolbar button:hover { border-color: #3a3a3a; background: #242424; }

#toolbar .spacer { flex: 1; }

#viewer {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 170px;
  overflow: hidden;
  transition: top 0.2s ease, right 0.2s ease;
}

/* When info panel is open, reserve space on the right so content isn't covered */
.info-open #viewer { right: 340px; }
.info-open #filmstrip { right: 340px; }
.info-open #gridView { right: 340px; }

/* Ensure filmstrip doesn't overlap with info panel */
.info-open #filmstrip { 
  right: 340px; 
  width: calc(100vw - 340px);
}

/* When info panel is open, adjust filmstrip to not overlap with extended panel */
.info-open #filmstrip {
  bottom: 0;
  height: 170px;
}

/* removed filters-visible adjustments */

/* Info panel now extends to bottom of page */

/* Additional spacing to prevent any overlap */
#viewer { top: 52px; }
#gridView { top: 52px; }

/* Ensure proper spacing between elements */
#toolbar { 
  height: 52px; 
  min-height: 52px;
  box-sizing: border-box;
}

/* removed filtersBar min-height */

/* Prevent any potential overlap with proper z-index layering */
#toolbar { z-index: 10; }
/* removed filtersBar z-index */
#infoPanel { z-index: 1000; }
#filmstrip { z-index: 5; }

#dropHint {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
  opacity: 0.6;
}

#image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  transform-origin: center center;
  max-width: none;
  user-select: none;
}

#video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  max-width: none;
  max-height: none;
  background: #000;
}

#zoomLabel {
  min-width: 56px;
  text-align: center;
  color: var(--muted);
}

/* removed start screen styles */

#infoPanel {
  position: fixed;
  top: 52px;
  right: 0;
  bottom: 0;
  width: 340px;
  background: #121212;
  border-left: 1px solid #2a2a2a;
  padding: 12px 12px 12px 14px;
  overflow: auto;
  z-index: 1000;
  box-sizing: border-box;
  transition: top 0.2s ease, bottom 0.2s ease;
}



/* Hide drop hint and other elements in fullscreen mode */
body.fs-ui-visible #dropHint {
  display: none !important;
}

/* Ensure UI elements are pure overlays - they don't affect image sizing */
body.fs-ui-visible #toolbar,
body.fs-ui-visible #filmstrip {
  background: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(8px) !important;
}

/* Fullscreen viewer styling - ensure it's truly full screen */
body.fs-ui-visible #viewer {
  background: #000 !important;
  overflow: hidden !important;
}



#infoPanel .row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #2a2a2a;
}

#infoPanel .row:last-child { border-bottom: none; }
#infoPanel .label { color: var(--muted); }
#infoPanel .actions { display: flex; justify-content: flex-end; padding-top: 12px; }
#infoPanel button { height: 28px; padding: 0 12px; }

.miniMap { margin-top: 10px; border: 1px solid #2a2a2a; border-radius: 8px; overflow: hidden; }
#miniMapLeaflet { width: 100%; height: 220px; }

/* removed grid styles */

/* removed map panel */

/* Map overlay */
#mapOverlay[hidden] { display: none; }
#mapOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 9999; display: flex; flex-direction: column; }
#mapOverlayBar { height: 48px; display: flex; align-items: center; justify-content: flex-end; padding: 8px; background: #111; border-bottom: 1px solid #2a2a2a; gap: 8px; }
#mapOverlayBar button { height: 32px; padding: 0 12px; }
#mapOverlayLeaflet { flex: 1; width: 100%; }

/* Tutorial overlay */
#tutorialOverlay[hidden] { display: none !important; }
#tutorialOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}
.tutorial-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 12px 16px; 
  background: #111; 
  border-bottom: 1px solid #2a2a2a; 
}
.tutorial-header h2 { 
  margin: 0; 
  font-size: 18px; 
  color: var(--fg); 
}
.tutorial-actions { display: flex; gap: 8px; }
.tutorial-body { 
  flex: 1; 
  overflow: auto; 
  padding: 18px 22px; 
}
.tutorial-content { line-height: 1.7; }
.tutorial-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.tutorial-toc { position: sticky; top: 72px; align-self: start; background: #121212; border: 1px solid #2a2a2a; border-radius: 12px; padding: 12px; }
.tutorial-toc .toc-title { font-weight: 700; color: #cbd6ff; margin-bottom: 8px; }
.tutorial-toc ul { list-style: none; padding: 0; margin: 0; }
.tutorial-toc li { margin: 6px 0; }
.tutorial-toc a { color: var(--fg); text-decoration: none; padding: 6px 8px; display: block; border-radius: 6px; }
.tutorial-toc a:hover { background: #1c1c1c; color: var(--accent); }
.tutorial-content-wrap { background: #121212; border: 1px solid #2a2a2a; border-radius: 12px; padding: 16px 20px; }
.tutorial-content-wrap section { padding-bottom: 10px; border-bottom: 1px dashed #2a2a2a; margin-bottom: 16px; }
.tutorial-content-wrap section:last-child { border-bottom: none; }
.tutorial-content-wrap h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px 0; color: #cbd6ff; }
.badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.kbd { display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; min-width: 22px; height: 22px; border-radius: 6px; background: #1c1c1c; border: 1px solid #333; color: #eaeaea; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 12px; }
.shortcut-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; background: #101010; border: 1px solid #2a2a2a; border-radius: 10px; padding: 12px; }
.shortcut-note { margin-top: 12px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }
.mac-shortcuts { margin-top: 16px; background: #0a0a0a; border-color: #1a1a1a; }
.tutorial-ss { width: 100%; max-width: 960px; border-radius: 10px; border: 1px solid #2a2a2a; background: #0f0f0f; margin: 8px 0 12px; }

@media (max-width: 980px) {
  .tutorial-layout { grid-template-columns: 1fr; }
  .tutorial-toc { position: relative; top: auto; }
}
.tutorial-lang-toggle { 
  margin-left: 12px; 
}

/* Mini map button styling */
#miniMap button {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #2a2a2a;
  background: #1f1f1f;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s ease;
}

#miniMap button:hover {
  background: #242424;
  border-color: #3a3a3a;
}

#miniMap button:active {
  transform: translateY(1px);
}
/* removed filters bar and timelineCanvas styles */
/* Filters Bar */
#filtersBar[hidden] { display: none; }
#filtersBar {
  position: sticky;
  top: 52px;
  z-index: 9;
  background: #141414;
  border-bottom: 1px solid #2a2a2a;
  padding: 10px 14px;
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
.filters-row:last-child { margin-bottom: 0; }

.filters-group { grid-column: span 3; display: flex; flex-direction: column; gap: 6px; }
.filters-group.inline { grid-column: span 1; justify-content: end; align-items: center; flex-direction: row; gap: 8px; }
.filters-group label { color: #cbd6ff; font-size: 12px; font-weight: 600; letter-spacing: 0.2px; }
.filters-group input,
.filters-group select { 
  height: 32px; 
  padding: 0 10px; 
  border-radius: 6px; 
  border: 1px solid #3a3a3a; 
  background: #1f1f1f; 
  color: var(--fg);
}
.filters-group input[type="date"]{
  padding-left: 38px; /* increased room for icon */
  position: relative;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%23ffffff" viewBox="0 0 16 16"><path d="M3 0a1 1 0 0 1 1 1v1h8V1a1 1 0 1 1 2 0v1h1a1 1 0 0 1 1 1v2H0V3a1 1 0 0 1 1-1h1V1a1 1 0 0 1 1-1z"/><path d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6h16v8z"/></svg>');
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 18px 18px;
  border-color: #4f8cff;
  box-shadow: 0 0 0 2px rgba(79,140,255,0.15);
  transition: all 0.2s ease;
}
.filters-group input[type="date"]:hover{
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%23ffffff" viewBox="0 0 16 16"><path d="M3 0a1 1 0 0 1 1 1v1h8V1a1 1 0 1 1 2 0v1h1a1 1 0 0 1 1 1v2H0V3a1 1 0 0 1 1-1h1V1a1 1 0 0 1 1-1z"/><path d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6h16v8z"/></svg>');
  background-size: 19px 19px;
  background-position: 11.5px center;
  border-color: #5a9aff;
  box-shadow: 0 0 0 2px rgba(90,154,255,0.2);
}

.filters-group input[type="date"]:focus{
  border-color: #7fb0ff;
  box-shadow: 0 0 0 2px rgba(127,176,255,0.25);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%23ffffff" viewBox="0 0 16 16"><path d="M3 0a1 1 0 0 1 1 1v1h8V1a1 1 0 1 1 2 0v1h1a1 1 0 0 1 1 1v2H0V3a1 1 0 0 1 1-1h1V1a1 1 0 0 1 1-1z"/><path d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6h16v8z"/></svg>');
  background-size: 20px 20px;
  background-position: 11px center;
}
.filters-group .range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.filters-group .range input { width: 100%; }

.filters-actions { grid-column: span 3; display: flex; align-items: flex-end; gap: 10px; }
.filters-actions .btn-apply,
.filters-actions .btn-clear { 
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid #2a2a2a; cursor: pointer; 
}
.filters-actions .btn-apply { background: var(--accent); border-color: #3f73ff; color: #fff; }
.filters-actions .btn-clear { background: #1f1f1f; color: var(--muted); }
.filters-count { color: var(--muted); font-size: 12px; margin-left: 8px; }

/* Layout shifts when filters are visible */
/* When filters are visible, push content down by the bar height */
body.filters-visible #viewer { top: calc(52px + var(--filters-h, 90px)); }
body.filters-visible #gridView { top: calc(52px + var(--filters-h, 90px)); }

@media (max-width: 1100px) {
  .filters-group { grid-column: span 4; }
  .filters-actions { grid-column: span 4; }
}
@media (max-width: 800px) {
  .filters-group { grid-column: span 6; }
  .filters-actions { grid-column: span 6; }
}
@media (max-width: 520px) {
  .filters-group, .filters-actions { grid-column: span 12; }
}

/* Filmstrip */
#filmstrip[hidden] { display: none; }
#filmstrip { 
  position: absolute; 
  left: 0; 
  right: 0; 
  bottom: 0; 
  height: 170px; 
  background: #111; 
  border-top: 1px solid #2a2a2a; 
  overflow: hidden; 
  z-index: 5;
  transition: right 0.2s ease, width 0.2s ease;
}
#filmstripTrack { position: absolute; left: 40px; right: 40px; top: 0; bottom: 0; display: flex; gap: 6px; padding: 6px; overflow-x: auto; overflow-y: hidden; }
#filmstripTrack::-webkit-scrollbar { 
  height: 12px; 
  background: #1a1a1a;
}
#filmstripTrack::-webkit-scrollbar-thumb { 
  background: #4f8cff; 
  border-radius: 6px;
  border: 1px solid #2a2a2a;
  transition: background 0.2s ease;
}
#filmstripTrack::-webkit-scrollbar-thumb:hover { 
  background: #5a9aff; 
}
#filmstripTrack::-webkit-scrollbar-track { 
  background: #1a1a1a; 
  border-radius: 6px;
}

/* Firefox scrollbar styling */
#filmstripTrack {
  scrollbar-width: auto;
  scrollbar-color: #4f8cff #1a1a1a;
}
.film-thumb { width: 200px; height: 150px; object-fit: contain; border-radius: 4px; border: 1px solid #333; cursor: pointer; opacity: 0.85; transition: opacity .15s, transform .15s; background: #1a1a1a; }
.film-thumb:hover { opacity: 1; transform: translateY(-2px); }
.film-thumb.active { outline: 2px solid var(--accent); opacity: 1; }

.filmstripNav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #2a2a2a;
  background: #1b1b1b;
  color: var(--fg);
  cursor: pointer;
  z-index: 2;
}
#filmstripPrev { left: 4px; }
#filmstripNext { right: 4px; }

/* ===== FULLSCREEN MODE - BULLETPROOF IMPLEMENTATION ===== */

/* When in fullscreen, hide everything by default */
body.fs-ui-visible #toolbar,
body.fs-ui-visible #filmstrip {
  display: none !important;
}

/* Only show when explicitly visible */
body.fs-ui-visible.toolbar-visible #toolbar {
  display: flex !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(24,24,24,0.9), rgba(16,16,16,0.9)) !important;
  backdrop-filter: blur(8px) !important;
  padding: 8px 12px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  height: 52px !important;
  align-items: center !important;
  gap: 10px !important;
  border-bottom: 1px solid #2a2a2a !important;
}

body.fs-ui-visible.filmstrip-visible #filmstrip {
  display: block !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9) !important;
  backdrop-filter: blur(10px) !important;
  padding: 12px 20px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Fullscreen viewer - covers entire screen */
body.fs-ui-visible #viewer {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 1;
  background: #000;
}

/* Ensure viewer is not covered by toolbar/filmstrip */
body.fs-ui-visible.toolbar-visible #viewer {
  top: 0 !important;
}

body.fs-ui-visible.filmstrip-visible #viewer {
  bottom: 0 !important;
}

/* Fullscreen images and videos - centered and scaled */
body.fs-ui-visible #image,
body.fs-ui-visible #video {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  /* Do not override transform in fullscreen so JS scaling/panning works */
  /* Transform is controlled by inline style from JS (setTransform) */
  max-width: none !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
  object-fit: initial !important;
  cursor: pointer !important; /* Indicate clickable for double-click zoom reset */
}

/* Info panel in fullscreen */
body.fs-ui-visible #infoPanel {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 340px !important;
  z-index: 1001 !important;
  background: rgba(18, 18, 18, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Adjust viewer when info panel is open */
body.fs-ui-visible.info-open #viewer {
  right: 340px !important;
}

/* Hide drop hint in fullscreen */
body.fs-ui-visible #dropHint {
  display: none !important;
}

/* Hide starter overlay in fullscreen */
body.fs-ui-visible #starterOverlay[hidden] {
  z-index: -1 !important;
  pointer-events: none !important;
}

/* ===== VISUAL HINTS FOR AUTO-HIDE ===== */

/* Toolbar hint when hidden */
body.fs-ui-visible:not(.toolbar-visible) #toolbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: rgba(79, 140, 255, 0.6);
  border-radius: 2px;
  opacity: 0.8;
  transition: all 0.3s ease;
}

body.fs-ui-visible:not(.toolbar-visible) #toolbar:hover::before {
  width: 100px;
  height: 6px;
  background: rgba(79, 140, 255, 0.9);
}

/* Filmstrip hint when hidden */
body.fs-ui-visible:not(.filmstrip-visible) #filmstrip::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: rgba(79, 140, 255, 0.6);
  border-radius: 2px;
  opacity: 0.8;
  transition: all 0.3s ease;
}

body.fs-ui-visible:not(.filmstrip-visible) #filmstrip:hover::before {
  width: 100px;
  height: 6px;
  background: rgba(79, 140, 255, 0.9);
}



/* ===== NORMAL MODE POSITIONING ===== */

/* Toolbar in normal mode */
#toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #121212;
  border-bottom: 1px solid #333;
}

/* Filmstrip in normal mode */
#filmstrip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: #121212;
  border-top: 1px solid #333;
}

/* Hide filmstrip in Grid view */
body.grid-view #filmstrip {
  display: none !important;
}

/* Viewer in normal mode */
#viewer {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 170px;
  z-index: 1;
}

/* Hide drop hint in fullscreen mode to prevent overlap */
body.fs-ui-visible #dropHint {
  display: none !important;
}

/* Ensure starter overlay doesn't interfere in fullscreen */
body.fs-ui-visible #starterOverlay[hidden] {
  z-index: -1 !important;
  pointer-events: none !important;
}



/* Centered thumbnail popup styling */
.centered-thumb-popup {
  pointer-events: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  /* Center the popup in the map */
  position: absolute !important;
  z-index: 10000 !important;
  /* Ensure popup is properly sized and positioned */
  min-width: 1000px;
  min-height: 800px;
}

/* Centered thumbnail container */
.centered-thumb-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100% !important;
  height: 100% !important;
  padding: 20px;
  /* Ensure container fills the popup */
  min-width: 1000px;
  min-height: 800px;
}

/* Thumbnail frame styling */
.thumb-frame {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #4f8cff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  /* Ensure frame is properly sized */
  width: 900px !important;
  height: 700px !important;
  max-width: 900px !important;
  max-height: 700px !important;
  min-width: 900px !important;
  min-height: 700px !important;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Centered thumbnail image */
.centered-thumb {
  display: block;
  width: 800px !important;
  height: 600px !important;
  max-width: 800px !important;
  max-height: 600px !important;
  min-width: 800px !important;
  min-height: 600px !important;
  border-radius: 8px;
  cursor: pointer;
  object-fit: contain;
  background: #1a1a1a;
  /* Smooth transitions */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.centered-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(79, 140, 255, 0.3);
}

/* Leaflet thumbnail tooltip */
.thumb-tooltip {
  pointer-events: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  /* Ensure proper positioning in fullscreen mode */
  position: absolute !important;
  z-index: 10000 !important;
}
.thumb-tooltip .thumb-box {
  background: rgba(0,0,0,0.8);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #333;
}
.thumb-tooltip img {
  display: block;
  max-width: 600px;
  max-height: 450px;
  border-radius: 4px;
  cursor: pointer;
  object-fit: contain;
  background: #1a1a1a;
  /* Safari and Chrome specific properties */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Much larger thumbnails in fullscreen map mode */
html:fullscreen .thumb-tooltip img {
  max-width: 800px !important;
  max-height: 600px !important;
}

/* Also apply to webkit fullscreen for broader browser support */
html:-webkit-full-screen .thumb-tooltip img {
  max-width: 800px !important;
  max-height: 600px !important;
}

/* Safari and Chrome fullscreen support */
html:-webkit-full-screen .thumb-tooltip .thumb-box {
  padding: 12px;
  border-radius: 10px;
}

html:-webkit-full-screen .thumb-tooltip img {
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Opera fullscreen support */
html:-o-full-screen .thumb-tooltip img {
  max-width: 800px !important;
  max-height: 600px !important;
}

/* Opera-specific styles for better compatibility */
@supports (-o-appearance: none) {
  /* Opera-specific button styling */
  #toolbar button {
    -o-appearance: none;
    appearance: none;
  }
  
  /* removed opera-specific filtersBar input styling */
  
  /* Opera-specific scrollbar styling */
  #filmstripTrack::-o-scrollbar {
    width: 12px;
  }
  
  #filmstripTrack::-o-scrollbar-thumb {
    background: #4f8cff;
    border-radius: 6px;
    border: 1px solid #2a2a2a;
    transition: background 0.2s ease;
  }
  
  #filmstripTrack::-o-scrollbar-thumb:hover {
    background: #5a9aff;
  }
  
  #filmstripTrack::-o-scrollbar-track {
    background: #1a1a1a;
    border-radius: 6px;
  }
}

/* Safari and Chrome specific optimizations */
@supports (-webkit-appearance: none) {
  /* Safari and Chrome specific styles */
  .thumb-tooltip img {
  user-select: none;
  -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
  }
  
  /* Ensure proper scaling in Safari */
  .thumb-tooltip img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Opera browser detection styles */
.opera-browser #toolbar button {
  /* Enhanced button styling for Opera */
  transition: all 0.15s ease;
}

/* removed opera-browser filtersBar focus styles */

/* Apply to body when fullscreen class is present */
body.fs-ui-visible .thumb-tooltip img,
body.fs-ui-hidden .thumb-tooltip img {
  max-width: 800px !important;
  max-height: 600px !important;
}

/* Safari and Chrome fullscreen detection via JavaScript classes */
body.fs-ui-visible .thumb-tooltip .thumb-box,
body.fs-ui-hidden .thumb-tooltip .thumb-box {
  padding: 12px;
  border-radius: 10px;
}

body.fs-ui-visible .thumb-tooltip img,
body.fs-ui-hidden .thumb-tooltip img {
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Fix popup positioning when using JavaScript fullscreen detection */
body.fs-ui-visible .thumb-tooltip,
body.fs-ui-hidden .thumb-tooltip {
  position: absolute !important;
  z-index: 10000 !important;
}

body.fs-ui-visible .leaflet-popup-content-wrapper,
body.fs-ui-hidden .leaflet-popup-content-wrapper {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

body.fs-ui-visible .leaflet-popup-tip,
body.fs-ui-hidden .leaflet-popup-tip {
  display: none !important;
}

/* JavaScript fullscreen centered thumbnail styling */
body.fs-ui-visible .centered-thumb-popup .centered-thumb-container,
body.fs-ui-hidden .centered-thumb-popup .centered-thumb-container {
  padding: 30px;
  min-width: 1100px !important;
  min-height: 900px !important;
}

body.fs-ui-visible .centered-thumb-popup .thumb-frame,
body.fs-ui-hidden .centered-thumb-popup .thumb-frame {
  padding: 20px;
  border-width: 3px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  width: 1000px !important;
  height: 800px !important;
}

body.fs-ui-visible .centered-thumb-popup .centered-thumb,
body.fs-ui-hidden .centered-thumb-popup .centered-thumb {
  width: 900px !important;
  height: 700px !important;
  border-radius: 12px;
}

/* Ensure thumbnails scale properly in fullscreen mode */
html:fullscreen .thumb-tooltip .thumb-box {
  padding: 12px;
  border-radius: 10px;
}

html:fullscreen .thumb-tooltip img {
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Fullscreen centered thumbnail styling */
html:fullscreen .centered-thumb-popup .centered-thumb-container {
  padding: 30px;
  min-width: 1100px !important;
  min-height: 900px !important;
}

html:fullscreen .centered-thumb-popup .thumb-frame {
  padding: 20px;
  border-width: 3px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  width: 1000px !important;
  height: 800px !important;
}

html:fullscreen .centered-thumb-popup .centered-thumb {
  width: 900px !important;
  height: 700px !important;
  border-radius: 12px;
}

/* Fix popup positioning in fullscreen mode */
html:fullscreen .thumb-tooltip {
  position: absolute !important;
  z-index: 10000 !important;
}

html:fullscreen .leaflet-popup-content-wrapper {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

html:fullscreen .leaflet-popup-tip {
  display: none !important;
}

/* Webkit fullscreen support */
html:-webkit-full-screen .thumb-tooltip .thumb-box {
  padding: 12px;
  border-radius: 10px;
}

html:-webkit-full-screen .thumb-tooltip img {
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Webkit fullscreen centered thumbnail styling */
html:-webkit-full-screen .centered-thumb-popup .centered-thumb-container {
  padding: 30px;
  min-width: 1100px !important;
  min-height: 900px !important;
}

html:-webkit-full-screen .centered-thumb-popup .thumb-frame {
  padding: 20px;
  border-width: 3px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  width: 1000px !important;
  height: 800px !important;
}

html:-webkit-full-screen .centered-thumb-popup .centered-thumb {
  width: 900px !important;
  height: 700px !important;
  border-radius: 12px;
}

/* Fix popup positioning in webkit fullscreen mode */
html:-webkit-full-screen .thumb-tooltip {
  position: absolute !important;
  z-index: 10000 !important;
}

html:-webkit-full-screen .leaflet-popup-content-wrapper {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

html:-webkit-full-screen .leaflet-popup-tip {
  display: none !important;
}

/* Additional Safari and Chrome fullscreen support */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  /* Safari and Chrome specific fullscreen rules */
  html:-webkit-full-screen .thumb-tooltip img {
    max-width: 800px !important;
    max-height: 600px !important;
  }
  
  /* Ensure proper display in Safari fullscreen */
  html:-webkit-full-screen .thumb-tooltip {
    z-index: 10000;
  }
}

/* Safari and Chrome specific fullscreen fallbacks */
@supports not (html:fullscreen) {
  /* For browsers that don't support :fullscreen pseudo-class */
  .thumb-tooltip img {
    max-width: 600px;
    max-height: 450px;
  }
  
  /* Apply fullscreen styles via JavaScript classes for Safari/Chrome */
  body.fs-ui-visible .thumb-tooltip img,
  body.fs-ui-hidden .thumb-tooltip img {
    max-width: 800px !important;
    max-height: 600px !important;
  }
}

/* Additional popup positioning fixes for all browsers */
.leaflet-popup {
  /* Ensure popup container is properly positioned */
  position: absolute !important;
}

.leaflet-popup-content-wrapper {
  /* Remove default styling that can interfere with positioning */
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.leaflet-popup-content {
  /* Remove default padding and margins */
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

/* Ensure centered thumbnail popup content is properly sized */
.centered-thumb-popup .leaflet-popup-content {
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.leaflet-popup-tip {
  /* Hide the default popup tip */
  display: none !important;
}

/* Center popup content in the map viewport */
.centered-thumb-popup .leaflet-popup-content-wrapper {
  /* Center the popup content */
  display: flex;
  justify-content: center;
  align-items: center;
  /* Ensure proper sizing for the popup */
  width: 1000px !important;
  height: 800px !important;
  min-width: 1000px !important;
  min-height: 800px !important;
  max-width: 1000px !important;
  max-height: 800px !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Ensure popup is centered in fullscreen mode */
html:fullscreen .centered-thumb-popup .leaflet-popup-content-wrapper,
html:-webkit-full-screen .centered-thumb-popup .leaflet-popup-content-wrapper,
body.fs-ui-visible .centered-thumb-popup .leaflet-popup-content-wrapper,
body.fs-ui-hidden .centered-thumb-popup .leaflet-popup-content-wrapper {
  /* Full viewport centering */
  min-height: 100vh;
  min-width: 100vw;
  justify-content: center;
  align-items: center;
}


/* Starter overlay */
#starterOverlay[hidden] { 
  display: none !important; 
  z-index: -1 !important;
  pointer-events: none !important;
}
#starterOverlay { 
  position: fixed; 
  inset: 0; 
  background: linear-gradient(135deg, rgba(0,0,0,0.95) 0%, rgba(20,20,40,0.95) 100%); 
  backdrop-filter: blur(20px); 
  z-index: 10000; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  padding: 20px; 
}

#starterModal { 
  width: min(800px, 100%); 
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); 
  border-radius: 24px; 
  box-shadow: 
    0 32px 64px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.1),
    inset 0 1px 0 rgba(255,255,255,0.1); 
  border: 1px solid rgba(255,255,255,0.1); 
  position: relative; 
  overflow: hidden; 
}

.starter-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.1;
  z-index: 0;
}

.starter-background-pattern {
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(79, 140, 255, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 193, 7, 0.2) 0%, transparent 50%);
  animation: backgroundFloat 20s ease-in-out infinite;
}

@keyframes backgroundFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-10px, -10px) rotate(1deg); }
  66% { transform: translate(10px, 10px) rotate(-1deg); }
}

.starter-content {
  position: relative;
  z-index: 1;
  padding: 48px 48px 80px 48px; /* Added bottom padding for copyright */
}

.starter-header {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 48px;
  text-align: center;
}

.starter-icon-container {
  position: relative;
  flex-shrink: 0;
}

#starterIcon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(79, 140, 255, 0.3);
  transition: transform 0.3s ease;
}

#starterIcon:hover {
  transform: scale(1.05);
}

.starter-icon-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.2) 0%, transparent 70%);
  border-radius: 30px;
  z-index: -1;
  animation: iconGlow 3s ease-in-out infinite alternate;
}

@keyframes iconGlow {
  0% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 0.6; transform: scale(1.1); }
}

.starter-head-text {
  flex: 1;
}

.starter-head-text h1 {
  margin: 0 0 16px 0;
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #4f8cff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.starter-head-text p {
  margin: 0 0 12px 0;
  color: #e0e0e0;
  line-height: 1.6;
  font-size: 16px;
  font-weight: 400;
}

.starter-tagline {
  color: #4f8cff;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}

.starter-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 48px 0;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.feature-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(79, 140, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(79, 140, 255, 0.1);
}

.feature-icon {
  font-size: 32px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.feature-text h3 {
  margin: 0 0 8px 0;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
}

.feature-text p {
  margin: 0;
  color: #b0b0b0;
  line-height: 1.5;
  font-size: 14px;
}

.starter-meta {
  display: flex;
  justify-content: space-around;
  margin: 48px 0;
  padding: 32px;
  background: rgba(0,0,0,0.2);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}

.meta-item {
  text-align: center;
  flex: 1;
}

.meta-label {
  display: block;
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 500;
}

.meta-value {
  display: block;
  color: #4f8cff;
  font-size: 18px;
  font-weight: 600;
}

.starter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.starter-language-toggle {
  position: absolute;
  top: 32px;
  right: 32px;
}

.btn-language {
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
  color: #e0e0e0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.btn-language:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-1px);
}

.starter-check {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #b0b0b0;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s ease;
}

.starter-check:hover {
  color: #ffffff;
}

.starter-check input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.starter-check input[type="checkbox"]:checked + .checkmark {
  background: #4f8cff;
  border-color: #4f8cff;
}

.starter-check input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.action-buttons {
  display: flex;
  gap: 16px;
}

.btn-secondary, .btn-primary {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #e0e0e0;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #4f8cff 0%, #3d7aef 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(79, 140, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3d7aef 0%, #2d6adf 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 140, 255, 0.4);
}

.btn-arrow {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Responsive design for starter screen */
@media (max-width: 768px) {
  .starter-content {
    padding: 32px 24px;
  }
  
  .starter-header {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
  
  .starter-features {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .starter-meta {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .starter-actions {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
  
  .action-buttons {
    width: 100%;
    justify-content: center;
  }
}

/* Starter Copyright */
.starter-copyright {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
  padding: 0 48px;
  box-sizing: border-box;
}

.starter-copyright p {
  margin: 0;
  color: #888;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.starter-copyright p:hover {
  opacity: 1;
  color: #4f8cff;
}

/* Enhanced visibility for satellite maps and labels */
.leaflet-tile-pane {
  filter: contrast(1.3) brightness(1.15) saturate(1.1);
}

/* Make text labels much more visible on satellite maps */
.leaflet-overlay-pane .leaflet-tile {
  filter: contrast(1.5) brightness(1.3) saturate(1.2);
}

/* Enhanced text readability with stronger shadows and outlines */
.leaflet-overlay-pane .leaflet-tile {
  text-shadow: 
    0 0 6px rgba(0,0,0,0.9),
    0 0 10px rgba(0,0,0,0.8),
    0 0 14px rgba(0,0,0,0.7),
    0 0 18px rgba(0,0,0,0.6);
}

/* Additional styling for better map label visibility */
.leaflet-container {
  font-weight: 600;
}

/* Enhance road names and place labels */
.leaflet-overlay-pane .leaflet-tile {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Improve contrast for map elements */
.leaflet-control-attribution {
  background: rgba(0,0,0,0.8) !important;
  color: #ffffff !important;
  font-weight: 600;
}

/* Enhanced marker visibility */
.leaflet-marker-icon {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* Grid View Styles */
#gridView {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 90px;
  overflow-y: auto;
  background: var(--bg);
  padding: 20px;
  transition: top 0.2s ease, right 0.2s ease;
}

#gridContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  min-height: 400px;
}

.grid-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #3a3a3a;
}

.grid-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  border-color: var(--accent);
}

.grid-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.3);
  transform: scale(1.02);
}

.grid-item-img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
  background: #1a1a1a;
}

.grid-item-info {
  padding: 12px;
  font-size: 12px;
}

.grid-item-info .filename {
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
}

.grid-item-info .date {
  color: var(--muted);
  font-size: 11px;
}

#gridPagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}

#gridPagination button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #3a3a3a;
  background: #242424;
  color: var(--fg);
  cursor: pointer;
}

#gridPagination button:hover {
  background: #2a2a2a;
}

#gridPageInfo {
  color: var(--muted);
  font-size: 14px;
}

/* Face Detection Styles */
#faceDetectionOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.face-detection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 80%;
  max-width: 600px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid #3a3a3a;
}

.face-detection-header h3 {
  margin: 0;
  color: var(--fg);
  font-size: 18px;
}

.face-detection-header button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #3a3a3a;
  background: #242424;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.face-detection-header button:hover {
  background: #2a2a2a;
  border-color: var(--accent);
}

#faceDetectionResults {
  width: 80%;
  max-width: 600px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #3a3a3a;
}

.face-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #3a3a3a;
  transition: background 0.2s ease;
  border-radius: 8px;
  margin-bottom: 8px;
}

.face-result-item:hover {
  background: #2a2a2a;
}

.face-result-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.face-result-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #3a3a3a;
  transition: border-color 0.2s ease;
}

.face-result-item:hover .face-result-thumb {
  border-color: var(--accent);
}

.face-result-info {
  flex: 1;
}

.face-result-filename {
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--fg);
}

.face-result-count {
  color: var(--muted);
  font-size: 12px;
  background: rgba(79, 140, 255, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-block;
}

/* Map Provider Selector */
#mapProviderSelect {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #3a3a3a;
  background: #242424;
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

#mapProviderSelect:hover {
  border-color: var(--accent);
}

#mapProviderSelect:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.2);
}

/* Route Visualization Button */
#routeVisualizeBtn {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #3a3a3a;
  background: #242424;
  color: var(--fg);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

#routeVisualizeBtn:hover {
  background: #2a2a2a;
  border-color: var(--accent);
  transform: translateY(-1px);
}

#routeVisualizeBtn:active {
  transform: translateY(0);
}



/* When info panel is open, ensure thumbnails show whole image */
.info-open .film-thumb,
.info-open .grid-item-img {
  object-fit: contain;
}

/* Active button states */
#toolbar button.active {
  background: var(--accent);
  border-color: #3f73ff;
  color: #fff;
}

/* Inline Image Editor Styles */
.inline-editor {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1a1a1a;
  z-index: 10000;
  display: none;
}

.editor-header {
  height: 60px;
  background: #2a2a2a;
  border-bottom: 1px solid #404040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.editor-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
}

.close-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #404040;
  color: #ffffff;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: #505050;
}

.editor-content {
  display: flex;
  height: calc(100vh - 60px);
}

.editor-left-panel {
  width: 300px;
  background: #2a2a2a;
  border-right: 1px solid #404040;
  overflow-y: auto;
  padding: 20px;
}

.editor-center-panel {
  flex: 1;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.editor-right-panel {
  width: 250px;
  background: #2a2a2a;
  border-left: 1px solid #404040;
  overflow-y: auto;
  padding: 20px;
}

.panel-section {
  margin-bottom: 30px;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #cccccc;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.control-group {
  margin-bottom: 20px;
}

.control-label {
  display: block;
  font-size: 12px;
  color: #999999;
  margin-bottom: 8px;
}

.slider-container {
  position: relative;
  margin-bottom: 15px;
}

.slider {
  width: 100%;
  height: 4px;
  background: #404040;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #4f8cff;
  border-radius: 50%;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  width: 16px;
  height: 16px;
  background: #4f8cff;
  border-radius: 50%;
  cursor: pointer;
}

.slider-value {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 11px;
  color: #cccccc;
  background: #2a2a2a;
  padding: 2px 6px;
  border-radius: 3px;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #4f8cff;
  color: white;
}

.btn-primary:hover {
  background: #3a7ce8;
}

.btn-secondary {
  background: #404040;
  color: #cccccc;
}

.btn-secondary:hover {
  background: #505050;
}

.image-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

#inlineImageCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  cursor: crosshair;
}

.info-section {
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.info-label {
  color: #999999;
}

.info-value {
  color: #cccccc;
}

/* Responsive adjustments for inline editor */
@media (max-width: 1200px) {
  .editor-left-panel {
    width: 250px;
  }
  .editor-right-panel {
    width: 200px;
  }
}

@media (max-width: 900px) {
  .editor-left-panel {
    width: 200px;
  }
  .editor-right-panel {
    width: 150px;
  }
}
