/**
 * Modal Components
 * Modal dialogs and overlays
 */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  overflow: auto;
}

.modal--open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.modal__content {
  position: relative;
  background-color: var(--background);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  animation: modalSlideIn 0.3s ease-out;
  padding: var(--space-8);
  margin: var(--space-4);
}

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

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  font-size: var(--font-size-2xl);
  line-height: 1;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--text-muted);
  transition: color var(--transition-fast);
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 1;
}

.modal__close:hover {
  color: var(--text);
}

.modal__body {
  padding: var(--space-6);
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  padding: var(--space-6);
  border-top: 1px solid var(--border);
}


.modal__content--small {
  max-width: 400px;
  width: 100%;
}

.modal__content--medium {
  max-width: 600px;
  width: 100%;
}

.modal__content--large {
  max-width: 900px;
  width: 100%;
}

/* Modal content styles */
.modal__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-3) 0;
  color: var(--text);
  padding-right: var(--space-8);
}

.modal__description {
  color: var(--text-muted);
  margin: 0 0 var(--space-8) 0;
  line-height: var(--line-height-relaxed);
  font-size: var(--font-size-base);
}

.modal__footer-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  margin: var(--space-6) 0 0 0;
  line-height: var(--line-height-relaxed);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .modal__content {
    margin: var(--space-2);
    padding: var(--space-6);
    max-width: 95%;
  }
  
  .modal__close {
    top: var(--space-4);
    right: var(--space-4);
  }
  
  .modal__title {
    font-size: var(--font-size-xl);
    padding-right: var(--space-10);
  }
}