/* =======================
   GLOBAL + RESET
======================= */
* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f9f9f9;
  color: #444;
}

/* Blurred background overlay */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  background: url('images/backround.jpg') center/cover no-repeat;
  filter: blur(8px) brightness(1.1);
  opacity: 0.7;
  pointer-events: none;
}

/* Content container */
.content {
  position: relative;
  z-index: 1;
  padding: 24px;
}

/* =======================
   Back Arrow
======================= */

    .back-arrow {
      text-decoration: none;
      font-size: 24px;
      color: black;
      display: inline-flex;
      align-items: center;
      padding: 10px;
    }

    .back-arrow:hover {
      opacity: 0.7;
    }

    .arrow-icon {
      margin-right: 8px;
    }

/* =======================
   TYPOGRAPHY
======================= */
h1 {
  text-align: center;
  font-size: 2.5rem;
  color: #5c5470;
  margin-bottom: 20px;
}

h3 {
  margin-bottom: 16px;
  color: #5c5470;
}

label {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
  color: #444;
}

/* =======================
   DROPDOWNS & INPUTS
======================= */
#trenchBookSelect {
  display: block;
  margin: 0 auto 20px auto;
  padding: 10px 14px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#trenchBookSelect:focus {
  outline: none;
  border-color: #a8cbdc;
  box-shadow: 0 0 5px rgba(168, 203, 220, 0.4);
}

/* =======================
   LAYOUT
======================= */
.main-layout {
  display: flex;
  flex-wrap: nowrap;             /* no wrapping */
  overflow-x: auto;              /* enable horizontal scroll */
  overflow-y: hidden;
  gap: 40px;
  padding-bottom: 20px;          /* space for scroll if needed */
  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;      /* Edge */
}

.main-layout > * {
  flex: 0 0 auto;                /* each child keeps its width */
}

.main-layout::-webkit-scrollbar {
  display: none;
}

.content-center {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

/* Equal height trench info + map */
.info-map-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 260px; /* Try 240–300 depending on design */
  gap: 12px;
}

#trenchInfoTable {
  height: 120px;
}

.mini-map {
  width: 320px;
  height: 220px /* Adjust height as needed */;
  min-height: 220px;
  max-height: 220px;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 0;
}

.select-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.select-wrapper label {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #444;
}
label[for="trenchBookSelect"] {
  display: block;
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: #444;
}

/* =======================
   TRENCH INFO TABLE
======================= */
#trenchInfoTable {
  background: #f8f4f9;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 24px;
  min-width: 220px;
  overflow: hidden;
}

#trenchInfoTable th {
  background: #e3e6f5;
  color: #5c5470;
  font-size: 1.1rem;
  padding: 10px 0;
  letter-spacing: 1px;
}

#trenchInfoTable td {
  padding: 8px 12px;
  border-bottom: 1px solid #ececec;
  background: #fff;
}

#trenchInfoTable td:first-child {
  font-weight: 500;
  background: #f3f1fa;
  width: 90px;
  color: #7a6f9b;
}

#trenchInfoTable tr:last-child td {
  border-bottom: none;
}

/* =======================
   MAP
======================= */
.mini-map {
  width: 320px;
  height: 220px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

/* =======================
   IMAGE VIEWER
======================= */
#imageViewer {
  position: relative;
  max-width: 650px;
  width: 100%;
  margin-bottom: 24px;
  padding: 20px;
  background-color: #f8f4f9;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  user-select: none;
}

#currentImage {
  display: block;
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Navigation buttons */
#prevBtn,
#nextBtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #c2d4dd;
  border: none;
  font-size: 1.8rem;
  color: #333;
  padding: 10px 14px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 10;
}

#prevBtn:hover,
#nextBtn:hover {
  background: #a8cbdc;
  transform: translateY(-50%) scale(1.1);
}

#prevBtn { left: -20px; }
#nextBtn { right: -20px; }

/* Fullscreen */
#imageViewer:fullscreen {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#imageViewer:fullscreen img {
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

#fullscreenBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #c2d4dd;
  border: none;
  border-radius: 50%;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#fullscreenBtn:hover {
  background: #a8cbdc;
  transform: scale(1.1);
}

/* Fullscreen slider */
#imageViewer:fullscreen #pageSlider {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  background: rgba(255, 255, 255, 0.7);
  z-index: 30;
  pointer-events: auto;
}

/* Page slider */
#pageSlider {
  width: 90%;
  margin: 20px 5%;
}

#pageCounter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  color: #5c5470;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* =======================
   FILTER SIDEBAR
======================= */
.sidebar {
  min-width: 220px;
  background: #f8f4f9;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 18px;
}

.filter-input {
  width: 90%;
  margin-bottom: 10px;
  padding: 6px 8px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.clear-button {
  margin-top: 10px;
  padding: 8px 10px;
  background-color: #e3e6f5;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.clear-button:hover {
  background-color: #d2d9f0;
}

.filtered-books-list {
  max-height: 200px; /* or whatever fits nicely in your layout */
  overflow-y: auto;
  margin-top: 16px;
  padding-right: 6px;
}

/* =======================
   RESPONSIVE DESIGN
======================= */
@media (max-width: 800px) {
  .main-layout {
    flex-direction: column;
    align-items: center;
  }

  .sidebar {
    width: 90vw;
    margin-left: 0;
    margin-top: 20px;
  }

  #trenchInfoTable,
  .mini-map {
    width: 95vw;
    margin: 0 auto 18px auto;
  }

  #prevBtn { left: 10px; }
  #nextBtn { right: 10px; }
}