/* event-actions.css — edit modal, photo viewer, toast. Compact rewrite on
 * tokens of the rules the retired timeline-page.css spread over 98 selectors
 * (three competing .edit-modal definitions). Byte-identical EN/CN. */

/* ── Edit modal ─────────────────────────────────────────────────────── */
.edit-modal { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center;
  background: rgba(8, 12, 24, .62); backdrop-filter: blur(4px); padding: 16px; }
.edit-modal.active { display: flex; }
.edit-modal-content { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface-raised, var(--surface-1)); color: var(--fg); border: 1px solid var(--border);
  border-radius: var(--radius-xl, 20px); box-shadow: var(--shadow-xl); padding: 24px; }
.edit-modal-content h2 { margin: 0 0 16px; font: var(--h2-weight, 600) var(--h2-size, 1.35rem)/1.2 var(--font-display, inherit); }
.edit-form-group { margin-bottom: 14px; }
.edit-label { display: block; margin-bottom: 6px; font-size: var(--text-sm); font-weight: 600; color: var(--fg-muted); }
.edit-input, .edit-textarea, .edit-select { width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; color: var(--fg);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md, 10px); }
.edit-input:focus-visible, .edit-textarea:focus-visible, .edit-select:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 1px; }
.edit-textarea { min-height: 120px; resize: vertical; }
.edit-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.edit-cancel-btn, .edit-save-btn { min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill, 999px); font: inherit; font-weight: 600; cursor: pointer; }
.edit-cancel-btn { background: transparent; color: var(--fg); border: 1px solid var(--border-strong, var(--border)); }
.edit-save-btn { background: var(--accent-blue); color: #fff; border: 1px solid transparent; }
.edit-save-btn:disabled { opacity: .6; cursor: wait; }

/* upload area + previews */
.edit-photo-upload-area { border: 1px dashed var(--border-strong, var(--border)); border-radius: var(--radius-md, 10px);
  padding: 18px; text-align: center; color: var(--fg-muted); cursor: pointer; }
.edit-photo-upload-area.edit-drag-over { border-color: var(--accent-blue); background: var(--surface-2); }
.edit-upload-icon { font-size: 1.6rem; }
.edit-upload-link { color: var(--accent-blue); text-decoration: underline; cursor: pointer; }
.edit-photo-preview-grid, .edit-existing-photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.edit-photo-preview-item, .edit-existing-photo-item { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); overflow: hidden; background: var(--surface-2); }
.edit-photo-preview-item img, .edit-existing-photo-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.edit-photo-preview-remove, .edit-existing-photo-delete { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; line-height: 28px; cursor: pointer; }
.edit-existing-photos-title { margin: 12px 0 4px; font-size: var(--text-sm); color: var(--fg-muted); }
.edit-existing-photo-label { display: block; padding: 4px 6px; font-size: var(--text-xs); color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-document { display: grid; place-items: center; aspect-ratio: 1; padding: 6px; font-size: var(--text-xs); text-align: center; }

/* ── Photo viewer ───────────────────────────────────────────────────── */
.photo-viewer-modal { position: fixed; inset: 0; z-index: 10001; display: none; }
.photo-viewer-modal.active { display: block; }
.photo-viewer-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.85); }
.photo-viewer-content { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; }
.photo-viewer-content img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: var(--radius-md, 10px); box-shadow: var(--shadow-xl); }
.photo-viewer-modal img[src=""] { display: none; }
.photo-viewer-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 28px; line-height: 44px; cursor: pointer; }
.photo-viewer-info { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: var(--text-sm); opacity: .85; }
.photo-viewer-info p { margin: 2px 0; }

/* ── Toast ──────────────────────────────────────────────────────────── */
.tl-toast { position: fixed; top: 20px; right: 20px; z-index: 10002; max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px; border-radius: var(--radius-md, 10px); box-shadow: var(--shadow-lg); font-weight: 600; color: #fff;
  animation: tl-toast-in .25s ease-out; }
.tl-toast-success { background: var(--success, #16a34a); }
.tl-toast-error { background: var(--danger, #dc2626); }
.tl-toast.is-leaving { animation: tl-toast-out .3s ease-in forwards; }
@keyframes tl-toast-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tl-toast-out { to { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tl-toast, .tl-toast.is-leaving { animation: none; } }

/* Global button rules in styles.css (up to specificity 0,4,1) repaint the modal buttons; id-anchor them. */
#editModal button.edit-cancel-btn, #editModal button.edit-save-btn, #photoViewerModal button.photo-viewer-close,
#editModal button.edit-photo-preview-remove, #editModal button.edit-existing-photo-delete { background-image: none; box-shadow: none; transform: none; text-transform: none; letter-spacing: normal; }
#editModal button.edit-cancel-btn::before, #editModal button.edit-save-btn::before, #photoViewerModal button.photo-viewer-close::before { content: none; }
#editModal button.edit-cancel-btn { background: transparent; color: var(--fg); border: 1px solid var(--border-strong, var(--border)); min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill, 999px); }
#editModal button.edit-save-btn { background: var(--accent-blue); color: #fff; border: 1px solid transparent; min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill, 999px); }
#photoViewerModal button.photo-viewer-close { background: rgba(255,255,255,.14); color: #fff; min-height: 44px; padding: 0; border-radius: 50%; }
