@import "./scripts/components/tom-select/tom-select.bootstrap5.css";
@import "./scripts/components/dataTables/style.css";

.ts-control{
  min-height: 39.6px;
  padding: 0.2rem 0.75rem 0 0.75rem;
}
.focus .ts-control{
  box-shadow: none;
  border-color: var(--bs-border-color);
}
.ts-wrapper.multi .ts-control > div{
  font-size: 0.75em;
  font-weight: 700;
  padding: 0 5px;
}
.ts-wrapper.plugin-remove_button:not(.rtl) .item .remove{
   font-size: 1.4em;
   font-weight: 100;
}

.ts-wrapper.plugin-remove_button:not(.rtl) .item .remove{
  border-left: none;
}


.datatable-wrapper {
    width: 100%;
    overflow: hidden;
}

.datatable-table {
    width: 100%;
    table-layout: fixed;
}

.datatable-table th,
.datatable-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.datatable-table th:last-child,
.datatable-table td:last-child {
  text-align: center;
}

.datatable-selector.form-select{
  width: 80px;
}

:root {
  --bs-body-font-family: "Be Vietnam Pro", Arial, sans-serif;

  /* Button */
  --next-bg: #7b96d4;
  --next-bg-hover: #6a84be;
  --next-bg-active: #5c73a6;
}

.bg-lb {
  background: url("images/left-bg.png") center/cover no-repeat;
}

.bg-rb {
  background: #00167a !important;
}

.btn-next {
  background-color: var(--next-bg);
  border-color: var(--next-bg);
  color: #fff;
  transition: background-color .15s, border-color .15s;
}

.btn-next:hover,
.btn-next:focus {
  background-color: var(--next-bg-hover);
  border-color: var(--next-bg-hover);
  color: #fff;
}

.btn-next:active {
  background-color: var(--next-bg-active);
  border-color: var(--next-bg-active);
  color: #fff;
}

/* Put * in select (ยังไม่ได้ใช้ในหน้านี้ แต่เก็บไว้ได้) */
.form-field {
  position: relative;
}

.form-field .req-star {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #ff6b6b;
  pointer-events: none;
}


/* Loading Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--muted);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: white;
  font-size: 1rem;
  margin-top: 1rem;
  text-align: center;
}

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

  100% {
    transform: rotate(360deg);
  }
}

.loading-text::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: loading-dots 1.2s steps(3, end) infinite;
}

@keyframes loading-dots {
  0% {
    content: '';
  }

  33% {
    content: '.';
  }

  66% {
    content: '..';
  }

  100% {
    content: '...';
  }
}

.hidden {
  display: none !important;
}

.error-message {
  color: #ff6b6b;
}


div#user-info-section.card {
  border: 0 !important;
}

.table-fit-content th:first-child,
.table-fit-content td:first-child {
  width: 1%;
  white-space: nowrap;
}

.bg-2 {
  background: url("images/bg2.jpg") center/cover no-repeat;
}

.text-piablue {
  color: #42529f !important;
}

#module-form .fs-detail {
  --bs-text-opacity: 1;
  color: rgba(255, 255, 255, .5) !important;
}

.results-table table td:first-child {
  min-width: 150px;
  vertical-align: top;
}

.results-table table {
  --bs-table-color: #000;
  --bs-table-bg: #f8f9fa;
  --bs-table-border-color: #c6c7c8;
  --bs-table-striped-bg: #ecedee;
  --bs-table-striped-color: #000;
  --bs-table-active-bg: #dfe0e1;
  --bs-table-active-color: #000;
  --bs-table-hover-bg: #e5e6e7;
  --bs-table-hover-color: #000;
  color: var(--bs-table-color);
  border-color: var(--bs-table-border-color);
}

.col-min-2 {
  flex: 0 0 auto;
  min-width: 20%;
}

.col-min-3 {
  flex: 0 0 auto;
  min-width: 25%;
}

.col-min-6 {
  flex: 0 0 auto;
  min-width: 50%;
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.ai-check-icon {
  font-size: 1.75rem;
  position: absolute;
  margin-top: -0.5rem;
  color: var(--bs-success);
  animation: fadeInScale 0.3s ease forwards;
  opacity: 1;
  transform: scale(1);
}

.logout {
  cursor: pointer;
}


/* Header Main page*/
.custom-color-header {
  background: linear-gradient(90deg, #1a1054, #4323fa);
}

/* Custom color text*/
.color-ws {
  color: #255ff1 !important;
  font-size: 22px;
  font-weight: bold;
}

.color-icon {
  color: #565b7f
}

.color-lstext {
  color: #565b7f;
  font-size: 16px;
  font-weight: bold;
}

.list-items {
  color: #565b7f;
  font-weight: bold;
  display: inline-block;
  padding: 3px 8px;
  /* ความสูงแต่ละแถว */
  border-radius: 6px;
  text-decoration: none;
}

.list-items:hover {
  color: #0000cd;
  font-weight: bold;
  background-color: var(--bs-primary-bg-subtle);
  /* ใช้สี bg-primary-subtle */
  cursor: pointer;
}

.create-btn {
  color: #565b7f;
  font-size: 12px;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  text-decoration: none;
}

.create-btn:hover {
  color: #0000cd;
  font-weight: bold;
  background-color: var(--bs-primary-bg-subtle);
  cursor: pointer;
}

.ltside-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 140px;
  /* ความกว้างเท่ากัน */
  height: 40px;
  /* <<< ความสูงเท่ากัน */
  padding: 0 10px;
  /* ตัด padding เพราะใช้ height คุมแทน */
  border: none;
  border-radius: 4px;
  color: #fff;
  background-color: #565b7f;
  font-size: 14px;
  text-decoration: none;
}

.color-rt-side {
  color: #255ff1 !important;
  font-size: 22px;
  font-weight: bold;
}

.gradient-text {
  font-size: 32px;
  font-weight: 600;
  font-style: italic;
  background: linear-gradient(90deg, #4323fa, #3C8CFF, #0097b2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.3;
  /* ป้องกัน w/y ถูกตัด */
  padding-bottom: 4px;
  /* เผื่อพื้นที่ล่าง */
}

.mainbox {
  display: block;
  color: #fff !important;
  font-size: large;
  background-color: #004aad;
  border-radius: 6px;
  border: transparent;
  width: 100%;
}

.min-vh100-68 {
  min-height: calc(100vh - 68px);
}

#form-medical, #medical-form {
  display: none;
  opacity: 0;
  transition: opacity 0.5s 0.5s;
}

#form-medical.show,#medical-form.show {
  display: block;
  opacity: 1;
}

.min-width-50 {
  min-width: 50px;
}

.user-role {
  color: var(--bs-danger-border-subtle);
  font-size: 0.7rem;
}


.isrtableIntro th:first-child,
.isrtableIntro td:first-child {
  width: 20%;
  word-wrap: normal;
  white-space: normal;
}

.isrtable th,
.isrtable td {
  width: 33.33%;
}


.isrtable th:first-child,
.isrtable td:first-child {
  width: 33.33%;
  word-wrap: normal;
  white-space: normal;
}


/* Responsive adjustments for larger screens if needed */
@media (max-width: 768px) {

  .isrtable {
    width: 100%;
    border-collapse: collapse;
  }

  .isrtable thead {
    display: none;
  }

  .isrtable tbody tr {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .isrtable tbody tr td:nth-child(1) {
    order: 1;
    width: 50%;
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0.5rem;
  }

  .isrtable tbody tr td:nth-child(2) {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0.5rem;
  }

  .isrtable tbody tr td:nth-child(2)::before {
    content: '- ';
  }

  .isrtable tbody tr td:nth-child(3) {
    order: 2;
    width: 50%;
    flex: 0 0 50%;
    max-width: 50%;
    text-align: right;
    padding: 0.5rem;
  }

}

.sp-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--bs-link-color);
  text-decoration: underline;
  text-align: left;
  cursor: pointer;
  font-size: inherit;
}

.sp-link:hover {
  color: var(--bs-link-hover-color);
}

.table-fixed-3 th,
.table-fixed-3 td {
  width: 33.33%;
}

.tb-center-last td:last-child {
  text-align: center;
}

.tb-left-last td:last-child {
  text-align: left;
}

.text-bg-danger-2 {
  color: #fff !;
  background-color: #CD5C5C;
}

.form-select:focus,.form-control:focus {
  border-color: var(--bs-border-color);
  box-shadow: none;
}

/*--- Ai button---*/
.ai-btn {
  position: relative;
  padding: 3px 5px;
  border: none;
  background: transparent;
  cursor: default;
  font-size: 14px;
  z-index: 0;

  display: inline-flex;
  /* ⭐ สำคัญ */
  align-items: center;
  /* จัดแนวกลาง */
  gap: 4px;
  /* ระยะ icon ↔ text */
}

.ai-btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  /* ความหนาของขอบ */
  /*background: linear-gradient(135deg, #5500ff, #9900ff, #00c6ff);*/
  border-radius: 4px;
  z-index: -2;
}

.ai-btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  /* ความหนาขอบ */
  background: transparent;
  border-radius: 4px;
  /* 10px - 2px */
  z-index: -1;
}

.ai-btn__icon {
  position: static;
  font-size: 14px;
  color: #6a00ff;
  /* หรือ gradient จะบอกต่อด้านล่าง */
  pointer-events: none;
  /* กันคลิกโดน icon */
}

.ai-btn:hover {
  background: linear-gradient(135deg,
      rgba(85, 0, 255, 0.18),
      rgba(153, 0, 255, 0.18),
      rgba(0, 198, 255, 0.18));
  border-radius: 4px;
}

/*Language Switcher v.1*/
.Lan-Swit {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  color: #fff;
  position: relative;
  padding: 4px 6px;
  background: transparent;
  cursor: default;
  font-size: 15px;
  border: none;
  outline: none;
  box-shadow: none;
}

#flag-us {
  height: 15px;
  width: 25px;
  position: relative;
  background: repeating-linear-gradient(to bottom,
      #B22234 0%,
      #B22234 calc(100% / 12),
      #fff calc(100% / 12),
      #fff calc(200% / 12));
  border: 1px solid #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

#flag-us .canton {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: calc(7 * 100% / 13);
  background: #3C3B6E;
}

#flag-th {
  height: 15px;
  width: 25px;
  background: linear-gradient(to bottom,
      #A51931 0 calc(100% / 6),
      #fff calc(100% / 6) calc(100% / 3),
      #2D2A4A calc(100% / 3) calc(100% / 1.5),
      #fff calc(100% / 1.5) calc(125% / 1.5),
      #A51931 calc(125% / 1.5) 100%);
  border: 1px solid #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

#flag-cn {
  position: relative;
  width: 25px;
  height: 15px;
  background: #DE2910;
  border: 1px solid #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

/* big star */
#flag-cn::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 3px;
  width: 6px;
  height: 6px;
  background: #FFDE00;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

/* small stars */
#flag-cn .star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #FFDE00;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

#flag-cn .s1 { top: 2px; left: 11px; transform: rotate(20deg); }
#flag-cn .s2 { top: 5px; left: 13px; transform: rotate(40deg); }
#flag-cn .s3 { top: 8px; left: 13px; transform: rotate(20deg); }
#flag-cn .s4 { top: 10px; left: 11px; transform: rotate(0deg); }

input.hidden {
  display: block !important;
  opacity: 0; 
  position: absolute; 
  z-index: -999
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .two-col {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col .full {
    grid-column: span 2;
  }

  .two-col .left-only {
    grid-column: 1 / 2;
  }
}

date-picker .picker {
  max-width: 325px; 
  position: absolute; 
  background: white; 
  z-index: 1;
}

.table-fixed{
  table-layout: fixed;
}

#summery-result{
  line-height: 1.8;
}

.dropdown-menu.scroll {
  max-height: 90vh;
  overflow-y: auto;
}

#summery-result > * {
  display: block;
  opacity: 0;
  animation: fadeIn 0.6s forwards;
  animation-delay: calc(var(--delay) * 0.3s);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  to {
    transform: translateY(0);
    opacity: 1;
  }
} 

/* 
#summery-result {
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid black;
  animation: typing 4s steps(35) forwards, blink 0.8s infinite;
} */

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

.tag-arrow-icon{
  position: absolute;
  right: 0.8rem;
}

.dropdown-toggle::after {
    margin-left: .255em;
    content: "\f282";
    font-family: bootstrap-icons !important;
    border: none;
    vertical-align: bottom;
}

.dropdown-menu li{
  cursor: pointer;
}

.form-floating > .form-control {
  height: 38px;
  min-height: 38px;
  padding: 0.375rem 0.75rem;
}

.form-floating > label {
  padding: 0.375rem 0.75rem;
}
.form-floating>.form-control:not(:placeholder-shown){
  padding: 0.375rem 0.75rem;
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  transform: scale(.85) translateY(-1.2rem) translateX(0.15rem);
}

.form-control.disabled {
    background-color: var(--bs-secondary-bg);
    opacity: 1;
}


h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.2rem;
}

h4 {
  font-size: 1.125rem;
}