/* Modal Styles */

/* Image Overlay Styles */
.overlay {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.overlay-content {
  display: block;
  margin: auto;
  max-width: 90%;
  max-height: 90%;
  margin-top: 2%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover,
.close:focus {
  color: #bbb;
}

/* BibTeX Modal Styles */
.bibtex-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

.bibtex-modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from { 
    opacity: 0; 
    transform: translateY(-50px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.bibtex-modal-header {
  background-color: #f8f9fa;
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bibtex-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2em;
}

.bibtex-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.bibtex-close:hover,
.bibtex-close:focus {
  color: #000;
}

.bibtex-modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

#bibtex-content {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 15px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 15px 0;
  color: #333;
}

.copy-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn:hover {
  background-color: #0056b3;
}

.copy-btn:active {
  background-color: #004085;
}

.copy-btn.copied {
  background-color: #28a745;
}

/* Loading placeholder for images */
.loading-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 2s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive design */
@media (max-width: 768px) {
  .bibtex-modal-content {
    width: 95%;
    margin: 10% auto;
    max-height: 70vh;
  }
  
  .bibtex-modal-header {
    padding: 15px;
  }
  
  .bibtex-modal-body {
    padding: 15px;
  }
  
  #bibtex-content {
    font-size: 12px;
    padding: 12px;
  }
}
