/**
 * Модальное окно для выбора распределения персонажей
 */

.persona-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.persona-modal.modal-visible {
  opacity: 1;
  pointer-events: all;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 650px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translate(-50%, -60%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  transition: all 0.2s;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #333;
  transform: rotate(90deg);
}

.modal-content h2 {
  margin: 0 40px 28px 0;
  font-size: 28px;
  font-weight: 700;
  color: #2d3748;
  line-height: 1.3;
}

.modal-info {
  background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 28px;
  border-left: 4px solid #667eea;
}

.modal-info p {
  margin: 6px 0;
  color: #4a5568;
  font-size: 15px;
  line-height: 1.6;
}

.modal-info strong {
  color: #2d3748;
  font-weight: 600;
}

.modal-options {
  margin-bottom: 28px;
}

.modal-option {
  display: flex;
  align-items: flex-start;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background: white;
}

.modal-option:hover {
  border-color: #667eea;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.modal-option input[type="radio"] {
  margin-right: 16px;
  margin-top: 2px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #667eea;
}

.modal-option input[type="radio"]:checked ~ .option-content {
  color: #667eea;
}

.modal-option input[type="radio"]:checked ~ .option-content .option-title {
  color: #667eea;
  font-weight: 700;
}

.option-content {
  flex: 1;
}

.option-title {
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 6px;
  color: #2d3748;
  transition: color 0.2s;
}

.option-note {
  font-size: 14px;
  color: #718096;
  margin-top: 6px;
  line-height: 1.5;
}

.option-price {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 10px;
}

/* Временные слоты */
.time-slots-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #e2e8f0;
}

.time-slots-list {
  margin-bottom: 16px;
}

.time-slot {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f7fafc;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
}

.slot-character-select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.slot-character-select:focus {
  outline: none;
  border-color: #667eea;
}

.slot-time {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slot-duration {
  width: 80px;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  background: white;
  transition: border-color 0.2s;
}

.slot-duration:focus {
  outline: none;
  border-color: #667eea;
}

.slot-time-label {
  font-size: 14px;
  color: #718096;
  white-space: nowrap;
}

.slot-price {
  font-weight: 700;
  color: #667eea;
  font-size: 16px;
  text-align: right;
  white-space: nowrap;
}

.time-slots-total {
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.time-slots-total span {
  font-size: 22px;
}

/* Футер модального окна */
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 28px;
  border-top: 2px solid #e2e8f0;
}

.modal-cancel,
.modal-confirm {
  padding: 14px 28px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  outline: none;
}

.modal-cancel {
  background: #e2e8f0;
  color: #4a5568;
}

.modal-cancel:hover {
  background: #cbd5e0;
  transform: translateY(-1px);
}

.modal-confirm {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  flex: 1;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modal-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

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

.confirm-price {
  font-weight: 700;
  font-size: 18px;
}

/* Адаптивность */
@media (max-width: 768px) {
  .modal-content {
    padding: 30px 24px;
    max-width: 95%;
    max-height: 90vh;
  }

  .modal-content h2 {
    font-size: 22px;
    margin-right: 30px;
  }

  .modal-close {
    top: 16px;
    right: 16px;
    font-size: 30px;
  }

  .modal-option {
    padding: 16px;
  }

  .option-title {
    font-size: 16px;
  }

  .option-price {
    font-size: 18px;
  }

  .time-slot {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .slot-price {
    text-align: left;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-cancel,
  .modal-confirm {
    width: 100%;
  }
}

/* Скроллбар для модального окна */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}
