/* Viewer page specific styles */

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #ffffff;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 40px;
  width: 100%;
  flex-shrink: 0;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.viewer-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: start;
}

.file-upload-section,
.metadata-section {
  padding: 0;
}

.file-upload-section {
  min-width: 280px;
}

.file-upload-section h2,
.metadata-section h2 {
  color: #2d3748;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #ff6900;
}

.file-upload-section p {
  color: #718096;
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

input[type='file'] {
  width: 100%;
  font-size: 0.95rem;
}

.file-size-hint {
  color: #a0aec0;
  font-size: 0.8rem;
  margin-top: 8px;
  font-style: italic;
}

.metadata-section {
  font-size: 0.9rem;
  color: #4a5568;
  line-height: 1.7;
}

.error-message {
  background: #fff5f5;
  border-left: 4px solid #e53e3e;
  color: #c53030;
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 0.9rem;
  display: none;
}

.error-message.show {
  display: block;
}

.metadata-label {
  font-weight: 600;
  color: #2d3748;
  display: inline-block;
  min-width: 140px;
}

.metadata-value {
  color: #4a5568;
}

.metadata-empty {
  color: #a0aec0;
  font-style: italic;
  padding: 8px 0;
}

.map-container {
  flex: 1;
  width: 100%;
  min-height: 0;
  position: relative;
  border-top: 1px solid #e2e8f0;
}

#map {
  width: 100%;
  height: 100%;
}

.popup-reference {
  white-space: nowrap;
}

.openlr-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.openlr-text {
  font-family: monospace;
  word-break: break-all;
  flex: 1;
  font-size: 0.85rem;
  background: #f7fafc;
  padding: 4px 8px;
  border-radius: 4px;
}

.icon-button {
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #ffffff;
  font-size: 0.85rem;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  color: #4a5568;
  font-weight: 500;
}

.icon-button:hover {
  background: #ff6900;
  color: #ffffff;
  border-color: #ff6900;
}

.copy-feedback {
  color: #48bb78;
  font-size: 0.85rem;
  margin-left: 8px;
  font-weight: 600;
}

.leaflet-popup-content {
  font-size: 0.9rem;
}

.leaflet-popup-content a {
  color: #ff6900;
  text-decoration: none;
  font-weight: 500;
}

.leaflet-popup-content a:hover {
  color: #e65c00;
  text-decoration: underline;
}

/* Search Overlay */
.search-overlay {
  position: absolute;
  top: 10px;
  left: 60px;
  z-index: 1000;
  pointer-events: none;
}

.search-container {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px 20px;
  min-width: 360px;
  pointer-events: auto;
}

.search-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 10px;
}

.search-input-group {
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.95rem;
  color: #2d3748;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #ff6900;
  box-shadow: 0 0 0 3px rgba(255, 105, 0, 0.1);
}

.search-button {
  padding: 10px 20px;
  background: #ff6900;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-button:hover {
  background: #e65c00;
}

.search-button:active {
  background: #cc5200;
}

.search-error {
  background: #fff5f5;
  border-left: 4px solid #e53e3e;
  color: #c53030;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 0.85rem;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
  .viewer-controls {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 16px 20px;
  }

  .viewer-controls {
    gap: 20px;
  }

  .search-overlay {
    left: 10px;
    right: 10px;
    top: 60px;
  }

  .search-container {
    min-width: 0;
    width: auto;
    max-width: calc(100vw - 20px);
  }

  .search-input-group {
    flex-direction: column;
  }

  .search-button {
    width: 100%;
  }
}
