@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

* {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: "Montserrat", sans-serif;
}

/*
 * The <main> landmark wraps <a-scene>. A-Frame sizes the scene with
 * height: 100%, so main must fill the viewport too; otherwise the scene
 * collapses to 0px and the "Enter VR" button is pushed off-screen.
 */
main {
  display: block;
  width: 100%;
  height: 100%;
}

#ui-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 100;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
}

.button-container {
  pointer-events: auto;
  display: flex;
  gap: 10px;
}

.icon-button {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border: 2px solid white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.4);
}

.icon-button img {
  width: 24px;
  height: 24px;
}

#map-overlay {
  position: absolute;
  top: 60px;
  left: 10px;
  width: 400px;
  height: 400px;
  background: white;
  border-radius: 10px;
  display: none;
  z-index: 1000;
  border: 2px solid #005a2b;
  overflow: hidden;
}

#info-panel {
  position: absolute;
  top: 60px;
  right: 15px;
  width: 380px;
  max-width: calc(100vw - 30px);
  max-height: 85vh;
  background: white;
  border-radius: 20px;
  padding: 24px;
  display: none;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  font-family: "Montserrat", sans-serif;
}

#info-panel .artwork-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#info-panel h2.artwork-author {
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #003594;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

#info-panel h1.artwork-title {
  font-size: 1.45rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #003594;
  margin: 0 0 8px 0;
  line-height: 1.25;
}

#info-panel h3.artwork-bcc {
  font-size: 1rem;
  font-weight: 600;
  color: #00491f;
  margin: 0 0 12px 0;
}

#info-panel p.artwork-technique,
#info-panel p.artwork-location {
  font-size: 0.92rem;
  color: #333333;
  margin: 4px 0;
  line-height: 1.4;
}

#info-panel p.artwork-location {
  font-style: italic;
  color: #555555;
  margin-bottom: 16px;
}

#info-panel details.artwork-details {
  font-size: 0.95rem;
  margin-top: 14px;
  border-top: 1px solid #e0e0e0;
  padding-top: 10px;
}

#info-panel details.artwork-details summary {
  font-weight: 700;
  color: #003594;
  cursor: pointer;
  padding: 6px 0;
  outline: none;
  user-select: none;
}

#info-panel details.artwork-details[open] {
  margin-bottom: 12px;
}

#info-panel details.artwork-details p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #222222;
  margin: 8px 0 12px 0;
  text-align: justify;
}

#info-panel .hd-link-button {
  display: block;
  padding: 12px 24px;
  text-decoration: none;
  background-color: #00491f;
  background-image: linear-gradient(270deg, #006d52 0%, #00491f 100%);
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  color: white;
  margin: 18px 0 10px 0;
  width: fit-content;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 73, 31, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}

#info-panel .hd-link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 73, 31, 0.35);
}

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #a8e1f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #005a2b;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hd-link-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #005a2b;
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: bold;
  text-align: center;
  transition: background 0.3s;
}

.hd-link-button:hover {
  background-color: #007a3b;
  color: white;
}

#map-search-container {
  padding: 10px;
  background: #f8f8f8;
  border-bottom: 1px solid #ddd;
}

#map-search-input {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#progress-bar-container {
  width: 200px;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 15px;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background: #005a2b;
  transition: width 0.3s;
}

#logo-bcc {
  position: absolute;
  bottom: 20px;
  left: 20px;
  height: 40px;
  pointer-events: auto;
}

#mini-map-container {
  display: none;
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 200px;
  border: 2px solid white;
  border-radius: 10px;
  z-index: 1000;
  background: #222; /* If the image fails, it stays dark */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#mini-map-container .leaflet-container {
  width: 100%;
  height: 100%;
  background: transparent !important;
}

/* Force the Leaflet image to be visible */
.leaflet-image-layer {
  opacity: 1 !important;
}

/* Fix the marker depth */
.leaflet-marker-pane {
  z-index: 600 !important;
}

.map-coord-tooltip {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #f03;
  color: #f03;
  font-weight: bold;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 4px;
}

@media (max-width: 600px) {
  #map-overlay {
    width: 90vw;
    height: 70vh;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  #info-panel {
    width: 85vw;
    max-height: 70vh;
    right: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}
