
.overlay { position: absolute; bottom: 2rem; left: 2rem; background: rgba(0, 0, 0, 0.6); padding: 1rem 1.5rem; border: 1px solid #0fefef; border-radius: 4px; z-index: 2; } 
.title { font-size: 1.5rem; } 
.description { font-size: 0.9rem; opacity: 0.85; } 
.hud.top { position: absolute; top: 1rem; left: 1rem; right: 1rem; display: flex; justify-content: space-between; padding: 0 2rem; z-index: 2; font-size: 0.9rem; } 
.hud.bottom { position: absolute; top: 60%; transform: translateY(-60%); display: flex; justify-content: space-between; align-items: flex-end; padding: 0 2rem; z-index: 2; } 
.radar { width: 100px; height: 100px; border: 1px solid #0fefef; border-radius: 50%; position: relative; overflow: hidden; } 
.sweep { position: absolute; width: 100%; height: 100%; border-radius: 50%; background: conic-gradient(rgba(15,239,239,0.2) 0deg, transparent 90deg); animation: sweep 2s linear infinite; } 
.dot { position: absolute; width: 6px; height: 6px; background: #0fefef; border-radius: 50%; top: 30%; left: 60%; } 
@keyframes sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } 
.cctv { position: absolute; bottom: 10rem; right: 5rem; width: 160px; height: 100px; border: 1px solid #0fefef; overflow: hidden; } 
.cctv video { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(0.8); } 
.cctv .rec { position: absolute; top: 5px; left: 5px; font-size: 0.8rem; color: var(--red); font-weight: var(--tg-fw-bold); animation: blink 1s infinite; } 
.cctv .timestamp { position: absolute; bottom: 4px; left: 4px; font-size: 0.7rem; background: rgba(0,0,0,0.5); padding: 2px 4px; } 
#gps-status span {  background: var(--raisin-black-2); border: solid 5px transparent;  background-clip: padding-box; border-radius: 100%;  padding: 0.2rem; box-shadow: -3px -3px 13px 3px var(--raisin-black-1), 4px 4px 15px 6px var(--raisin-black-3);  animation: depress 75ms linear; }

.galleryMain { width: 100%; display: flex; flex-direction: column; overflow: hidden; height: auto; }
.galleryWrap { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; height:100vh; }

/* 
.gallery { position: relative; width: 100%; height: 100vh; background: #000; overflow: hidden; }
*/

.gallery { flex: 1 1 auto; position: relative; overflow: hidden; background: #000; }

/*
.bg-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: bottom center; transition: opacity 0.3s; }
*/
.bg-image { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-size: cover; background-position: center; transition: opacity 0.3s; }

.gallery.dragging { cursor: grabbing; user-select: none; }
.gallery { cursor: grab; }

.controls, .hud-toggle { position: absolute; z-index: 10; }

.hud-toggle { display: none; opacity: 0; }

.controls { right: 2rem; top: 50%; transform: translateY(-50%); }
.controls button, .hud-toggle button { margin: 0.25rem; padding: 0.5rem 1rem; background: none; border: 1px solid #0fefef; color: #0fefef; cursor: pointer; }

.night-mode { --bg: #0a0a0a; --accent: #0fefef; --text: #8cf4f4; background-color: var(--bg); color: var(--text); } 
.night-mode .hud, .night-mode .overlay, .night-mode .controls, .night-mode .thumb-strip { background-color: rgba(10, 10, 10, 0.8); border-color: var(--accent); } 

.night-mode button { border-color: var(--accent); color: var(--accent); } 
.nvg-on .bg-image,
.nvg-on .cctv video { filter: brightness(1.6) contrast(0.8) grayscale(1) hue-rotate(90deg) saturate(0.7); } 

/* Optional grain overlay */
.nvg-on::after { content: ""; position: absolute; inset: 0; background: url('../images/gallery/grainOverlay.png'); background-size: cover; opacity: 0.15; pointer-events: none; z-index: 9999; } 
.hud-toggle { position: absolute; top: 1rem; right: 1rem; z-index: 10; display: flex; gap: 0.5rem; } 
.hud-toggle button { background: none; border: 1px solid #0fefef; color: #0fefef; padding: 0.3rem 0.6rem; cursor: pointer; font-size: 0.8rem; } 
.leisure-mode { --accent: #ffaa33; --text: #ffeedd; } 
.leisure-mode .hud,
.leisure-mode .overlay,
.leisure-mode .controls,
.leisure-mode .thumb-strip { background-color: rgba(25, 15, 0, 0.8); border-color: var(--accent); } 
.leisure-mode button { border-color: var(--accent); color: var(--accent); } 
body.leisure-mode { background: radial-gradient(#110d05, #000); } 
.hud-map { position: absolute; bottom: 1rem; left: 1rem; z-index: 5; color: var(--accent); font-size: 0.8rem; } 
.map-container { width: 140px; height: 100px; border: 1px solid var(--accent); background: url('https://tile.openstreetmap.org/15/17632/10752.png') center/cover no-repeat; position: relative; } 
.map-pin { position: absolute; width: 10px; height: 10px; background: red; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 8px red; } 
.map-info { margin-top: 4px; } 

.hud-weather { position: absolute; top: 1rem; right: 1rem; background: rgba(0, 0, 0, 0.7); padding: 0.8rem 1rem; border: 1px solid var(--accent); font-size: 0.85rem; color: var(--accent); z-index: 5; } 
.hud-weather h3 { margin-bottom: 0.5rem; font-size: 1rem; border-bottom: 1px solid var(--accent); } 

.hud-diagnostics { position: absolute; top: 8rem; right: 1rem; background: rgba(10,10,10,0.75); border: 1px solid var(--accent); padding: 0.8rem 1rem; font-size: 0.85rem; color: var(--accent); z-index: 5; } 
.hud-diagnostics h3 { margin-bottom: 0.5rem; font-size: 1rem; border-bottom: 1px solid var(--accent); } 
.diag-item { margin-bottom: 0.4rem; } 

/* thumb nav */

/*
.thumb-carousel { position: absolute; bottom: 0px; width: 100%; display: flex; align-items: center; background: rgba(0,0,0,0.7); z-index: 10; } 
*/
.thumb-carousel { flex: 0 0 auto; width: 100%; display: flex; align-items: center; background: rgba(0, 0, 0, 0.8); z-index: 10; padding: 0.5rem 1rem; }

.thumb-strip { flex: 1; display: flex; overflow-x: auto; padding: 1.5rem; gap: 0.5rem; scroll-behavior: smooth; } 
.thumb-arrow { background: none; border: 1px solid #0fefef; color: #0fefef; padding: 0.25rem 0.75rem; cursor: pointer; } 

.thumb-container { position: absolute; bottom: 4rem; right: 2rem; width: 100px; height: 100px; z-index: 3; } 
.thumbs img { width: 100%; height: 100%; object-fit: cover; } 
.thumb-container img, .thumb-strip img { border: 2px solid #0fefef; }
.thumb-strip-wrapper { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; background: rgba(0,0,0,0.6); z-index: 10; }
.thumb-strip img.active { border-color: #00f0f0; box-shadow: 0 0 5px #0fefef; }
.thumb-strip::-webkit-scrollbar { display: none; }
.thumb-arrow { background: none; border: 1px solid #0fefef; color: #0fefef; padding: 0.25rem 0.75rem; cursor: pointer; }
.thumb-strip img { height: 60px; width: auto; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.4); border-radius: 5px; user-select: none; pointer-events: all; cursor: pointer; transition: transform 0.2s ease; } 
.thumb-strip img:hover { transform: scale(1.5) rotate(-5deg); } 

/* Magnific popup */
.thumb-wrapper { position: relative; top: -100px; right:2px; width: 100%; height: 100%; }
.thumb-wrapper img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-icon { position: absolute; bottom: 2px; right: 50%; transform: translateX(50%); background: rgba(0, 0, 0, 0.6); color: #0fefef; padding: 6px 36px; font-size: 1.5rem; border-radius: 0px; opacity: 0; transition: opacity 0.2s; cursor: pointer; z-index: 2; }
.thumb-icon i { font-size: 1.5rem; }
.thumb-wrapper:hover .thumb-icon { opacity: 1; }

/* keyboard navigacija */
.keyboard-hint { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.7); color: #0fefef; padding: 0.6rem 1rem; border-radius: 4px; font-size: 0.85rem; z-index: 20; opacity: 1; transition: opacity 0.3s ease; pointer-events: none; user-select: none; }
.keyboard-hint.hidden { opacity: 0; }



/* Tablet i ispod: 85% screen height */
@media (max-height: 900px) {
  .galleryMain { max-height: 85vh; }
  .keyboard-hint { display: none; opacity: 0; }
  .thumb-wrapper .thumb-icon { opacity: 1; }
}

/* Mobile */
@media (max-height: 700px) {
  .galleryMain { max-height: 80vh; }
}

@media (max-width: 576px) {
  .thumb-strip img { height: 45px; }
}