
/****************************** Body *******************************/

/* When a modal is open, disable interaction with the rest of the UI */
body.modal-open {
  overflow: hidden; /* prevent scrolling */
}

body.modal-open .canvas,
body.modal-open .sidebar,
body.modal-open .app-menu {
  pointer-events: none;
}

/****************************** Modal form *******************************/

/* Full-screen modal container */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100; /* above app menu (50/60) and sidebar (20) */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Darkened background overlay */
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

/* Centered dialog panel */
.modal__dialog {
  position: relative;
  min-width: min(420px, 90vw);
  max-width: 480px;
  background: var(--bg-soft);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Wider dialog variant for list-style modals */
.modal__dialog--wide {
  min-width: min(640px, 95vw);
  max-width: 720px;
  height: min(70vh, 800px);
}

/* Flex width for image dialog */
.modal__dialog--flexsize {
  min-width: 36px;
  max-width: 100%;
}

/* Header/title */
.modal__header {
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

/* Footer */
.modal__footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.modal__body {
  margin-top: 4px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Reuse edit-textarea, just tweak spacing inside modal 
.modal__textarea {
  margin-top: 4px;
} */

/*************************** Public/Private tabs ***************************/
.filemodal__tabs {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.filemodal__tabs .tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 8px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.filemodal__tabs .tab-btn:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.01);
}
.filemodal__tabs .tab-btn.is-active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}
.filemodal__tabs .tab-btn:disabled,
.filemodal__tabs .tab-btn.is-disabled {
  color: var(--muted);
  cursor: default;
  background: transparent;
  pointer-events: none;
  border-bottom-color: transparent;
}

/****************************** Table *******************************/

/* Scrollable table container */
.open-dialog__table-container {
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12); 
  background: rgba(0, 0, 0, 0.25);
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

/* Table */
.open-dialog__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
  cursor: default;
}

.open-dialog__table tbody tr {
  height: 28px;          /* choose your fixed row height */
}

.open-dialog__th {
  position: sticky;
  top: 0;
  background: rgba(5, 8, 20, 0.98);
  z-index: 1;
  font-weight: 600;
}

.open-dialog__th,
.open-dialog__table td {
  text-align: left;
  white-space: nowrap;
  height: 28px;
  padding: 0 10px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sortable headers */
.open-dialog__th--sortable {
  cursor: pointer;
  user-select: none;
}

.open-dialog__th--sorted-asc::after,
.open-dialog__th--sorted-desc::after {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
}

.open-dialog__th--sorted-asc::after {
  content: "▲";
}

.open-dialog__th--sorted-desc::after {
  content: "▼";
}

/* Rows */
/*.open-dialog__table tr:nth-child(even) {
   background: rgba(255, 255, 255, 0.02);
}*/

.open-dialog__row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.open-dialog__row.is-selected {
  background: rgba(255, 255, 255, 0.14);
}

/* Empty-state row */
.open-dialog__row--empty td {
  font-style: italic;
  opacity: 0.7;
}

/****************************** Save As mode ******************************/

/* toggle this class to show filename input */
.modal__dialog--save-mode .open-dialog__filename-row {
  display: flex;
}

/* Filename row for Save mode (hidden by default) */
.open-dialog__filename-row {
  display: none;
  margin-top: 12px;
  gap: 8px;
  align-items: center;
}

.open-dialog__filename-input {
  flex: 1;
}


/****************************** Modal dialog (confirm) *******************************/

/* Ensure <dialog> uses the same box styling as .modal__dialog */
dialog.modal__dialog {
  padding: 16px 18px 14px; /* match .modal__dialog */
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--fg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  max-width: min(480px, 92vw);
}

/* Remove UA defaults that fight the layout */
dialog.modal__dialog:focus {
  outline: none;
}

/* Match existing .modal__backdrop */
dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

/* Tidy spacing for the message */
.confirm-dialog__message {
  margin: 0;             /* modal body already provides spacing */
}

/* Make the footer form not alter layout */
.confirm-dialog__actions {
  display: contents;      /* keep buttons aligned by .modal__footer flex */
}


/****************************** Image file *******************************/

.image-crop-area {
  width: min(75vw, 1000px);
  height: min(75vh, 600px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* prevents odd overflow during zoom */
}

.image-crop-area img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* Help Cropper occupy the crop area */
.image-crop-area .cropper-container {
  width: 100% !important;
  height: 100% !important;
}

