/* File Details Page Styles */

/* Prevent scrollbar on body and html for file details page */
body {
  overflow: hidden;
  height: 100vh;
}

html {
  overflow: hidden;
  height: 100vh;
}

/* Evaluation Panel Styles */
.evaluation-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background-color: #1e293b;
  border-left: 1px solid #334155;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transition: right 0.3s ease;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  visibility: visible;
}

.evaluation-panel.show {
  right: 0;
}

/* Adjust content wrapper when evaluation panel is open */
body.evaluation-panel-open #content-wrapper {
  margin-right: 400px;
  transition: margin-right 0.3s ease;
}

.evaluation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 27px 20px;
  border-bottom: 1px solid #334155;
  background-color: #1e293b;
}

.evaluation-header h5 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

.evaluation-header .btn-link {
  color: #fff;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.evaluation-header .btn-link:hover {
  opacity: 1;
}

.evaluation-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.evaluation-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.evaluation-card:hover {
  background-color: #1e293b;
}

.evaluation-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.evaluation-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.evaluation-content {
  flex: 1;
  min-width: 0;
}

.evaluation-title {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.evaluation-description {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.evaluation-detail-link {
  color: #3b82f6;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}

.evaluation-detail-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.evaluation-footer {
  padding: 16px 20px;
  border-top: 1px solid #334155;
  background-color: #1e293b;
}

.evaluation-footer .btn {
  width: 100%;
  background-color: #1363df;
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.evaluation-footer .btn:hover {
  background-color: #1e40af;
}

.evaluation-footer .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.evaluation-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
}

/* Evaluation Status Buttons */
.evaluation-status-btn {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.evaluation-complete {
  background-color: #10b981;
  color: #fff;
}

.evaluation-complete:hover {
  background-color: #059669;
}

.evaluation-error {
  background-color: #ef4444;
  color: #fff;
}

.evaluation-error:hover {
  background-color: #dc2626;
}

.evaluation-warning {
  background-color: #f59e0b;
  color: #fff;
}

.evaluation-warning:hover {
  background-color: #d97706;
}

.evaluation-dot {
  font-size: 16px;
  line-height: 1;
}

.evaluation-triangle {
  font-size: 12px;
  line-height: 1;
}

.evaluation-count {
  font-weight: 600;
}

/* Evaluation Highlights in Document */
.evaluation-highlight {
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.evaluation-highlight:hover {
  opacity: 0.8;
}

.evaluation-warning-highlight {
  background-color: #f59e0b;
  color: #000;
}

.evaluation-error-highlight {
  background-color: #ef4444;
  color: #fff;
}

.evaluation-complete-highlight {
  background-color: #10b981;
  color: #fff;
}

/* Evaluation Alert Banner */
.evaluation-alert-banner {
  background-color: #ef4444;
  color: #fff;
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.evaluation-alert-text {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.evaluation-alert-banner .btn-link {
  color: #fff;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.evaluation-alert-banner .btn-link:hover {
  opacity: 1;
}

/* File Details Page Container - Scrollable Layout */
.file-details-container.page-content-dark {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
  overflow: hidden;
  max-height: calc(100vh - 100px);
  padding: 0 40px !important;
  position: relative;
}

.file-header {
  padding: 20px 0;
  flex-shrink: 0;
}

.file-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.file-metadata {
  width: 100%;
}

.metadata-table {
  width: auto;
  border-collapse: collapse;
  table-layout: auto;
}

.metadata-row:last-child {
  border-bottom: none;
}

.metadata-row td {
  vertical-align: top;
  padding: 8px 12px 8px 0;
}

.metadata-row:first-child td {
  padding-top: 0;
  padding-bottom: 4px;
}

.metadata-row:last-child td {
  padding-top: 4px;
  padding-bottom: 0;
}

.metadata-row td:last-child {
  padding-right: 0;
}

.metadata-label {
  font-weight: 500;
  color: #94a3b8;
  font-size: 14px;
}

.metadata-value {
  font-weight: 400;
  font-size: 14px;
}

.metadata-value.text-primary {
  color: #60a5fa !important;
}

.metadata-value.text-success {
  color: #34d399 !important;
}

.file-menu button {
  font-size: 18px;
  padding: 8px 12px;
}

.file-menu button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Main Content Area - Scrollable */
.file-content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-bottom: 20px;
  margin-bottom: 92px; /* Space for footer (72px min-height + 20px margin) */
}

/* Panels Container - Unified Layout */
.panels-container {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background-color: #1e293b;
  border-radius: 8px;
  overflow: visible;
  width: 90%;
  margin: 0 auto;
  position: relative;
}

.panels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  margin-bottom: 0;
  flex-shrink: 0;
  gap: 24px;
}

.panel-header-label {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
}

.panel-tab {
  cursor: pointer;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s;
  user-select: none;
}

.panel-tab:hover {
  color: #cbd5e1;
}

.panel-tab.active {
  color: #fff;
  font-weight: 600;
}

.panel-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #3b82f6;
  border-radius: 2px 2px 0 0;
}

.panel-header-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  padding: 0 10px;
}

.panel-tab {
  cursor: pointer;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s;
  user-select: none;
  color: #94a3b8;
}

.panel-tab:hover {
  color: #cbd5e1;
}

.panel-tab.active {
  color: #fff;
  font-weight: 600;
}

.panel-tab.active::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #3b82f6;
  border-radius: 2px 2px 0 0;
}

.panel-header-label:first-child {
  text-align: left;
}

.panel-header-label:last-child {
  text-align: left;
}

.panel-header-label .btn-link {
  font-size: 16px;
  color: #e2e8f0;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 4px 8px;
}

.panel-header-label .btn-link:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* OCR Button */
.ocr-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
  margin-right: 0;
}

.ocr-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.ocr-btn i {
  font-size: 14px;
}

.ocr-btn span {
  font-size: 14px;
}

.panels-row {
  flex: 1;
  display: flex;
  margin: 0;
  min-height: 0;
  height: 100%;
  overflow: visible;
  align-items: stretch;
}

/* File Panel Styles */
.file-panel {
  background-color: transparent;
  border: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.panels-row .col-md-6:first-child .file-panel {
  border-right: 1px solid #334155;
}

.panels-row .col-md-6 {
  padding-left: 6px;
  padding-right: 6px;
  display: flex;
  align-items: stretch;
}

.panels-row .col-md-6:last-child {
  padding-left: 0 !important;
  padding-right: 0;
}

.file-panel .card-header {
  background-color: #1e293b;
  border-bottom: 1px solid #334155;
  padding: 16px 20px;
}

.file-panel .card-header h5 {
  font-size: 16px;
  font-weight: 600;
}

.file-panel .card-body {
  flex: 1;
  overflow: visible;
  background-color: transparent;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.file-panel .card-body.p-0 {
  padding: 0 !important;
}

.file-panel .card-header {
  background-color: transparent;
  border-bottom: none;
  padding: 0 20px;
  flex-shrink: 0;
}

.file-panel .card-header .btn-link {
  font-size: 16px;
  color: #e2e8f0;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.file-panel .card-header .btn-link:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Uploaded File Container */
.uploaded-file-container {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0f172a;
  overflow: hidden;
  min-height: 0;
  box-sizing: border-box;
  position: relative;
  padding: 20px;
  /* Khi zoom > 100%, cho phép scroll để xem hết ảnh */
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Chỉ hiển thị trong khung, không vượt quá */
  max-width: 100%;
  max-height: 100%;
}

/* Ẩn scrollbar nhưng vẫn cho phép scroll */
.uploaded-file-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.uploaded-file-container {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* Image Wrapper - để tính toán scroll area chính xác */
.image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  /* Kích thước sẽ được set bằng JavaScript khi zoom */
}

.uploaded-file-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  background-color: #ffffff;
  display: block;
  margin: 0;
  transition: transform 0.3s ease;
}

/* Zoom Controls - Di chuyển theo thanh trượt ngoài cùng */
.zoom-controls {
  position: sticky;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(30, 41, 59, 0.9);
  padding: 6px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  width: fit-content;
  margin-top: auto;
  align-self: flex-start;
  /* Đảm bảo không bị ảnh hưởng bởi transform của hình ảnh */
  transform: none !important;
  pointer-events: auto;
}

.zoom-btn {
  background-color: transparent;
  border: 1px solid #475569;
  color: #e2e8f0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.zoom-btn:hover:not(.disabled):not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #64748b;
  color: #fff;
}

.zoom-btn.disabled,
.zoom-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.zoom-btn i {
  font-size: 14px;
}

.zoom-level {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
}

/* OCR Text Content */
.ocr-text-content {
  color: #1e293b;
  font-size: 14px;
  flex: 1;
  overflow: visible;
  background-color: #ffffff;
  border-radius: 10px;
  word-wrap: break-word;
  white-space: pre-wrap;
  min-height: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.ocr-text-content[contenteditable="true"] {
  border: 2px solid #3b82f6;
  outline: none;
  padding: 20px;
}

.ocr-text-content p {
  color: #1e293b;
  margin: 0 !important;
  line-height: 26px;
}

.ocr-text-content strong {
  font-weight: 600;
  color: #1e293b;
}

/* Scrollbar Styling - Only for file-content-area */
.file-content-area::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.file-content-area::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

.file-content-area::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.file-content-area::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Action Buttons Footer */
.file-actions-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 13px 0;
  border-top: 1px solid #334155;
  border-right: 1px solid #334155;
  min-height: 72px;
  background-color: #0f172a;
  z-index: 10;
}

.file-actions-container {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: stretch;
  padding: 0 40px;
  max-width: 100%;
  margin: 0 auto;
}

.btn-action {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  min-height: 48px;
  flex: 0 0 auto;
  gap: 8px;
}

.btn-action i {
  font-size: 16px;
}

.btn-action-red {
  background-color: #ef4444;
}

.btn-action-red:hover {
  background-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-action-orange {
  background-color: #f97316;
}

.btn-action-orange:hover {
  background-color: #ea580c;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(249, 115, 22, 0.3);
}

.btn-action-green {
  background-color: #10b981;
}

.btn-action-green:hover {
  background-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-action-blue {
  background-color: #3b82f6;
}

.btn-action-blue:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* AI Chat Panel */
.ai-chat-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background-color: #1e293b;
  border-left: 1px solid #334155;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transition: right 0.3s ease;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  visibility: visible;
}

.ai-chat-panel.show {
  right: 0;
}

#content {
  position: relative;
}

/* Adjust content wrapper when chat panel is open */
body.chat-panel-open #content-wrapper {
  margin-right: 400px;
  transition: margin-right 0.3s ease;
}

#content-wrapper {
  transition: margin-right 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 27px 20px;
  border-bottom: 1px solid #334155;
  background-color: #1e293b;
}

.ai-chat-header h5 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.ai-chat-header .btn-link {
  color: #fff;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.ai-chat-header .btn-link:hover {
  opacity: 1;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #0f172a;
}

.suggested-questions-message {
  margin-top: 8px;
}

.suggested-questions-header {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
}

.suggested-questions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.suggested-question-link {
  color: #60a5fa;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
}

.suggested-question-link:hover {
  color: #93c5fd;
}

.ai-chat-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* User message style - align to right */
.ai-chat-message.user-message {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.ai-chat-message.user-message .ai-chat-content {
  text-align: right;
  align-items: flex-end;
  display: flex;
  flex-direction: column;
}

.ai-chat-message.user-message .ai-chat-text {
  background-color: #3b82f6;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px 12px 0 12px;
  max-width: 80%;
  word-wrap: break-word;
}

.ai-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background-color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
}

.ai-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-chat-content {
  flex: 1;
  min-width: 0;
}

.ai-chat-sender-name {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.ai-chat-text {
  color: #000;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  margin-bottom: 8px;
  display: flex;
  padding: 12px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  align-self: stretch;
}

.ai-chat-meta-title {
  color: #070a0e;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  line-height: 20px;
  margin: 0;
}

.ai-chat-meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
}

.ai-chat-time {
  color: #94a3b8;
}

.ai-chat-reaction-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
  cursor: pointer;
}

.emoji-reaction {
  font-size: 14px;
}

.reaction-count {
  color: #e2e8f0;
  font-size: 12px;
  margin-left: 2px;
}

.ai-chat-reaction {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ef4444;
  cursor: pointer;
}

.ai-chat-reaction i {
  font-size: 12px;
}

.ai-chat-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid #334155;
  background-color: #1e293b;
  position: relative;
  min-height: 72px;
}

.ai-chat-input {
  flex: 1;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 10px 12px;
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input:focus {
  border-color: #3b82f6;
}

.ai-chat-input::placeholder {
  color: #64748b;
}

.ai-chat-input-icon-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-input-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.ai-chat-send-btn {
  background-color: #3b82f6;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 6px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-send-btn:hover {
  background-color: #2563eb;
}

/* Emoji Picker */
.emoji-picker {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 320px;
  max-height: 300px;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  z-index: 10000;
  overflow: hidden;
}

.emoji-picker.show {
  display: flex;
}

.emoji-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #334155;
  background-color: #1e293b;
}

.emoji-picker-header span {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
}

.emoji-picker-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.emoji-picker-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.emoji-picker-content {
  padding: 12px;
  overflow-y: auto;
  max-height: 250px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.emoji-item {
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  text-align: center;
  border-radius: 6px;
  transition: background-color 0.2s;
  user-select: none;
}

.emoji-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Scrollbar for emoji picker */
.emoji-picker-content::-webkit-scrollbar {
  width: 6px;
}

.emoji-picker-content::-webkit-scrollbar-track {
  background: #1e293b;
}

.emoji-picker-content::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 3px;
}

.emoji-picker-content::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Scrollbar for chat messages */
.ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
  background: #1e293b;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-chat-panel {
    width: 100%;
    right: -100%;
  }

  .file-content-area .row {
    flex-direction: column;
  }

  .file-content-area .col-md-6 {
    max-width: 100%;
  }

  .file-actions-footer .col-md-3 {
    max-width: 100%;
  }

  .metadata-table {
    display: block;
  }

  .metadata-row {
    display: block;
    border-bottom: 1px solid #334155;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .metadata-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .metadata-row td {
    display: block;
    padding: 4px 0;
    border: none;
  }

  .metadata-label {
    font-weight: 600;
    margin-bottom: 4px;
  }
}

/* Evaluation Panel */
.evaluation-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background-color: #1e293b;
  border-left: 1px solid #334155;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transition: right 0.3s ease;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  visibility: visible;
}

.evaluation-panel.show {
  right: 0;
}

.evaluation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #334155;
  background-color: #1e293b;
  flex-shrink: 0;
}

.evaluation-header h5 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

.evaluation-header .btn-link {
  color: #fff;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 0;
  border: none;
  background: transparent;
}

.evaluation-header .btn-link:hover {
  opacity: 1;
}

.evaluation-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.evaluation-footer {
  padding: 20px;
  border-top: 1px solid #334155;
  background-color: #1e293b;
  flex-shrink: 0;
}

.evaluation-footer .btn {
  width: 100%;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  color: #fff;
  background-color: #1363df;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  gap: 8px;
}

.evaluation-footer .btn:hover {
  background-color: #0d4fc2;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(19, 99, 223, 0.3);
}

.evaluation-footer .btn i {
  font-size: 16px;
}

/* Adjust content wrapper when evaluation panel is open */
body.evaluation-panel-open #content-wrapper {
  margin-right: 400px;
  transition: margin-right 0.3s ease;
}

/* Evaluation Card Styles */
.evaluation-card {
  background-color: #0f172a;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #334155;
}

.evaluation-card.error {
  border-left: 4px solid #ef4444;
}

.evaluation-card.warning {
  border-left: 4px solid #f59e0b;
}

.evaluation-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px;
}

.evaluation-card-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.evaluation-card.error .evaluation-card-icon {
  background-color: rgba(239, 68, 68, 0.1);
}

.evaluation-card.warning .evaluation-card-icon {
  background-color: rgba(245, 158, 11, 0.1);
}

.evaluation-card-icon svg {
  width: 20px;
  height: 20px;
}

.evaluation-card.error .evaluation-card-icon svg {
  color: #ef4444;
}

.evaluation-card.warning .evaluation-card-icon svg {
  color: #f59e0b;
}

.evaluation-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 12px;
}

.evaluation-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
  line-height: 1.4;
}

.evaluation-card-description {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
  padding: 0px 0px 0px 32px;
}

.evaluation-card-description .highlight-error {
  color: #ef4444;
  font-weight: 600;
}

.evaluation-card-description .highlight-warning {
  color: #f59e0b;
  font-weight: 600;
}

.evaluation-card-action {
  margin-top: 4px;
  padding: 0px 0px 0px 32px;
}

.evaluation-card-action a {
  color: #3b82f6;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.evaluation-card-action a:hover {
  color: #60a5fa;
  text-decoration: none;
}

/* Scrollbar for evaluation list */
.evaluation-list::-webkit-scrollbar {
  width: 6px;
}

.evaluation-list::-webkit-scrollbar-track {
  background: #1e293b;
}

.evaluation-list::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 3px;
}

.evaluation-list::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ============================================
   Compare Page Styles
   ============================================ */

.compare-title {
  height: 36px;
  margin: 16px 40px;
}

.text-center {
  text-align: center; /* Center the text */
}

.download-filebtn {
  display: flex; /* Ensure buttons are in a row */
  height: 36px; /* Common height for buttons */
  gap: 10px;
}

.search-clear-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.download-filebtn button {
  color: white; /* Set button text color */
}

.btn-hoanthien {
  background-color: #13a10e; /* Hoàn thiện button color */
  border-radius: 16px;
  border-style: none !important;
}

.btn-danhgialai {
  background-color: #1363df; /* Đánh giá lại button color */
  border-radius: 6px;
  border-style: none !important;
}

.bg-dark-button {
  background-color: #ffffff1a; /* Background color */
  color: white; /* Ensure text color is white for visibility */
  border: none; /* Remove border if needed */
  border-style: none !important;
  padding: 0;
}

.divider {
  border-top: 1px solid #4a5568; /* Màu của đường kẻ */
  margin-bottom: 20px; /* Khoảng cách dưới đường kẻ */
}

.page-content-dark {
  padding: 0 40px !important;
}

.search-input::placeholder {
  color: #ffffff; /* Màu chữ placeholder là trắng */
  opacity: 1; /* Tăng độ tương phản nếu cần */
}

.table td {
  max-width: 200px; /* Giới hạn chiều rộng tối đa cho ô */
  white-space: normal; /* Cho phép nội dung xuống hàng nếu cần */
  overflow: hidden; /* Ẩn nội dung bị tràn */
  text-overflow: ellipsis; /* Hiển thị dấu ba chấm (...) nếu nội dung bị cắt */
}

/* Allow full table height on this page — override global hide-overflow rule */
.page-content-dark .table {
  overflow: visible !important;
}

.card-body-table {
  overflow: visible;
}

/* Make main table vertically scrollable inside the card */
.card-body-table .table-responsive {
  max-height: calc(100vh - 360px);
  overflow-y: auto;
  overflow-x: auto;
}

/* Slightly smaller max-height on small screens */
@media (max-width: 767.98px) {
  .card-body-table .table-responsive {
    max-height: 320px;
  }
}

/* Optional: thin scrollbar styling for the table area */
.card-body-table .table-responsive::-webkit-scrollbar {
  width: 8px;
}

.card-body-table .table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.custom-status {
  background-color: #b36800; /* Màu nền */
  border-radius: 16px; /* Bo góc */
  color: #ffffff; /* Đảm bảo chữ rõ ràng trên nền tối */
  padding: 5px 10px; /* Tạo khoảng cách bên trong */
}

.status-highlight {
  border: 1px solid #d13438;
  border-radius: 16px; /* Bo góc */
  color: #d13438; /* Màu chữ */
  padding: 5px 10px; /* Tạo khoảng cách bên trong */
  display: inline-block; /* Để áp dụng border-radius cho nội dung */
  cursor: pointer;
}

.custom-status-green {
  background-color: #158463; /* Màu nền */
  border-radius: 16px; /* Bo góc */
  color: #ffffff; /* Đảm bảo chữ rõ ràng trên nền tối */
  padding: 5px 10px; /* Tạo khoảng cách bên trong */
}

.status-highlight-red {
  border: 1px solid #158463;
  border-radius: 16px; /* Bo góc */
  color: #158463; /* Màu chữ */
  padding: 5px 10px; /* Tạo khoảng cách bên trong */
  display: inline-block; /* Để áp dụng border-radius cho nội dung */
}

/* Overlay nền mờ */
/* Scope the popup and overlay to live inside the #content container */
#content {
  position: relative;
  overflow: hidden;
}

#content #overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
  z-index: 999;
}

/* Popup trượt từ dưới (scoped to #content) */
#content #bottomPopup {
  /* hidden state: positioned off-canvas with no pointer events */
  position: absolute;
  bottom: 0; /* keep at bottom of content, use transform to hide/show */
  left: 0;
  width: 100%;
  height: 70%;
  max-height: 70%;
  background-color: #1e2939;

  transform: translateY(100%);
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 240ms ease;
  pointer-events: none;
  z-index: 1000;
  padding: 0;
  overflow: hidden;
}

/* Khi hiển thị */
#content #bottomPopup.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Overlay visible */
#content #overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Popup table first column (label column) styling — ensure it targets the left label cell */
#content #bottomPopup .popup-body table tbody tr > td:first-child {
  color: #ffffffcc !important;
  font-weight: 400;
  font-size: 14px;
}

/* Popup table layout and column sizing: first column 20%, second column 80% */
#content #bottomPopup .popup-body table {
  width: 100%;
  table-layout: fixed; /* ensure column widths are applied */
}

#content #bottomPopup .popup-body table tbody tr > td:first-child {
  color: #ffffffcc !important;
  font-weight: 400;
  width: 20%;
  padding-right: 12px;
  box-sizing: border-box;
  vertical-align: top;
}

/* Popup table second column (value column) styling */
#content #bottomPopup .popup-body table tbody tr > td:nth-child(2) {
  color: #ffffff !important;
  font-size: 14px;
  width: 80%;
  box-sizing: border-box;
  vertical-align: top;
}

/* Remove outer/table cell borders; only keep horizontal separators between rows */
#content #bottomPopup .popup-body table {
  border: none !important;
  border-collapse: collapse;
}

#content #bottomPopup .popup-body table th,
#content #bottomPopup .popup-body table td {
  border: none !important;
}

/* Add a subtle divider between rows, but not after the last row */
#content #bottomPopup .popup-body table tbody tr:not(:last-child) > td {
  border-bottom: 1px solid #ffffff1a !important;
}

/* Header */
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background-color: #1e2939;
  color: #ffffff;
  font-weight: 600;
}

/* Header title sizing */
.popup-header h5 {
  font-size: 16px;
  margin: 0;
  line-height: 1.2;
}

.close-btn {
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background-color: #ffffff1a;
  border-radius: 50%;
}

/* Nội dung */
.popup-body {
  padding: 12px 20px;
  /* allow internal scrolling with mouse wheel but keep popup clipped to 70% */
  max-height: calc(85% - 71px);
  overflow-y: auto;
  overscroll-behavior: contain; /* don't allow scroll to propagate to outer page */
  -webkit-overflow-scrolling: touch;
  background-color: #101828;
}

/* Optional: thinner scrollbar appearance inside popup */
#content #bottomPopup .popup-body::-webkit-scrollbar {
  width: 8px;
}

#content #bottomPopup .popup-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* ============================================
   Extract Page Styles
   ============================================ */

/* Extract Page Container - Scrollable Layout */
.file-details-container.page-content-dark {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
  overflow: hidden;
  max-height: calc(100vh - 100px);
  padding: 0 40px !important;
  position: relative;
}

.file-header {
  padding: 20px 0;
  flex-shrink: 0;
}

.file-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.file-metadata {
  width: 100%;
}

.metadata-table {
  width: auto;
  border-collapse: collapse;
  table-layout: auto;
}

.metadata-row:last-child {
  border-bottom: none;
}

.metadata-row td {
  vertical-align: top;
  padding: 8px 12px 8px 0;
}

.metadata-row:first-child td {
  padding-top: 0;
  padding-bottom: 4px;
}

.metadata-row:last-child td {
  padding-top: 4px;
  padding-bottom: 0;
}

.metadata-row td:last-child {
  padding-right: 0;
}

.metadata-label {
  font-weight: 500;
  color: #94a3b8;
  font-size: 14px;
}

.metadata-value {
  font-weight: 400;
  font-size: 14px;
}

.metadata-value.text-primary {
  color: #60a5fa !important;
}

.metadata-value.text-success {
  color: #34d399 !important;
}

.file-menu button {
  font-size: 18px;
  padding: 8px 12px;
}

.file-menu button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Main Content Area - Scrollable */
.file-content-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 20px;
  margin-bottom: 92px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

/* Panels Container - Unified Layout */
.panels-container {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background-color: #1e293b;
  border-radius: 8px;
  overflow: visible;
  width: 90%;
  margin: 0 auto;
  position: relative;
}

.panels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  margin-bottom: 0;
  flex-shrink: 0;
  gap: 24px;
}

.panel-header-label {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
}

.panel-tab {
  cursor: pointer;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s;
  user-select: none;
}

.panel-tab:hover {
  color: #cbd5e1;
}

.panel-tab.active {
  color: #fff;
  font-weight: 600;
}

.panel-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #3b82f6;
  border-radius: 2px 2px 0 0;
}

.panel-header-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  padding: 0 10px;
}

.panel-tab {
  cursor: pointer;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s;
  user-select: none;
  color: #94a3b8;
}

.panel-tab:hover {
  color: #cbd5e1;
}

.panel-tab.active {
  color: #fff;
  font-weight: 600;
}

.panel-tab.active::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #3b82f6;
  border-radius: 2px 2px 0 0;
}

.panel-header-label:first-child {
  text-align: left;
}

.panel-header-label:last-child {
  text-align: left;
}

.panel-header-label .btn-link {
  font-size: 16px;
  color: #e2e8f0;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 4px 8px;
}

.panel-header-label .btn-link:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* OCR Button */
.ocr-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
  margin-right: 0;
}

.ocr-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.ocr-btn i {
  font-size: 14px;
}

.ocr-btn span {
  font-size: 14px;
}

.panels-row {
  flex: 1;
  display: flex;
  margin: 0;
  min-height: 0;
  overflow: visible;
  align-items: stretch;
}

.panels-row .col-md-8 {
  height: 100%;
  display: flex;
}

.panels-row .col-md-8 .card.file-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.panels-row .col-md-8 .card-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panels-row .col-md-8 .uploaded-file-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* File Panel Styles */
.file-panel {
  background-color: transparent;
  border: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.panels-row .col-md-6:first-child .file-panel {
  border-right: 1px solid #334155;
}

.panels-row .col-md-6 {
  padding-left: 6px;
  padding-right: 6px;
  display: flex;
  align-items: stretch;
}

.panels-row .col-md-6:last-child {
  padding-left: 0 !important;
  padding-right: 0;
}

.file-panel .card-header {
  background-color: #1e293b;
  border-bottom: 1px solid #334155;
  padding: 16px 20px;
}

.file-panel .card-header h5 {
  font-size: 16px;
  font-weight: 600;
}

.file-panel .card-body {
  flex: 1;
  overflow: visible;
  background-color: transparent;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.file-panel .card-body.p-0 {
  padding: 0 !important;
}

.file-panel .card-header {
  background-color: transparent;
  border-bottom: none;
  padding: 0 20px;
  flex-shrink: 0;
}

.file-panel .card-header .btn-link {
  font-size: 16px;
  color: #e2e8f0;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.file-panel .card-header .btn-link:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Uploaded File Container */
.uploaded-file-container {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0f172a;
  overflow: hidden;
  min-height: 0;
  box-sizing: border-box;
  position: relative;
  padding: 10px;
  /* Khi zoom > 100%, cho phép scroll để xem hết ảnh */
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Chỉ hiển thị trong khung, không vượt quá */
  max-width: 100%;
  max-height: 100%;
}

/* Ẩn scrollbar nhưng vẫn cho phép scroll */
.uploaded-file-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.uploaded-file-container {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* Image Wrapper - để tính toán scroll area chính xác */
.image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  /* Kích thước sẽ được set bằng JavaScript khi zoom */
}

.uploaded-file-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  background-color: #ffffff;
  display: block;
  margin: 0;
  transition: transform 0.3s ease;
}

/* Zoom Controls - Di chuyển theo thanh trượt ngoài */
.zoom-controls {
  position: sticky;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(30, 41, 59, 0.9);
  padding: 6px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  width: fit-content;
  margin-top: auto;
  align-self: flex-start;
  /* Đảm bảo không bị ảnh hưởng bởi transform của hình ảnh */
  transform: none !important;
  pointer-events: auto;
}

.zoom-btn {
  background-color: transparent;
  border: 1px solid #475569;
  color: #e2e8f0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.zoom-btn:hover:not(.disabled):not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #64748b;
  color: #fff;
}

.zoom-btn.disabled,
.zoom-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.zoom-btn i {
  font-size: 14px;
}

.zoom-level {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
}

/* Scrollbar Styling - Only for file-content-area */
.file-content-area::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.file-content-area::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

.file-content-area::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.file-content-area::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Extract Form Styles */
/* Đảm bảo col-md-4 có cùng chiều cao với col-md-8 */
.panels-row .col-md-4 {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.panels-row .col-md-4 .card.file-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.panels-row .col-md-4 .card-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Wrapper để tạo scrollbar riêng cho phần extract form */
.extract-form-wrapper {
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.extract-form-container {
  background-color: #1e293b;
  padding: 20px;

  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  height: 100%;
  scrollbar-width: thin;
  scrollbar-color: #475569 #1e293b;
}

/* Scrollbar styling for extract-form-container */
.extract-form-container::-webkit-scrollbar {
  width: 8px;
}

.extract-form-container::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

.extract-form-container::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.extract-form-container::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Thêm thanh trượt riêng cho extract-form-container khi nội dung vượt quá - KHÔNG SỬA CODE CŨ */
.extract-form-container {
  max-height: calc(185vh - 5px);
  overflow-y: auto;
  overflow-x: hidden;
}

.extract-field {
  margin-bottom: 16px;
}

.extract-text {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
}

.extract-label {
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
}

.extract-value {
  color: #e2e8f0;
  flex: 1;
  word-wrap: break-word;
}

.extract-text-block {
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.6;

  margin-top: 4px;
  padding: 8px 12px;

  border: 1px solid #334155;
  border-radius: 4px;
}

.extract-form-container .form-control.extract-input {
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 14px;
  padding: 8px 12px;
  width: 100%;
  transition: border-color 0.2s;
}

.extract-form-container textarea.extract-input {
  resize: none;
  min-height: 100px;
  font-family: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: hidden;
}

.extract-form-container textarea.extract-input::-webkit-scrollbar {
  display: none;
}

.extract-form-container textarea.extract-input {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.extract-form-container .form-control.extract-input:focus {
  background-color: #0f172a;
  border-color: #3b82f6;
  color: #e2e8f0;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.extract-form-container .form-control.extract-input:read-only {
  background-color: #0f172a;
  border-color: #334155;
  cursor: default;
}

.extract-form-container .form-control.extract-input::placeholder {
  color: #64748b;
}

.extract-form-container .form-group {
  margin-bottom: 16px;
}

.extract-form-container .btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.extract-form-container .btn-primary {
  background-color: #3b82f6;
  color: #fff;
}

.extract-form-container .btn-primary:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.extract-form-container .btn-secondary {
  background-color: #475569;
  color: #fff;
}

.extract-form-container .btn-secondary:hover {
  background-color: #64748b;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(71, 85, 105, 0.3);
}

.extract-form-container .btn i {
  margin-right: 6px;
  font-size: 14px;
}

.extract-form-container .gap-2 {
  gap: 8px;
}

/* Scrollbar for extract form wrapper */
.extract-form-wrapper::-webkit-scrollbar {
  width: 8px;
}

.extract-form-wrapper::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

.extract-form-wrapper::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.extract-form-wrapper::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Firefox scrollbar */
.extract-form-wrapper {
  scrollbar-width: thin;
  scrollbar-color: #475569 #1e293b;
}

/* Evaluation buttons text left align */
#evaluatePassBtn,
#evaluateFailBtn {
  justify-content: flex-start;
  text-align: left;
}
