/* Make the page fill the viewport and push footer down */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

#content {
  flex: 1; /* This pushes the footer to the bottom */
}

/* -------------------------
   GLOBAL LAYOUT
-------------------------- */

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f7f7f7;
  color: #333;
}

main#content {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

/* ⭐ Staging batch uses full-width layout */
main#content.staging-wide {
  max-width: none;
  width: 100%;
  padding-right: 40px;
}

/* -------------------------
   HEADER
-------------------------- */

/* Support SPA header placeholder */
#header {
  background: #222;
  color: white;
  padding: 15px 20px;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  margin: 0;
  font-size: 24px;
}

/* -------------------------
   NAVIGATION
-------------------------- */

.nav {
  display: flex;
  align-items: center;
}

.nav a {
  color: white;
  margin-left: 20px;
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover {
  text-decoration: underline;
}

/* -------------------------
   FOOTER
-------------------------- */

/* Support SPA footer placeholder */
#footer {
  background: #222;
  color: white;
  padding: 20px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-inner a {
  color: #ddd;
  text-decoration: none;
}

.footer-inner a:hover {
  text-decoration: underline;
}

/* -------------------------
   BUTTONS
-------------------------- */

.btn-primary {
  background: #0077cc;
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
}

.btn-primary:hover {
  background: #005fa3;
}

/* -------------------------
   UPLOAD PAGE
-------------------------- */

.upload-container {
  margin-bottom: 20px;
}

.file-row {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
}

.file-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.progress {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 8px;
  background: #4caf50;
  width: 0%;
  transition: width 0.3s ease;
}

/* -------------------------
   MAP PAGE
-------------------------- */

.map-container {
  width: 100%;
  height: 500px;
  background: #ddd;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
}

#map {
  width: 100%;
  height: 100%;
}

@media (max-width: 600px) {
  .map-container {
    height: 350px;
  }
}

/* -------------------------
   STAGING BATCH GRID
-------------------------- */

/* ⭐ UPDATED: Full-width responsive grid (no sidebar) */
#stagingImageGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

.image-thumb {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  display: block;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.image-thumb:hover {
  transform: scale(1.02);
}

.image-thumb img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
}

/* Mobile: 1 image per row */
@media (max-width: 600px) {
  #stagingImageGrid {
    grid-template-columns: 1fr;
  }
}

/* -------------------------
   UTILITY
-------------------------- */

.hidden {
  display: none;
}

/* -------------------------
   METADATA TEXT / TOGGLES (used in modal)
-------------------------- */

/* Metadata rows (for structured lists if needed later) */
.meta-row {
  margin-bottom: 12px;
}

.meta-label {
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

/* Toggle links (used for EXIF/Rekognition in modal) */
.toggle {
  cursor: pointer;
  color: #0077cc;
  margin-top: 8px;
  display: inline-block;
  font-size: 0.9rem;
}

#rawExifBlock,
#rekBlock {
  background: #eee;
  padding: 10px;
  border-radius: 6px;
  margin-top: 8px;
  white-space: pre-wrap;
  font-size: 0.8rem;
}

/* -------------------------
   THUMBNAIL METADATA
-------------------------- */

.thumb-meta {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #444;
  line-height: 1.25;
}

.thumb-meta .species {
  font-weight: 600;
  color: #222;
}

.thumb-meta .confidence {
  color: #0077cc;
  font-weight: 500;
}

.thumb-meta .taken {
  color: #555;
}

.thumb-meta .camera {
  color: #666;
}

.thumb-meta .gps {
  color: #0077cc;
}

.thumb-meta .animal {
  color: #0a7a0a;
  font-weight: 600;
}

.thumb-meta .buck {
  color: #8b4513;
  font-weight: 600;
}

/* ⭐ Buck dropdown spacing */
.buck-select {
  margin-top: 6px;
}

.buck-select select {
  width: 100%;
  padding: 6px;
  font-size: 0.85rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* -------------------------------------------------------
   IMAGE ZOOM MODAL
------------------------------------------------------- */

#imageModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5000;
}

#imageModal.hidden {
  display: none;
}

/* Dark overlay */
#modalOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(2px);
}

/* Modal content container */
#modalContent {
  position: relative;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  z-index: 5100;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* Close button */
#modalClose {
  position: absolute;
  top: 8px;
  right: 12px;
  background: #222;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  z-index: 5200;
}

#modalClose:hover {
  background: #444;
}

/* Navigation arrows */
.modalNav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20,20,20,0.7);
  color: #fff;
  border: none;
  padding: 12px 16px;
  font-size: 22px;
  cursor: pointer;
  border-radius: 6px;
  z-index: 5200;
}

#modalPrev {
  left: -60px;
}

#modalNext {
  right: -60px;
}

.modalNav:hover {
  background: rgba(20,20,20,0.9);
}

/* Full-size image */
#modalImage {
  max-width: 85vw;
  max-height: 60vh;
  border-radius: 6px;
  margin-bottom: 20px;
  object-fit: contain;
}

/* Metadata panel */
#modalMeta {
  width: 100%;
  max-height: 30vh;
  overflow-y: auto;
  background: #fafafa;
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.9rem;
}

#modalMeta h3 {
  margin-top: 0;
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
}

/* Buck dropdown inside modal */
#modalMeta .buck-select {
  margin-top: 10px;
}

#modalMeta select {
  width: 100%;
  padding: 6px;
  font-size: 0.9rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Keep/Discard radio group */
.modal-keep-discard {
  margin-top: 12px;
  padding: 8px 0;
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
}

.modal-keep-discard label {
  cursor: pointer;
}

/* -------------------------------------------------------
   SHARE MODAL
------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 360px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: #222;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
}

.modal-close:hover {
  background: #444;
}

.share-submit-btn {
  margin-top: 15px;
  width: 100%;
}

.camera-header-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  background: #555;
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
}

.btn-secondary:hover {
  background: #444;
}

/* -------------------------------------------------------
   KEEP / DISCARD BUTTONS UNDER THUMBNAILS
------------------------------------------------------- */

.keep-discard {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.keepBtn,
.discardBtn {
  flex: 1;
  padding: 6px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: white;
}

.keepBtn {
  background: #0a7a0a;
}

.discardBtn {
  background: #a00;
}

.keepBtn:hover {
  background: #0c8c0c;
}

.discardBtn:hover {
  background: #c00;
}
/* Cameras Page Layout */
.camera-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.camera-panel {
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 8px;
  background: #fafafa;
  max-width: 400px;
  margin-left: auto;
  margin-bottom: 2rem;
}

.camera-panel.hidden {
  display: none;
}

.checkbox-row {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.camera-save-btn {
  margin-top: 1rem;
}

#cameraList {
  margin-top: 1rem;
}

.camera-item {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  background: white;
}
/* Cameras Page Layout */
.camera-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.camera-panel {
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 8px;
  background: #fafafa;
  max-width: 400px;
  margin-left: auto;
  margin-bottom: 2rem;
}

.camera-panel.hidden {
  display: none;
}

.checkbox-row {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.camera-save-btn {
  margin-top: 1rem;
}

/* GRID LAYOUT */
.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.camera-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.camera-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.camera-card-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.camera-card-meta {
  font-size: 0.85rem;
  color: #666;
}