@charset "utf-8";

.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button{
    font-family: var(--font-family, 'Noto Sans', sans-serif);
    font-size: 14px;
}

.list-draft-modal-overlay {
  background-color: rgba(0, 0, 0, 0.5);
}

.list-draft-modal-overlay.hidden {
  display: none;
}

.list-draft-modal {
  height: 666px;
  background: var(--White, #FFFFFF);
  border-radius: var(--Radius-M, 8px);
  box-shadow: 0px 4px 4px -4px rgba(12, 12, 13, 0.05), 0px 16px 16px -8px rgba(12, 12, 13, 0.1);
}

.list-draft-modal-title {
  line-height: 1.36;
}

.list-draft-modal-subtitle {
  line-height: 1.36;
}
.list-draft-modal-close {
  top: 13px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.list-draft-modal-close img {
  width: 32px;
  height: 32px;
}

.list-draft-table-container {
  position: relative;
  overflow-y: auto;
  max-height: 100%;
}

.list-draft-table {
  border-collapse: separate;
  border-spacing: 0;
}

.list-draft-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.list-draft-table th {
  border: 1px solid var(--BlueGray03, #CCD0D9);
  font-weight: 400;
  line-height: 1.36;
  text-align: center;
  background: var(--BlueGray06, #F2F3F5);
}

.list-draft-table th:nth-child(2),
.list-draft-table th:nth-child(3),
.list-draft-table th:nth-child(4),
.list-draft-table th:last-child {
  width: 90px;
}

.list-draft-table th.sortable {
  cursor: pointer;
}

/* Sort Icon */
.sort-icon {
  width: 16px;
  height: 24px;
}

/* .list-draft-table tbody tr:hover td:first-child {
  background: var(--Cobalt08, #EEF7FF);
} */

.list-draft-table td {
  border: 1px solid var(--BlueGray04, #D9DCE3);
  border-top: 0;
  font-weight: 400;
  line-height: 1.36;
}

.list-draft-table tbody tr:first-child td {
  border-top: 1px solid var(--BlueGray04, #D9DCE3);
}

.list-draft-table td:first-child {
  height: 54px;
}

.list-draft-table td:nth-child(2),
.list-draft-table td:nth-child(3),
.list-draft-table td:nth-child(4),
.list-draft-table td:last-child {
  width: 90px;
  height: 54px;
}

/* Hover effect for delete button column */
.list-draft-table td:last-child:hover {
  background: var(--Cobalt08, #EEF7FF);
}

.file-name-link {
  font-weight: 400;
  line-height: 1.36;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #1763A2 !important;
}

.file-name-link:hover {
  text-decoration: underline;
}

.file-arrow-icon {
  width: 24px;
  height: 24px;
}

.delete-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.delete-btn img {
  width: 24px;
  height: 24px;
}

.delete-btn:hover {
  opacity: 0.7;
}

.list-draft-table-container::-webkit-scrollbar {
  width: 6px;
}

.list-draft-table-container::-webkit-scrollbar-track {
  background: var(--BlueGray06, #F2F3F5);
  border-radius: var(--Radius-L, 16px);
}

.list-draft-table-container::-webkit-scrollbar-thumb {
  background: var(--BlueGray03, #CCD0D9);
  border-radius: var(--Radius-L, 16px);
}

.list-draft-table-container::-webkit-scrollbar-thumb:hover {
  background: var(--BlueGray02, #C0C5D0);
}

/* ===================================
   jQuery UI Dialog Wrapper Styles
   =================================== */

/* Dialog wrapper - Override jQuery UI defaults */
.list-draft-edit-list-dialog-wrapper.ui-dialog {
  padding: 0;
  border: none;
  border-radius: var(--Radius-M, 8px);
  box-shadow: 0px 4px 4px -4px rgba(12, 12, 13, 0.05), 0px 16px 16px -8px rgba(12, 12, 13, 0.1);
}

/* Hide jQuery UI titlebar - we use custom header */
.list-draft-edit-list-dialog-wrapper .ui-dialog-titlebar {
  display: none;
}

/* Dialog content area */
.list-draft-edit-list-dialog-wrapper .ui-dialog-content {
  padding: 0;
  overflow: visible; /* Let table container handle scroll */
}

/* Ensure modal container fits properly */
.list-draft-edit-list-dialog-wrapper .list-draft-modal {
  box-shadow: none; /* Remove inner shadow, wrapper has shadow */
}

/* Override jQuery UI button pane if exists */
.list-draft-edit-list-dialog-wrapper .ui-dialog-buttonpane {
  display: none;
}

/* Overlay styling - jQuery UI creates this */
.ui-widget-overlay {
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 1;
}

/* Hover effect for sortable headers */
.list-draft-table th.sortable:hover {
  background: var(--BlueGray05, #E6E8EC);
}

/* ===================================
   FILE EDIT DIALOG STYLES
   Based on Figma: file change preference_modal
   =================================== */

/* Dialog Container */
.file-edit-dialog {
  height: clamp(600px, 90vh, 960px) !important;
}

/* Back Button */
.file-edit-back-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  flex-shrink: 0;
}

.file-edit-back-btn img {
  width: 32px;
  height: 32px;
  display: block;
}

.file-edit-back-btn:hover {
  opacity: 0.7;
}

/* Dashed Divider */
.file-edit-divider-dashed {
  width: 0;
  align-self: stretch;
  border-left: 2px dashed var(--BlueGray01, #B3B9C6);
}

/* Filename */
.file-edit-filename {
  font-size: 24px;
  line-height: 1.36;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}

/* Solid Divider */
.file-edit-divider-solid {
  width: 2px;
  align-self: stretch;
  background: var(--BlueGray01, #B3B9C6);
}

/* Section Title */
.file-edit-section-title {
  font-size: 24px;
  line-height: 1.36;
}

/* Close Button */
.file-edit-close-btn {
  top: 13px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
}

.file-edit-close-btn img {
  width: 32px;
  height: 32px;
  display: block;
}

.file-edit-close-btn:hover {
  opacity: 0.7;
}


.file-edit-search-input {
  width: 240px;
  padding: 6px 12px;
  line-height: 1.36;
  border: 1px solid var(--BlueGray01, #B3B9C6);
  outline: none;
}

.file-edit-search-input::placeholder {
  color: var(--BlueGray01, #B3B9C6);
}

.file-edit-search-btn {
  padding: var(--Spacing-S, 8px) var(--Spacing-M, 16px);
  font-size: var(--size-sm, 14px);
  font-weight: 600;
  line-height: 1.36;
  color: var(--BlueGray02, #C0C5D0);
  background: var(--BlueGray06, #F2F3F5);
  border: none;
  border-radius: var(--Radius-S, 4px);
  cursor: not-allowed;
  /*  */
}

.file-edit-search-btn:not(:disabled) {
  color: var(--White, #FFFFFF);
  background: var(--Cobalt02, #1763A2);
  cursor: pointer;
}

.file-edit-search-btn:not(:disabled):hover {
  background: var(--Cobalt01, #043F6F);
}

/* Action Buttons */
.file-edit-action-buttons {
  display: flex;
  gap: var(--Spacing-S, 8px);
}

/* Save Button (Subtle) */
.file-edit-save-btn {
  display: flex;
  align-items: center;
  gap: var(--Spacing-S, 8px);
  padding: var(--Spacing-S, 8px) var(--Spacing-M, 16px);
  font-weight: 600;
  line-height: 1.36;
  background: transparent;
  border: none;
  cursor: default;
  color: var(--BlueGray02, #C0C5D0);
}

.file-edit-save-btn img {
  width: 20px;
  height: 20px;
  display: block;
  filter: brightness(0) saturate(100%) invert(80%) sepia(2%) saturate(8%) hue-rotate(317deg) brightness(106%) contrast(85%);
}

.file-edit-save-btn:not(:disabled) {
  color: #1763A2;
  cursor: pointer;
}

.file-edit-save-btn:not(:disabled) img {
  color: #1763A2;
  filter: none;
}

/* .file-edit-save-btn:hover {
  background: var(--Cobalt08, #EEF7FF);
} */

/* Save and Translate Button (Filled) */
.file-edit-save-translate-btn {
  min-width: 160px;
  padding: var(--Spacing-S, 8px) var(--Spacing-M, 16px);
  line-height: var(--line-height-normal, 19px);
  color: var(--BlueGray02, #C0C5D0);
  background: var(--BlueGray06, #F2F3F5);
  border: none;
  height: 35px;
  cursor: default;
}

.file-edit-save-translate-btn:not(:disabled) {
  color: var(--White, #FFFFFF);;
  cursor: pointer;
  background: #1763A2;
}

/* .file-edit-save-translate-btn:hover {
  background: var(--Cobalt01, #043F6F);
} */

/* Table Wrapper — grid: row 1 (table) fills remaining space, row 2 (update time) auto */
.file-edit-table-wrapper {
  display: grid !important; /* override tw-flex from HTML class */
  grid-template-rows: 1fr auto;
  height: calc(clamp(600px, 90vh, 960px) - 152px);
  min-height: 0;
}

/* Table Container — grid child, let grid control height */
.file-edit-table-container {
  min-height: 0;
  overflow-y: auto;
}

/* Border chỉ hiện khi đang loading, sau khi load xong table tự có border */
.file-edit-table-container.is-loading {
  border: 1px solid #E6E8EC;
}

.file-edit-table-container.is-loading .file-edit-table th {
  border: 1px solid #E6E8EC;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}

.file-edit-table-container.is-loading .file-edit-table th:first-child {
  border-right: 1px solid #E6E8EC !important;
}

/* Paging Info */
.file-edit-paging-info {
  gap: 10px;
  padding-bottom: var(--Spacing-S, 8px);
}

.file-edit-paging-links {
  line-height: 1.36;
}

.file-edit-update-time {
  line-height: 1.36;
  margin-left: auto;
}

.file-edit-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

/* Table Header */
.file-edit-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.file-edit-table th {
  padding: var(--Spacing-S, 8px) var(--Spacing-L, 24px);
  line-height: 1.36;
  color: var(--White, #FFFFFF);
  border: 1px solid #E6E8EC;
}

.file-edit-table th.col-number {
  width: 96px;
}

/* Table Body */

.file-edit-table td {
  border: 1px solid #E6E8EC;
  border-top: 0;
}

.file-edit-table td:first-child {
   padding: 4px var(--Spacing-L, 24px);
   background: var(--BlueGray06, #F2F3F5);
}

.file-edit-table td:last-child > div{
    padding: 4px var(--Spacing-L, 24px);
    /* border: 3px solid white; */
    display: flex;
    align-items: center;
}

.file-edit-table tbody tr:first-child td {
  border-top: 1px solid var(--BlueGray07, #B7B8BA);
}

/* Content with selection line */
.file-edit-content-with-line {
  display: flex;
  align-items: center;
  gap: 2px;
}

.file-edit-selection-line {
  width: 0;
  height: 19.24px;
  border-left: 1px solid var(--Black, #000000);
  flex-shrink: 0;
}

.file-edit-content-text {
  flex: 1;
}

/* Scrollbar Styling */
.file-edit-table-container::-webkit-scrollbar {
  width: 8px;
}

.file-edit-table-container::-webkit-scrollbar-track {
  background: var(--Grey-Grey03, #E3E2E2);
  border-radius: var(--Radius-L, 16px);
}

.file-edit-table-container::-webkit-scrollbar-thumb {
  background: var(--Grey-Grey03, #E3E2E2);
  border-radius: var(--Radius-L, 16px);
}

.file-edit-table-container::-webkit-scrollbar-thumb:hover {
  background: var(--BlueGray02, #C0C5D0);
}

/* jQuery UI Dialog Wrapper for File Edit */
.file-edit-dialog-wrapper.ui-dialog {
  padding: 0;
  border: none;
  border-radius: var(--Radius-M, 8px);
  box-shadow: 0px 4px 4px -4px rgba(12, 12, 13, 0.05), 0px 16px 16px -8px rgba(12, 12, 13, 0.1);
  width: clamp(960px, 90vw, 1600px) !important;
}

.file-edit-dialog-wrapper .ui-dialog-titlebar {
  display: none;
}

.file-edit-dialog-wrapper .ui-dialog-content {
  padding: 0;
  overflow: visible;
}

.file-edit-dialog-wrapper .file-edit-dialog {
  box-shadow: none;
}

.file-edit-dialog-wrapper .ui-dialog-buttonpane {
  display: none;
}

/* ========================================
   DELETE CONFIRMATION DIALOG
   Figma Design: node-id=797-135924
   ======================================== */

/* Popup - No overlay, appears near delete button */
.delete-confirm-popup {
  position: absolute;
  width: 320px;
  background: var(--White, #FFFFFF);
  border-radius: var(--Radius-M, 8px);
  box-shadow: 0px 6px 24px 0px rgba(0, 0, 0, 0.14);
  padding: var(--Spacing-M, 16px);
  display: flex;
  flex-direction: column;
  gap: var(--Spacing-L, 24px);
  align-items: center;
  z-index: 10000;
  /* Position will be set dynamically via JavaScript based on delete button position */
}

/* File Name Text - Bold, 16px, center-aligned, gray */
.delete-confirm-filename {
  font-weight: 700;
  font-size: var(--size-md, 16px);
  line-height: 1.36;
  color: var(--Black-Black04, #717172);
  text-align: center;
  width: 100%;
  word-break: break-word;
}

/* Confirmation Text - Regular, 16px, center-aligned, gray */
.delete-confirm-text {
  font-weight: 400;
  font-size: var(--size-md, 16px);
  line-height: 1.36;
  color: var(--Black-Black04, #717172);
  text-align: center;
  margin-top: calc(var(--Spacing-S, 8px) * -1);
}

/* Buttons Container - Row layout, equal width */
.delete-confirm-buttons {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
}

/* Button Base Styles */
.delete-confirm-cancel,
.delete-confirm-delete {
  flex: 1;
  padding: var(--Spacing-S, 8px) var(--Spacing-M, 16px);
  border-radius: var(--Radius-S, 4px);
  border: none;
  font-weight: 700;
  font-size: var(--size-sm, 14px);
  line-height: 1.36;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

/* Cancel Button - Subtle variant (white background, blue text) */
.delete-confirm-cancel {
  background: var(--White, #FFFFFF);
  color: var(--Cobalt02, #1763A2);
  border: 1px solid var(--Cobalt02, #1763A2);
}

.delete-confirm-cancel:hover {
  opacity: 0.8;
  background: var(--Cobalt08, #EEF7FF);
}

/* Delete Button - Filled variant (red background, white text) */
.delete-confirm-delete {
  background: var(--Red02, #D22B3A);
  color: var(--White, #FFFFFF);
}

.delete-confirm-delete:hover {
  opacity: 0.9;
  background: var(--Red01, #C90012);
}

/* Disable button state */
.delete-confirm-cancel:disabled,
.delete-confirm-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   FILE REVIEW DIALOG (原文の確認)
   Figma Design: node-id=797-135835
   Size: 1080x666px
   Note: Uses common.css utility classes (tw-*)
   ======================================== */

/* Dialog Container - only custom properties not in common.css */
.file-review-dialog {
  height: 666px;
  box-shadow: 0px 4px 4px -4px rgba(12, 12, 13, 0.05), 0px 16px 16px -8px rgba(12, 12, 13, 0.1);
  position: relative;
  overflow: hidden;
  font-family: var(--font-family, 'Noto Sans', sans-serif);
}

/* Header Elements */
.file-review-filename {
  line-height: 1.36;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}

.file-review-divider {
  width: 2px;
  height: 100%;
  align-self: stretch;
  background: var(--BlueGray01, #B3B9C6);
  flex-shrink: 0;
}

.file-review-title {
  line-height: 1.36;
}

/* Close Button */
.file-review-close-btn {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.file-review-close-btn:hover {
  opacity: 0.7;
}

.file-review-close-btn img {
  width: 100%;
  height: 100%;
}

/* Search Input */
.file-review-search-input {
  width: 240px;
  border: 1px solid var(--BlueGray01, #B3B9C6);
  padding: 6px 12px;
  font-weight: 400;
  line-height: var(--line-height-normal, 19px);
  font-size: var(--size-sm, 14px);
  border-radius: var(--Radius-S, 4px);
}

.file-review-search-input::placeholder {
  color: var(--BlueGray01, #B3B9C6);
}

.file-review-search-input:focus {
  outline: none;
}

/* Search Button - disabled state */
.file-review-search-btn {
  background: var(--BlueGray06, #F2F3F5);
  border: none;
  padding: var(--Spacing-S, 8px) var(--Spacing-M, 16px);
  line-height: var(--line-height-normal, 19px);
  color: var(--BlueGray02, #C0C5D0);
  cursor: not-allowed;
  transition: all 0.2s ease;
}

.file-review-search-btn:not(:disabled) {
  background: var(--Cobalt02, #1763A2);
  color: var(--White, #FFFFFF);
  cursor: pointer;
}

.file-review-search-btn:not(:disabled):hover {
  opacity: 0.9;
}

/* Edit Button */
.file-review-edit-btn {
  width: 160px;
  background: transparent;
  border: 1px solid;
  padding: var(--Spacing-S, 8px) var(--Spacing-M, 16px);
  line-height: var(--line-height-normal, 19px);
  text-align: center;
  transition: all 0.2s ease;
  height: 35px;
}

.file-review-edit-btn:hover {
  background: var(--Cobalt08, #EEF7FF);
}

/* Text Area */
.file-review-text-area {
  height: 460px;
  overflow: hidden;
}

.file-review-content {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Paragraph */
.file-review-paragraph {
  font-weight: 400;
  line-height: 28px;
  word-wrap: break-word;
  /* white-space: pre-wrap; */
  font-size: 14px;
}

/* Custom Scrollbar */
.file-review-content::-webkit-scrollbar {
  width: 8px;
}

.file-review-content::-webkit-scrollbar-track {
  background: transparent;
}

.file-review-content::-webkit-scrollbar-thumb {
  background: var(--Grey-Grey03, #E3E2E2);
  border-radius: 16px;
}

.file-review-content::-webkit-scrollbar-thumb:hover {
  background: var(--Grey-Grey02, #CCC);
}

.file-review-content{
    font-family: var(--font-family, 'Noto Sans', sans-serif);
}

/* jQuery UI Dialog Wrapper overrides */
.file-review-dialog-wrapper .ui-dialog-titlebar {
  display: none;
}

.file-review-dialog-wrapper .ui-dialog-content {
  padding: 0;
  overflow: visible;
}

.file-review-dialog-wrapper .file-review-dialog {
  box-shadow: none;
}

.file-review-dialog-wrapper .ui-dialog-buttonpane {
  display: none;
}

.file-review-dialog-wrapper{
    border-radius: var(--Radius-M, 8px);
    padding: 0;
}

/* Dialog Edit */
textarea {
  width: 100%;
  border: none;
  resize: none;
  overflow: hidden;
  padding: 0;
  line-height: 19px;
  box-sizing: border-box;
  min-height: 19px;
  field-sizing: content; 
}
textarea:focus-visible {
  outline: none;
  border: none;
}

.file-edit-loading {
  position: absolute;
  inset: 0;
  z-index: 5; 
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--Cobalt02, #1763A2);
  font-size: var(--size-m, 16px);
  line-height: normal;
  pointer-events: none;
  font-weight: 400;
}

.file-edit-loading-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.file-edit-loading-icon img {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

.file-edit-display-text {
  width: 100%;
  line-height: 19px;
  min-height: 19px;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  box-sizing: border-box;
}

.file-edit-textarea {
  overflow: hidden;
}

.vs-spacer td {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.file-edit-page-link {
  color: #1763A2 !important;
  font-weight: 400;
  text-decoration: none;
}

.textarea-editable-replacement {
  outline: none;
  box-sizing: border-box;
  background-color: transparent;
}

.textarea-editable-replacement:focus {
  background-color: white !important;
}

.textarea-editable-replacement mark {
  background-color: #C9E6FF;
  padding: 0;
  color: inherit;
}
td:hover:not(.has-focus) {
  background-color: #EEF7FF;
}

td:hover:not(.has-focus) textarea {
  background-color: #EEF7FF;
}

td:hover:not(.has-focus) div {
  border-color: #EEF7FF;
}

td div.is-focused {
  border: 3px solid #C9E6FF !important;
  background: white !important;
  padding-top: 1px !important;
  padding-bottom: 1px !important;
  padding-left: 21px !important;
}

td.has-focus {
  border-color: #C9E6FF !important;
}

td div.is-focused textarea {
  background: white !important;
}

#file-edit-table-body.is-searching tr.search-hidden {
    display: none;
}

/* ========================================
   UNSAVED CHANGES DIALOG
   ======================================== */

/* Dialog Box */
.unsaved-changes-dialog {
  position: absolute;
  width: 320px;
  border: 1px solid #C90012;
  border-radius: 8px;
  box-shadow: 0px 4px 4px -4px rgba(12, 12, 13, 0.05), 0px 16px 16px -8px rgba(12, 12, 13, 0.1);
  z-index: 10001;
}

/* Action Buttons */
.unsaved-changes-discard-btn,
.unsaved-changes-save-btn {
  border: none;
  text-align: center;
  transition: all 0.2s ease;
  line-height: 1.362;
}

/* Discard Button (Subtle) */
.unsaved-changes-discard-btn {
  background: transparent;
  border: 1px solid transparent;
}

.unsaved-changes-discard-btn:hover {
  background: rgba(23, 99, 162, 0.08);
}

.unsaved-changes-discard-btn:active {
  background: rgba(23, 99, 162, 0.16);
}

/* Save Button (Filled) */
.unsaved-changes-save-btn {
  border: 1px solid #1763A2;
}

.unsaved-changes-save-btn:hover {
  background: #1558A0;
  border-color: #1558A0;
}

.unsaved-changes-save-btn:active {
  background: #124D8E;
  border-color: #124D8E;
}

.stf-file-review-result{
    font-size: 14px;
}

.stf-input:focus {
    background-color: var(--Cobalt08, #EEF7FF);
}

.stf-input:focus:not(:placeholder-shown) {
    border: 2px solid #C9E6FF;
    background-color: white;
}