/* modal.css — Modal dialog component */

/* Overlay container */
.modal-container {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 10000);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-container.active {
  opacity: 1;
  pointer-events: auto;
}

/* Backdrop */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modalFadeIn 0.25s ease-out forwards;
}

/* Dialog */
.modal-dialog {
  position: relative;
  min-width: 400px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--glass-border-light);
  box-shadow: var(--glass-shadow-lg);
  animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  color: var(--text-primary);
  z-index: 1;
}

/* Header */
.modal-header {
  display: flex;
  flex-direction: row;
  padding: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* Title */
.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  line-height: var(--line-height-tight);
}

/* Close button */
.modal-close {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.modal-close:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-light);
  color: var(--text-primary);
}

.modal-close:active {
  transform: scale(0.95);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

/* Body */
.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex-grow: 1;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--text-secondary);
}

/* Footer */
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Responsive: mobile */
@media (max-width: 768px) {
  .modal-dialog {
    width: 95vw;
    min-width: auto;
    max-height: 90vh;
    margin: 0.5rem;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-footer {
    padding: 0.75rem 1rem;
  }
}
