/* ---------- GENERAL ---------- */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f7f7f7;
  color: #222;
  transition: background 0.3s, color 0.3s;
}

body.dark {
  background: #121212;
  color: #ddd;
}

header {
  text-align: center;
  margin-bottom: 1rem;
}

h1 {
  margin-bottom: 0.5rem;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

select, button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  cursor: pointer;
  background: white;
  color: #222;
  transition: background 0.3s, color 0.3s;
}

body.dark select,
body.dark button {
  background: #1e1e1e;
  color: #ddd;
  border: 1px solid #555;
}

button:hover, select:hover {
  opacity: 0.9;
}

/* ---------- GALLERY ---------- */
#gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.cave-card {
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 200px;
  text-align: center;
  box-shadow: 1px 1px 5px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}

body.dark .cave-card {
  background: #1e1e1e;
  border: 1px solid #555;
  box-shadow: 1px 1px 5px rgba(0,0,0,0.5);
}

.cave-card img {
  width: 100%;
  cursor: pointer;
  display: block;
}

.cave-name {
  padding: 8px;
  font-weight: bold;
  font-size: 0.9rem;
}

/* ---------- MODAL ---------- */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-inner {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
  color: #fff;
  background: rgba(0,0,0,0.8);
  border-radius: 10px;
}

.image-scroll {
  max-width: 90vw;
  max-height: 80vh;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}


.image-scroll img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

/* ---------- SCROLLBAR STYLING ---------- */
.image-scroll::-webkit-scrollbar,
#gallery::-webkit-scrollbar {
  width: 18px;
  height: 18px;
}

.image-scroll::-webkit-scrollbar-track,
#gallery::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 9px;
}

.image-scroll::-webkit-scrollbar-thumb,
#gallery::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 9px;
}

.image-scroll::-webkit-scrollbar-thumb:hover,
#gallery::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

/* Firefox */
.image-scroll, #gallery {
  scrollbar-width: auto;
  scrollbar-color: #999 #2a2a2a;
}

/* ---------- MODAL CONTROLS ---------- */
body.dark .modal-controls button {
  background: rgba(255,255,255,0.1);
}

/* ---------- MODAL CLOSE BUTTON ---------- */
.modal .close {
  font-size: 2.5rem;
  font-weight: bold;
  color: #ff4444;
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  z-index: 1001;
  user-select: none;
  transition: color 0.2s;
}

.modal .close:hover {
  color: #ff0000;
}

/* ---------- SHOW ALL BUTTON ---------- */
.show-all-btn {
  margin: 20px auto 0;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  background-color: #444;
  color: #fff;
}

.show-all-btn:hover {
  background-color: #666;
}

