/* Disable text selection globally and set box-sizing */
* {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  box-sizing: border-box;
font-family: Times;
font-size: 16px;

}



/* Popup window base styling */
.window {
  position: absolute;
  width: 300px;  /* default width */
  height: 200px; /* fixed height */
  background: white;
  border: 1px solid black;  /* black border */
  box-shadow: 2px 2px 12px rgba(0,0,0,0.3);
  cursor: move;
  overflow: hidden;
  z-index: 10;

  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  grid-template-areas:
    "header"
    "image";
  border-radius: 0;  /* no border radius */
  font-family: Arial, sans-serif;
}

/* Popup window with expanded info */
.window.info {
  /* Make it fixed and centered */
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;

  width: 80vw !important;
  max-width: 1000px;
  height: 80vh !important;
  max-height: 800px;

  z-index: 9999 !important;
  box-shadow: 0 0 20px rgba(0,0,0,0.6) !important;
  background: white !important;
  border-radius: 0 !important;  /* no border radius */

  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header header"
    "image desc";
}

/* Popup header (title area) */
.window h4 {
  grid-area: header;
  margin: 0 0 5px 10px;
  font-size: 18px;
  line-height: 1.2;
  user-select: none;
}

/* Description paragraph */
.window p {
  display: none; /* hidden by default */
  margin: 0 10px 10px 10px;
  font-size: 14px;
  color: #333;
  max-height: 150px;
  overflow-y: auto;
  grid-area: desc;
}

.window.info p {
  display: block; /* visible only when popup has .info */
}

/* Media inside popup */
.window img,
.window.info img {
  grid-area: image;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;  /* no border radius */
}

.text-file-content {
  white-space: pre-wrap;
  overflow: auto;
  padding: 10px;
  color: #000000;
  background: #ffffff;
  border-radius: 0;
  box-sizing: border-box;
  display: inline-block;
}


.more-button {
  position: absolute;
  top: 5px;
  right: 8px;
  background: transparent;
  border: none;
  padding: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.more-button svg {
  fill: currentColor;
  transition: transform 0.2s ease;
}

.more-button.clicked svg {
  transform: rotate(90deg);
}


.window.popup-video,
.window.popup-image,
.window.popup-pdf,
.window.popup-text {
  border: 1px solid black !important;
  background-color: white !important;
  border-radius: 0 !important;
}

.window.popup-video video,
.window.popup-image img,
.window.popup-pdf iframe,
.window.popup-text pre.text-file-content {
  border-radius: 0 !important;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Disable text selection on PDF iframes */
.window.popup-pdf iframe {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: auto; /* keep interactions */
}

.window.popup-text {
  z-index: 2000;
  border: 1px solid black !important;
  background-color: white !important;
  border-radius: 0 !important;
}