.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.is-active {
  opacity: 1;
  visibility: visible;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.is-active .modal__overlay {
  opacity: 1;
}

.modal__container {
  position: relative;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  z-index: 1;
}

.modal.is-active .modal__container {
  transform: translateY(0);
}

.modal__container--small {
  max-width: 400px;
}

.modal__container--large {
  max-width: 800px;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
}

.modal__close:hover {
  color: #000;
}

.modal__header {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.modal__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal__button {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal__button--primary {
  background-color: #0072de;
  color: #fff;
  border: none;
}

.modal__button--primary:hover {
  background-color: #0056b3;
}

.modal__button--secondary {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.modal__button--secondary:hover {
  background-color: #e5e5e5;
}

/* Анимации */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Адаптивность */
@media (max-width: 576px) {
  .modal__container {
    width: 95%;
    margin: 10px;
  }

  .modal__header {
    padding: 16px 20px;
  }

  .modal__footer {
    padding: 12px 20px;
    flex-direction: column;
  }

  .modal__button {
    width: 100%;
  }
}
