/* --- MODALS & OVERLAYS STYLES --- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  animation: modalSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal h3 {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.modal p {
  color: var(--text-dim);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Стили полноэкранного редактора сценария */
.modal-scenario-content {
  max-width: 720px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

/* Стили карточек медиатеки и аудиотеки */
.vault-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .modal {
    width: 95% !important;
    max-width: 95% !important;
    padding: 16px 14px !important;
    border-radius: 10px !important;
    max-height: 90vh !important;
  }
  .vault-modal-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 8px !important;
    max-height: 280px !important;
  }
  .modal-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
}
