/* CSS VARIABLES */
:root {
  --color-primary: #4caf50;
  --color-primary-hover: #45a049;
  --color-primary-active: #388e3c;
  --color-bg: #6e6e6e;
  --color-bg-light: #ffffff;
  --color-text-secondary: #555;
  --color-light-gray: #eee;
  --color-gray-hover: #dbdbdb;
  --color-gray-active: #bbbbbb;
  --color-disclaimer-bg: #fff9c4;
  --color-disclaimer-border: #fbc02d;
  --color-disclaimer-text: #5d4037;
  --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --box-shadow-light: 0 1px 5px rgba(0, 0, 0, 0.2);
}
/* GLOBAL RESET / BASE */
html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: var(--color-bg);
  height: 100%;
}

/* BANNER */
.banner {
  background: var(--color-bg-light);
  border-bottom: 3px solid var(--color-primary);
  padding: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  height: 75px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}
.banner-content {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}
.banner-content img {
  height: 50px;
}
.banner-content h1 {
  margin: 0;
}
#toggleViewBtn {
  margin-left: auto;
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background-color: var(--color-primary);
  color: var(--color-bg-light);
}

/* CONTAINER */
.container {
  display: flex;
  flex-direction: column; /* Default: column layout (mobile) */
  margin: 10px auto;
  gap: 15px;
  min-height: calc(100vh - 117px);
  box-sizing: border-box;
  padding: 25px;
  justify-content: center;
  align-items: center;
  max-width: 1500px;
}

/* MAP */
#map {
  width: 100%;
  height: 50vh; /* On mobile, just 50vh tall */
  border: 3px solid #4caf50;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* RIGHT COLUMN (search + gallery) */
.right-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

/* SEARCH INPUT */
#searchInput {
  width: 100%;
  max-width: 400px;
  padding: 8px;
  border-radius: 6px;
  border: 2px solid var(--color-primary);
}

/* GALLERY */
#gallery {
  display: flex;
  position: relative;
  flex-direction: row; /* Vertical stacking */
  gap: 10px;
  overflow-y: auto; /* Vertical scroll */
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  border: 3px solid #4caf50;
  height: 100%;
  align-content: flex-start;
  flex-wrap: wrap;
  width: 100%;
  min-height: 100px;
  box-sizing: border-box;
}

.image-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease-in-out;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  max-width: 200px; /* Control overall card width */
  margin: 0 auto; /* Center the card horizontally */
  height: 150px;
}
.image-card:hover {
  transform: scale(1.02);
}
.image-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  height: 90%;
}
.image-title {
  margin: 5px;
  font-weight: bold;
  text-align: center;
  font-size: 0.9rem;
}

#gallery > p {
  position: absolute;
  transform: translate(-50%,-50%);
  left: 50%;
  top: 50%;
  width: 80%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  font-weight: bold;
  font-size: 1.3em;
  color: #7d7d7d;
}


/* FULLSCREEN MODAL */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}
.modal-content {
  position: absolute;
  padding: 20px;
  max-width: min(calc(100vw - 40px), 800px);
  background: #fff;
  border-radius: 10px;
  text-align: center;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
}
.modal-content img {
  max-height: 50vh;
  border-radius: 8px;
  max-width: min(calc(90vw - 40px), 760px);
}
.modal-close-btn {
  background-color: #4caf50;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 15px;
  width: 100%;
  font-weight: bold;
}
.modal-close-btn:hover {
  background-color: #45a049;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 10px;
  background: #ffffff;
  border-top: 3px solid #4caf50;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}
.footer a {
  text-decoration: none;
  color: #4caf50;
}

/* RESPONSIVE (Desktop / Wider Screens) 
     -> Two columns: Map on the left, Gallery on the right
  */
@media (min-width: 900px) {
  .container {
    flex-direction: row;
  }
  #map {
    width: 50%;
    height: 70vh; /* Taller map on large screens */
  }
  .right-column {
    width: 50%;
    height: 70vh;
    display: flex;
    flex-direction: column;
  }
  #gallery {
    width: 100%;
  }
}

.modal-meta {
  font-size: 0.9rem;
  color: #555;
  margin-top: 8px;
}


/* HIDE MAP WHEN "SHOW ONLY PHOTOS" IS ACTIVE */
.hide-map #map {
  display: none;
}
.hide-map .right-column {
  width: 100%; /* Take full width if map is hidden */
}
.hide-map #gallery {
  max-height: 70vh; /* Expand if map is hidden */
}

/* LEADERBOARD */
/* LEADERBOARD */
.leaderboard-container {
  background-color: var(--color-bg-light);
  width: 90%;
  border: 3px solid var(--color-primary);
  border-radius: 12px;
  padding: 15px 20px;
  box-sizing: border-box;
  margin: auto;
  margin-bottom: 15px;
  box-shadow: var(--box-shadow);
}

.leaderboard-container h2 {
  margin: 0 0 10px 0;
  font-size: 1.3rem;
  color: var(--color-primary);
  text-align: center;
}

.leaderboard-container ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.leaderboard-container li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-light-gray);
  font-size: 1rem;
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
  border-radius: 6px;
  background-color: var(--color-bg-light);
}

.leaderboard-container li:hover {
  background-color: var(--color-gray-hover); /* leichtes Grau für Hover */
}

.leaderboard-container li:active {
  background-color: var(--color-gray-active); /* etwas dunkleres Grau beim Klicken */
}


.leaderboard-container .medal {
  margin-right: 10px;
}

.leaderboard-container .leaderboard-author,
.leaderboard-container .count {
  transition: color 0.2s;
}

.leaderboard-container .leaderboard-author {
  flex-grow: 1;
  font-weight: bold;
  color: #333;
  text-align: left;
}

.leaderboard-container .count {
  color: var(--color-primary);
  font-weight: bold;
  white-space: nowrap;
}

/* SELECT + SUCHE */
.search-and-filter {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

#authorSelect {
  min-width: 150px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 2px solid var(--color-primary);
  background-color: var(--color-bg-light);
  font-size: 1rem;
  color: #333;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: border 0.2s;
}

#authorSelect:hover,
 #authorSelect:hover,
 #authorSelect:focus {
  border-color: var(--color-primary-active);
  outline: none;
}


/* Show author & time on the card */
.image-card .finder-info {
  font-size: 0.8rem;
  text-align: center;
  color: var(--color-text-secondary);
  margin: 0px 5px 5px 5px;  
}

.disclaimer-box {
  width: 90%;
  margin: 10px auto 20px auto;
  background-color: #fff9c4;
  border: 2px solid #fbc02d;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #5d4037;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.disclaimer-box strong {
  color: #000;
}
