@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
  font-family: 'Noto Sans', sans-serif !important;
}

/* Modal fixes for z-index and backdrop issues */
.modal {
  z-index: 99999 !important;
}

.modal-backdrop {
  z-index: 99998 !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
}

.modal-backdrop.show {
  opacity: 1 !important;
}

.modal-dialog {
  z-index: 99999 !important;
  pointer-events: auto !important;
}

.modal-content {
  z-index: 99999 !important;
  background-color: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Ensure modal is visible when shown */
.modal.show {
  display: block !important;
}

/* Allow modal to be hidden */
.modal:not(.show) {
  display: none !important;
}

.modal.show .modal-dialog {
  transform: none !important;
}

/* Specific modal fixes */
#scrapeModal {
  z-index: 99999 !important;
}

#scrapeModal .modal-dialog {
  z-index: 99999 !important;
}

#scrapeModal .modal-content {
  z-index: 99999 !important;
}

/* Disable horizontal scroll on mobile */
@media (max-width: 991.98px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  .wrapper, 
  .content-wrapper,
  .main-header,
  .main-sidebar,
  .content {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }
  
  /* Ensure all containers don't exceed viewport width */
  * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix potential wide elements */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .card-body {
    overflow-x: hidden !important;
  }
  
  /* Prevent text from causing horizontal overflow */
  .title-wrap {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }
}

.modal .table td,
.table th {
  padding: 3px;
}

.content-header {
  padding: 10px 0.5rem;
}

.content-header h1 {
  font-size: 26px;
  color: #ce25ff;
}

.card-body {
  padding: 10px;
}

.file-preview {
  overflow: hidden;
  position: relative;
  /* border: 1px solid #ced4da; */
  border-radius: 4px;
  margin: 4px;
}

.file-preview.checked {
  overflow: hidden;
  position: relative;
  /* border: 1px solid #007bff; */
  border-radius: 4px;
  margin: 4px;
}

.file-preview img {
  max-width: 720px !important;
  display: block;
  -o-object-fit: cover;
  object-fit: cover;
}

.file-preview img:hover {
  cursor: pointer;
}

.file-preview .close-icon,
.file-preview .status-indicator {
  --size: 20px;
  position: absolute;
  line-height: var(--size);
  height: var(--size);
  border-radius: var(--size);
  box-shadow: 0 0 5px currentColor;
  right: 0.25rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 0;
  padding: 0;
}

.file-preview .close-icon {
  width: var(--size);
  font-size: var(--size);
  background: #933;
  color: #fff;
  top: 0.25rem;
  cursor: pointer;
}

.file-preview .status-indicator {
  font-size: calc(var(--size) * 0.75);
  bottom: 0.25rem;
  padding: 0 10px;
}

.file-preview .loading-indicator {
  -webkit-animation: pulse-0f8a2d78 1.5s linear 0s infinite;
  animation: pulse-0f8a2d78 1.5s linear 0s infinite;
  color: #000;
}

.file-preview .success-indicator {
  background: #6c6;
  color: #040;
}

.file-preview .failure-indicator {
  background: #933;
  color: #fff;
}

#file-manager {
  font-family: Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #f4f6f9;
  position: relative;
}

.drop-area {
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

.drop-area[data-active="true"] {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  background: hsla(0, 0%, 100%, 0.8);
}

label input[type="file"]:not(:focus-visible) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

label {
  font-size: 18px;
  color: #3d3d3d;
}

.image-list {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  padding: 0;
  justify-content: center;
}

.multiple-file .image-list {
  justify-content: left;
}

.upload-button {
  display: block;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 50px;
  padding: 0.75rem 3rem;
  margin: 1rem auto;
  font-size: 1.25rem;
  font-weight: 700;
  background: #369;
  color: #fff;
  text-transform: uppercase;
}

button {
  cursor: pointer;
}

.name-file-preview {
  position: absolute;
  bottom: -12px;
  text-align: center;
  width: 100%;
  padding: 2px;
  font-size: 12px;
  font-weight: bold;
  color: blueviolet;
}

.name-file-preview p {
  text-align: center;
}

.upload-btn {
  text-align: center;
  padding: 5px;
  width: 90px;
  margin: 0 auto;
  border-radius: 4px;
  background-color: #007bff;
  font-size: 14px;
  font-weight: bold;
  color: white;
  cursor: pointer;
}

#file-manager .label-text-input {
  position: relative;
  display: block;
  background-color: #dadada87;
  padding: 10px 3px;
  border-radius: 4px;
  margin: 5px;
}

#file-manager .open-file-manager {
  position: absolute;
  right: 6px;
  width: 36px;
  background-color: #57d0067a;
  top: 6px;
  z-index: 998;
  border-radius: 4px;
  cursor: pointer;
}

#file-manager .file-input {
  cursor: pointer !important;
  position: absolute !important;
  height: 50px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  border: 0 !important;
  width: 100% !important;
  z-index: 997;
  margin: 0 0 !important;
  top: 0px;
  left: 0px;
  opacity: 0;
  cursor: pointer !important;
  clip: unset !important;
  height: 100% !important;
}

.only-cover {
  width: auto;
}

.image-list.current-show {
  padding-top: 10px;
  border-top: 1px solid #ced4da;
}

.color-palette {
  padding: 2px 5px;
  border-radius: 1px;
}

.cover-item {
  width: auto;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.cover-item:hover {
  transform: scale(1.02);
}

.cover-item-large {
  width: 240px;
  height: 360px;
  object-fit: contain;
  border-radius: 4px;
  cursor: pointer;
}

.table td,
.table th {
  vertical-align: middle;
  display: table-cell;
}

.card-header>.card-tools {
  margin-right: 5px;
}

.blink p {
  animation: blink 2s linear infinite;
}

@keyframes blink {
  0% {
    opacity: 0;
  }

  50% {
    opacity: .5;
  }

  100% {
    opacity: 1;
  }
}

.swal2-image {
  max-height: 480px;
  object-fit: contain;
}

iframe {
  background: transparent;
  border: 1px solid #ffffff;
  border-radius: 6px;
}

.container-preview-cover {
  width: 600px !important;
}

.container-preview-cover .swal2-popup {
  position: relative;
  min-height: 300px !important;
  overflow: hidden !important;
}

.container-preview-cover .swal2-popup .swal2-actions {
  position: absolute;
  top: 0px;
  right: 0px;
}

.container-preview-cover .swal2-image {
  margin: 1.7em 0 0.5em 0;
  min-height: 300px !important;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 4px;
}

.container-preview-cover .swal2-confirm {
  width: 30px;
}

.container-preview-cover .swal2-popup.swal2-toast {
  padding: .25rem 1.6rem;
}

.container-preview-cover .swal2-toast {
  max-width: 600px;
}

.swal2-title {
  display: flex !important;
  align-items: center !important;
  height: 41px !important;
}

.container-preview-cover .swal2-title {
  text-align: center !important;
}

.error {
  color: #dc3545;
}

/**
modal default
**/
.modal-header {
  padding: 2px 10px;
}

.modal-title {
  font-size: 20px;
}

input[type="checkbox"],
input[type="radio"] {
  zoom: 1.8;
  cursor: pointer;
}

select {
  cursor: pointer;
}

.fas:hover {
  cursor: pointer;
}

.pointer {
  cursor: pointer;
}

.swal2-popup.swal2-toast .swal2-html-container {
  margin: unset;
}

.contentAddModule .setWidthGird1 {
  width: 100px;
}

.contentAddModule input[type="checkbox"],
input[type="radio"] {
  zoom: 0.8;
}

label {
  /* color: #007bff; */
  font-size: 16px;
}

.menu-child {
  margin-left: 10px;
}

.card {
  margin-bottom: unset !important;
}

.loading-text {
  font-size: 18px;
  animation: blink 1s infinite;
  padding: 2px;
  color: rgb(10, 178, 10);
}

.action-affect {
  position: fixed;
  right: 28px;
  bottom: 10px;
  z-index: 9999;
}

.reset-filter {
  margin-left: 5px;
}

.content-ai-chat {
  position: relative;
}

.content-ai-chat .copy-content-chat {
  position: absolute;
  bottom: 0px;
  right: 10px;
  font-size: 24px;
}


/* @media screen and (max-width: 1024px) {
  .navbar-nav .toggle-sidebar-button {
    position: absolute;
    right: 106px;
    top: 9px;
  }
} */

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

  to {
    transform: rotate(360deg);
  }
}

.spinner {
  margin-top: 4px;
  width: 32px;
  height: 32px;
  border: 5px solid #ddd;
  border-top: 5px solid blueviolet;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.highcharts-credits {
  display: none;
}

.f-uppercase::first-letter {
  text-transform: uppercase;
  display: inline-block !important;
}

/* vSelect Global Styles */
.v-select {
  position: relative;
  font-family: inherit;
  min-width: 200px;
}

/* Ensure vSelect always shows selected values */
.v-select .vs__dropdown-toggle {
  position: relative !important;
}

.v-select .vs__selected-options {
  position: relative !important;
  z-index: 1 !important;
}

/* Force display of selected items */
.v-select .vs__selected-options .vs__selected {
  position: relative !important;
  z-index: 2 !important;
  pointer-events: auto !important;
}

.vs__dropdown-toggle {
  height: 38px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0.75rem !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.375rem !important;
  background-color: #fff !important;
  cursor: pointer;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  line-height: 1.2 !important;
  overflow: hidden !important;
}

.vs__dropdown-toggle:hover {
  border-color: #adb5bd !important;
}

.vs__dropdown-toggle:focus-within {
  border-color: #86b7fe !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.vs__selected-options {
  padding: 2px 0 !important;
  margin: 0 !important;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  height: 24px;
  flex-wrap: nowrap !important;
  gap: 4px;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: thin;
  -ms-overflow-style: auto;
  scroll-behavior: smooth;
  white-space: nowrap !important;
}

.vs__selected-options::-webkit-scrollbar {
  height: 6px;
}

.vs__selected-options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.vs__selected-options::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.vs__selected-options::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.vs__selected-options .vs__selected {
  margin: 0 !important;
  padding: 1px 6px !important;
  display: flex !important;
  align-items: center !important;
  height: 20px !important;
  line-height: 1.2 !important;
  background-color: #e9ecef !important;
  border-radius: 10px !important;
  font-size: 0.75rem !important;
  color: #495057 !important;
  border: 1px solid #ced4da !important;
  max-width: 120px !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  flex-shrink: 0 !important;
  flex-basis: auto !important;
  flex-grow: 0 !important;
}

.vs__selected-options .vs__selected:last-child {
  margin-right: 0 !important;
}

.vs__actions {
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0 !important;
  margin-left: 8px !important;
  position: relative !important;
  z-index: 2 !important;
}

.vs__clear {
  padding: 0 4px !important;
  margin: 0 !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  color: #6c757d !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
}

/* Close button inside selected tags */
.vs__selected .vs__deselect {
  padding: 0 1px !important;
  margin-left: 3px !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  color: #6c757d !important;
  font-size: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
}

.vs__selected .vs__deselect:hover {
  background-color: #dc3545 !important;
  color: #fff !important;
}

.vs__clear:hover {
  background-color: #e9ecef !important;
  color: #495057 !important;
}

.vs__open-indicator {
  fill: #6c757d !important;
  width: 16px !important;
  height: 16px !important;
  transition: transform 0.2s ease !important;
  cursor: pointer !important;
}

.vs__dropdown-toggle:hover .vs__open-indicator {
  fill: #495057 !important;
}

.vs__dropdown-menu {
  background: #fff !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  margin-top: 2px !important;
  max-height: 200px !important;
  overflow-y: auto !important;
  z-index: 1000 !important;
}

.vs__dropdown-option {
  padding: 0.375rem 0.75rem !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease-in-out !important;
}

.vs__dropdown-option:hover {
  background-color: #f8f9fa !important;
}

.vs__dropdown-option--highlight {
  background-color: #e9ecef !important;
  color: #495057 !important;
}

.vs__dropdown-option--selected {
  background-color: #007bff !important;
  color: #fff !important;
}

.vs__search {
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: inherit !important;
  color: inherit !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  line-height: 1.2 !important;
}

.vs__search::placeholder {
  color: #6c757d !important;
  opacity: 1 !important;
}

/* Ensure vSelect matches form-control styling */
.v-select.form-control {
  padding: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Prevent any overlay from hiding selected values */
.v-select .vs__dropdown-toggle::before,
.v-select .vs__dropdown-toggle::after {
  display: none !important;
}

/* Ensure search input doesn't cover selected values */
.v-select .vs__search {
  position: relative !important;
  z-index: 1 !important;
  background: transparent !important;
}

/* Force selected options to be above search */
.v-select .vs__selected-options {
  position: relative !important;
  z-index: 2 !important;
}

/* Ensure all text elements are vertically centered */
.v-select * {
  vertical-align: middle !important;
}

.v-select .vs__dropdown-toggle,
.v-select .vs__selected-options,
.v-select .vs__search,
.v-select .vs__selected {
  vertical-align: middle !important;
}

/* Fix focus and visibility issues */
.v-select:focus-within .vs__dropdown-toggle {
  border-color: #86b7fe !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.v-select .vs__dropdown-toggle:focus {
  outline: none !important;
}

/* Ensure selected options are always visible */
.vs__selected-options .vs__selected {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

/* Fix for when vSelect loses focus */
.v-select:not(:focus-within) .vs__selected-options .vs__selected {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Force display of selected values */
.v-select .vs__selected-options {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure selected values are shown in input */
.v-select .vs__selected-options .vs__selected {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Fix for multiple select display */
.v-select[multiple] .vs__selected-options {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  width: 100% !important;
}

.v-select[multiple] .vs__selected-options .vs__selected {
  display: flex !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  flex-basis: auto !important;
}

/* Fix for mobile */
@media (max-width: 768px) {
  .vs__dropdown-toggle {
    height: 40px !important;
    padding: 0.5rem 0.75rem !important;
  }
  
  .vs__dropdown-menu {
    max-height: 150px !important;
  }
}

/* Additional fixes for vSelect display issues */
.v-select .vs__dropdown-toggle {
  overflow: visible !important;
}

.v-select .vs__selected-options {
  overflow: visible !important;
}

/* Ensure selected values persist */
.v-select .vs__selected-options .vs__selected {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Force vSelect to show selected values */
.v-select:not(.vs--open) .vs__selected-options .vs__selected,
.v-select.vs--open .vs__selected-options .vs__selected {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.btn .f-uppercase {
  display: inline-block; /* Đảm bảo nội dung nằm trên cùng một hàng */
  vertical-align: middle; /* Căn giữa theo chiều dọc với icon */
  margin: 0; /* Loại bỏ khoảng cách mặc định của div */
}

.btn i {
  vertical-align: middle; /* Căn giữa theo chiều dọc với chữ */
}

.breadcrumb-item a{
  display: inline-block;
}

.title-wrap {
  max-width: 600px;
  word-wrap: break-word;   /* Cho phép xuống dòng khi cần */
  white-space: normal;     /* Cho phép xuống dòng (mặc định) */
}

/* Custom styles for pagination */
.pagination {
  margin-bottom: 0;
  gap: 4px;
  cursor: pointer;
}

.pagination .page-link {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 4px !important;
  color: #007bff;
  background-color: #fff;
  border: 1px solid #dee2e6;
  margin: 0;
  min-width: 32px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination .page-item {
  cursor: pointer;
}

.pagination .page-item:hover .page-link {
  cursor: pointer;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
  border-radius: 4px;
}

.pagination .page-item.active .page-link {
  z-index: 3;
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.pagination .page-item.disabled .page-link {
  color: #6c757d;
  pointer-events: none;
  background-color: #fff;
  border-color: #dee2e6;
}

.pagination .page-link:hover {
  z-index: 2;
  color: #0056b3;
  text-decoration: none;
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.pagination .page-link:focus {
  z-index: 3;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

@media (max-width: 576px) {
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
  
  .pagination .page-link {
    margin: 0;
    min-width: 28px;
    height: 28px;
    padding: 0.25rem 0.5rem;
  }
}

/* List Table Styles */
.list-table .table {
  width: 100%;
}

/* Column width adjustments for all tables */
.list-table .table th:first-child,
.list-table .table td:first-child {
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
}

.list-table .table th:nth-child(2),
.list-table .table td:nth-child(2) {
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
}

.list-table .table th:nth-child(3){
  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;
}

.list-table .table tr {
  border-bottom: 1px solid var(--bs-gray-200);
}

.list-table .table td, 
.list-table .table th {
  vertical-align: middle;
  padding: 1rem !important;
}

.list-table .cover-item {
  width: auto;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
  display: block;
}

.list-table .cover-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Đảm bảo table cell có đủ không gian cho ảnh */
.list-table td {
  min-width: 130px;
  text-align: left;
  vertical-align: middle;
  padding: 10px 8px;
}

/* Căn chỉnh table header cho cột ảnh */
.list-table th {
  text-align: left;
  vertical-align: middle;
  padding: 12px 8px;
}

.list-table .title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-table .title-wrap a {
  color: var(--bs-primary);
  transition: all 0.2s;
}

.list-table .title-wrap a:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.list-table .color-palette {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Action Buttons */
.list-table .table td:last-child {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem !important;
}

.list-table .btn-sm i {
  font-size: 14px;
  flex-shrink: 0;
}

.list-table .btn-sm .f-uppercase {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-table .btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  opacity: 0.9;
}

.list-table .btn-sm:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Mobile styles */
@media (max-width: 991.98px) {
  .list-table .card-body {
    padding: 0;
    background: var(--bs-gray-100);
    overflow-x: hidden; /* Disable horizontal scroll */
  }

  .list-table .table-responsive {
    overflow-x: hidden; /* Disable horizontal scroll on table wrapper */
  }

  .list-table .table thead {
    display: none;
  }
  


  .list-table .table, 
  .list-table .table tbody, 
  .list-table .table tr {
    display: block;
    width: 100%;
    overflow-x: hidden; /* Prevent any horizontal overflow */
  }

  .list-table .table tr {
    margin: 0.75rem;
    padding: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    border: none;
  }

  .list-table .table td,
  .list-table .table th {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem !important;
    border: none;
    text-align: left;
  }
  

  

  


  .list-table .table td:nth-child(3),
  .list-table .table td:nth-child(4) {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .list-table .table td:nth-child(3) {
    padding-bottom: 0 !important;
  }

  .list-table .table td:nth-child(4) {
    padding-top: 0.5rem !important;
  }

  .list-table .cover-item {
    width: auto;
    height: 240px;
  }
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
  .list-table .cover-item {
    width: auto;
    height: 240px;
  }
  
  .list-table td {
    min-width: 110px;
    padding: 8px 5px;
  }

  .list-table .title-wrap {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
  }


  

  


  .list-table .table td:last-child {
    background: var(--bs-gray-50);
    border-radius: 0 0 12px 12px;
    padding: 0.75rem !important;
    margin-top: 0.5rem;
  }

  @media (max-width: 380px) {
    .list-table .btn-sm {
      max-width: 100%;
    }
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .list-table .table tr {
    border-color: var(--bs-gray-700);
  }

  @media (max-width: 991.98px) {
    .list-table .card-body {
      background: var(--bs-gray-900);
    }

    .list-table .table tr {
      background: var(--bs-gray-800);
    }

    .list-table .table td:last-child {
      background: var(--bs-gray-900);
    }
  }
}

/* Search List Styles */
.search-list .search-wrapper {
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-list .search-container {
  padding: 1.25rem;
}

.search-list .search-group {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
}

.search-list .search-input-group {
  flex: 1;
}

.search-list .filter-group {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.search-list .filter-group--single {
  width: auto;
}

.search-list .status-select {
  min-width: 200px;
}

/* Input styles */
.search-list .input-wrapper {
  position: relative;
}

.search-list .form-control {
  padding-right: 40px;
}

.search-list .form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Label styles */
.search-list label {
  color: #495057;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: block;
}

.search-list .invisible {
  visibility: hidden;
}

/* Voice control */
.search-list .voice-control {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.search-list .voice-control .voice-label-wrapper {
  margin: 0;
}

.search-list .voice-control .voice-icon-wrapper {
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.search-list .show-voice .voice-control .voice-icon-wrapper {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.search-list .voice-control .voice-icon-wrapper i {
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e9ecef;
  color: #495057;
  transition: all 0.2s ease;
  cursor: pointer;
}

.search-list .voice-control .voice-icon-wrapper i:hover {
  background: #0d6efd;
  color: white;
  transform: scale(1.05);
}

.search-list .voice-control .voice-icon-wrapper i.bi-mic-fill {
  background: #dc3545;
  color: white;
  animation: pulse 1.5s infinite;
}

/* Reset button */
.search-list .reset-filter {
  display: flex;
  flex-direction: column;
}

.search-list .reset-button {
  width: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-list .reset-button i {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.search-list .reset-button:hover {
  color: #0d6efd;
}

.search-list .reset-button:hover i {
  transform: rotate(180deg);
}

/* Mobile styles */
@media (max-width: 768px) {
  .search-list .search-container {
    padding: 1rem;
  }

  .search-list .search-group {
    flex-direction: column;
    gap: 1rem;
  }

  .search-list .search-input-group {
    width: 100%;
  }

  .search-list .filter-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: stretch;
  }

  .search-list .status-select {
    min-width: unset;
    width: 100%;
  }

  .search-list .filter-group--single {
    display: flex;
    justify-content: flex-end;
  }

  .search-list .filter-group--single .reset-filter {
    width: auto;
  }

  /* Đảm bảo các label và input có width như nhau */
  .search-list label {
    width: 100%;
    margin-bottom: 0.375rem;
  }

  .search-list .form-control {
    width: 100%;
  }

  /* Căn chỉnh nút reset trên mobile */
  .search-list .reset-filter {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .search-list .reset-button {
    min-height: 38px; /* Chiều cao tối thiểu bằng với form-control */
  }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .search-list .search-group {
    flex-wrap: wrap;
  }

  .search-list .search-input-group {
    width: 100%;
  }

  .search-list .filter-group {
    margin-left: auto;
  }
}

/* Header List Styles */
.header-list .card-header {
  display: flex;
  align-items: center;
  padding: 1rem;
}

.header-list .card-title {
  margin: 0;
  margin-right: auto;
}

.header-list .header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* Mobile styles */
@media (max-width: 768px) {
  .header-list .card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-list .header-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-left: 0;
    margin-top: 1rem;
  }

  .header-list .card-tools {
    width: 100%;
  }

  .header-list .input-group-sm {
    width: 100%;
  }

  .header-list .btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-list .btn i {
    margin-right: 6px;
    font-size: 15px;
  }

  .header-list .btn .f-uppercase {
    margin: 0;
    line-height: 1.2;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  .header-list .card-header {
    padding: 0.5rem 1rem;
  }

  .header-list .header-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
  }

  .header-list .card-tools {
    margin-left: 8px;
  }

  .header-list .card-tools:first-child {
    margin-left: 0;
  }
}

.main-sidebar {
  transition: width 0.3s ease-in-out;
}

.main-sidebar .nav-text {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-collapse .main-sidebar:not(:hover) .nav-text {
  opacity: 0;
  visibility: hidden;
}

.sidebar-open .main-sidebar .nav-text {
  opacity: 1 !important;
  visibility: visible !important;
}

@media (max-width: 991.98px) {
  .main-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  .sidebar-open .main-sidebar {
    transform: translateX(0);
  }

  .sidebar-open .main-sidebar .nav-text {
    opacity: 1;
    visibility: visible;
  }
}

/* Modal Fixes - Global CSS to ensure modals display correctly */

/* Force all modals to have high z-index */
.modal {
  z-index: 99999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  outline: 0 !important;
}

/* Ensure modal backdrop is properly positioned and styled */
.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 99998 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
}

.modal-backdrop.fade {
  opacity: 0 !important;
}

.modal-backdrop.show {
  opacity: 1 !important;
}

/* Modal dialog positioning */
.modal-dialog {
  position: relative !important;
  z-index: 99999 !important;
  margin: 1.75rem auto !important;
  pointer-events: auto !important;
}

.modal-dialog.modal-xl {
  max-width: 95% !important;
  width: 95% !important;
}

/* Modal content styling */
.modal-content {
  position: relative !important;
  z-index: 99999 !important;
  background-color: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Ensure modal is visible when shown and hidden when not shown */
.modal.show {
  display: block !important;
}

.modal:not(.show) {
  display: none !important;
}

.modal.show .modal-dialog {
  transform: none !important;
}

/* Modal open state */
.modal-open {
  overflow: hidden !important;
}

.modal-open .modal {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* Specific modal fixes */
#scrapeModal {
  z-index: 99999 !important;
}

#scrapeModal .modal-dialog {
  z-index: 99999 !important;
}

#scrapeModal .modal-content {
  z-index: 99999 !important;
}

/* Override any conflicting Bootstrap styles */
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out !important;
  transform: translate(0, -50px) !important;
}

.modal.show .modal-dialog {
  transform: none !important;
}

/* Responsive modal fixes */
@media (max-width: 768px) {
  .modal-dialog.modal-xl {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0.5rem !important;
  }
  
  .modal-content {
    border-radius: 0.25rem !important;
  }
}

/* Ensure no other elements interfere with modal */
body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

/* Fix for any potential stacking context issues */
.modal {
  isolation: isolate !important;
}

.modal-dialog {
  isolation: isolate !important;
}

.modal-content {
  isolation: isolate !important;
}

/* Fix row margin issues on mobile */
@media (max-width: 991.98px) {
  .content-wrapper .content {
    padding: unset !important;
  }
  .container-fluid {
    padding: unset !important;
  }
  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Ensure columns don't have negative margins on mobile */
  .row > [class*="col-"] {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}