body {
  margin: 0;
  overflow: hidden;
}

#info {
  position: absolute;
  top: 10px;
  left: 10px;
  color: white;
  font-family: sans-serif;
  font-size: 14px;
  background: rgba(0,0,0,0.7);
  padding: 10px;
  border-radius: 4px;
  max-width: 350px;
}

#manifest-info {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #555;
}

#manifest-info h2 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #8cf;
}

#manifest-info .metadata {
  font-size: 12px;
  color: #aaa;
}

#manifest-info .metadata div {
  margin: 4px 0;
}

#manifest-info .metadata .label {
  color: #888;
}

#manifest-info .metadata a {
  color: #8cf;
  text-decoration: none;
}

#manifest-info .metadata a:hover {
  text-decoration: underline;
}

#lod-info {
  font-size: 12px;
  color: #ccc;
}

.rotation-controls {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #555;
}

.rotation-controls input[type="range"] {
  width: 80px;
}

#annotation-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 250px;
  color: white;
  font-family: sans-serif;
  font-size: 13px;
  background: rgba(0,0,0,0.8);
  padding: 12px;
  border-radius: 4px;
  max-height: 80vh;
  overflow-y: auto;
}

#annotation-panel h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  border-bottom: 1px solid #555;
  padding-bottom: 8px;
}

.annotation-item {
  background: rgba(255,255,255,0.1);
  padding: 8px;
  margin-bottom: 6px;
  border-radius: 3px;
  cursor: pointer;
}

.annotation-item:hover {
  background: rgba(255,255,255,0.2);
}

.annotation-item .label {
  font-weight: bold;
  margin-bottom: 4px;
}

.annotation-item .coords {
  font-size: 11px;
  color: #aaa;
}

.annotation-item .delete-btn {
  float: right;
  background: #c44;
  border: none;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
}

#mode-toggle {
  margin-bottom: 10px;
}

#mode-toggle button {
  padding: 6px 12px;
  margin-right: 5px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

#mode-toggle button.active {
  background: #4a9;
  color: white;
}

#mode-toggle button:not(.active) {
  background: #555;
  color: #ccc;
}

.annotation-marker {
  background: rgba(255, 100, 100, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: sans-serif;
  white-space: nowrap;
  pointer-events: none;
}

#annotation-input {
  display: none;
  position: absolute;
  background: rgba(0,0,0,0.9);
  padding: 12px;
  border-radius: 4px;
  z-index: 1000;
}

#annotation-input input {
  padding: 6px;
  width: 180px;
  border: none;
  border-radius: 3px;
  margin-bottom: 8px;
}

#annotation-input button {
  padding: 6px 12px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  margin-right: 5px;
}

#annotation-input .ok-btn {
  background: #4a9;
  color: white;
}

#annotation-input .cancel-btn {
  background: #666;
  color: white;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-family: sans-serif;
  font-size: 18px;
}

.iiif-badge {
  display: inline-block;
  background: #2f4f7f;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-left: 8px;
}

#model-selector {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #555;
}

#model-selector label {
  font-size: 12px;
  color: #aaa;
  display: block;
  margin-bottom: 4px;
}

#model-selector select {
  width: 100%;
  padding: 6px;
  border: none;
  border-radius: 3px;
  background: #444;
  color: white;
  font-size: 13px;
  cursor: pointer;
}

#model-selector select:hover {
  background: #555;
}

.collection-badge {
  display: inline-block;
  background: #4a7f4f;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-left: 4px;
}

/* Responsive styles */
@media (max-width: 600px) {
  #info {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: none;
    border-radius: 8px 8px 0 0;
    max-height: 40vh;
    overflow-y: auto;
    transform: translateY(calc(100% - 60px));
    transition: transform 0.3s ease;
  }
  #info.expanded {
    transform: translateY(0);
  }
  #manifest-info h2 {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  #manifest-info h2::after {
    content: '▲';
    font-size: 10px;
    margin-left: auto;
    padding-left: 10px;
    transition: transform 0.3s;
  }
  #info.expanded #manifest-info h2::after {
    transform: rotate(180deg);
  }
  .rotation-controls { display: none; }
  #info.expanded .rotation-controls { display: block; }

  #annotation-panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: auto;
    border-radius: 8px 8px 0 0;
    max-height: 35vh;
  }
}
