/* Modal styles with CSS variables for light/dark mode support */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay-bg, rgba(0, 0, 0, 0.5));
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background-color: var(--modal-bg, #fff);
  border-radius: 8px;
  box-shadow: var(--modal-shadow, 0 4px 12px rgba(0, 0, 0, 0.15));
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--modal-border-color, #eee);
  padding-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--modal-title-color, #333);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--modal-close-color, #666);
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--modal-close-hover-color, #333);
}

.modal-content {
  margin-bottom: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--modal-border-color, #eee);
  padding-top: 1rem;
}

/* Dark mode overrides */
html[data-theme="dark"] .modal-container {
  --modal-bg: #2a2a2a;
  --modal-border-color: #444;
  --modal-title-color: #eee;
  --modal-close-color: #aaa;
  --modal-close-hover-color: #fff;
  --modal-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.modal-overlay.active {
  animation: fadeIn 0.2s ease-out forwards;
}

.modal-overlay.active .modal-container {
  animation: slideIn 0.3s ease-out forwards;
}
