/* =====================================================================
   modal.css — modal dialog shell used for add/edit/preview/confirm
   ===================================================================== */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 7, 10, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  opacity: 0;
  animation: modal-fade-in var(--transition-med) forwards;
}
@keyframes modal-fade-in { to { opacity: 1; } }

.modal-backdrop.closing { animation: modal-fade-out var(--transition-fast) forwards; }
@keyframes modal-fade-out { to { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateY(12px) scale(0.98);
  animation: modal-rise var(--transition-med) forwards;
}
@keyframes modal-rise { to { transform: translateY(0) scale(1); } }

.modal.modal-sm { max-width: 420px; }
.modal.modal-lg { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16.5px; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
}
.modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Video preview modal specifics */
.video-preview-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  margin-bottom: 16px;
}
.video-preview-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

@media (max-width: 560px) {
  .modal { max-width: 100%; }
  .modal-body { padding: 18px; }
  .modal-header, .modal-footer { padding: 16px 18px; }
}
