/* --- นำเข้าฟอนต์ TH Sarabun PSK --- */

/* สำหรับฟอนต์ตัวปกติ (Regular) */
@font-face {
  font-family: 'TH Sarabun PSK';
  src: url('../fonts/sarabun/Sarabun-Regular.woff2') format('woff2');
  font-weight: 400; /* หรือ normal */
  font-style: normal;
  font-display: swap;
}

/* สำหรับฟอนต์ตัวหนา (Bold) */
@font-face {
  font-family: 'TH Sarabun PSK';
  src: url('../fonts/sarabun/Sarabun-Bold.woff2') format('woff2');
  font-weight: 700; /* หรือ bold */
  font-style: normal;
  font-display: swap;
}

/* กำหนดให้ทั้งหน้าเว็บใช้ฟอนต์ TH Sarabun PSK */
body {
  font-family: 'TH Sarabun PSK', sans-serif;
}

/* หรือกำหนดเฉพาะบาง class */
h1, h2, .thai-text {
  font-family: 'TH Sarabun PSK', sans-serif;
}

/* การเรียกใช้ตัวหนา */
strong, b {
  font-weight: 700; /* หรือ bold */
}

/* Dark Mode Style for API Response Box */
#responseOutput {
    background-color: #212529; /* สีพื้นหลังเกือบดำ */
    color: #e9ecef;            /* สีตัวอักษรอ่อนๆ เกือบขาว */
    border: 1px solid #495057; /* สีเส้นขอบเทาเข้ม */
    white-space: pre-wrap;     /* ทำให้ข้อความยาวๆ ขึ้นบรรทัดใหม่ได้ */
    word-break: break-all;     /* ทำให้คำยาวๆ ที่ไม่มีเว้นวรรคตัดคำได้ */
}




/* กำหนด Layout และขนาดคอลัมน์ (ปรับตัวเลขตามต้องการ) */
.custom-datatable {
    table-layout: fixed;
    width: 100% !important;
}

.custom-datatable th:nth-child(1),
.custom-datatable td:nth-child(1) {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
}

.custom-datatable th:nth-child(2),
.custom-datatable td:nth-child(2) {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    text-align: center;
}

.custom-datatable th:nth-child(3),
.custom-datatable td:nth-child(3) {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    text-align: center;
}

.custom-datatable th:nth-child(4),
.custom-datatable td:nth-child(4) {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    text-align: center;
}

.custom-datatable th:nth-child(5),
.custom-datatable td:nth-child(5) {
    width: auto !important;
    min-width: 200px !important;
}

/* การจัดการการตัดคำ */
.custom-datatable td:nth-child(5) {
    white-space: normal;
    word-wrap: break-word;
}

/* ปรับขนาดปุ่มในตาราง */
.custom-datatable .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

/*
 * ===============================================
 * DataTable Sorting & Interaction
 * ===============================================
 */

/* ซ่อนไอคอนการเรียงลำดับสำหรับคอลัมน์ที่ไม่สามารถเรียงได้ */
.custom-datatable th.sorting_disabled {
    cursor: default !important;
}

.custom-datatable th.sorting_disabled:after,
.custom-datatable th.sorting_disabled:before {
    display: none !important;
}

/* เน้นคอลัมน์ที่สามารถเรียงลำดับได้ */
.custom-datatable th.sorting:hover,
.custom-datatable th.sorting_asc:hover,
.custom-datatable th.sorting_desc:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/*
 * ===============================================
 * DataTable Borders & Appearance
 * (สไตล์ขอบมนและเส้นตาราง)
 * ===============================================
 */

.custom-datatable {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    font-family: 'TH Sarabun PSK', sans-serif;
    margin-bottom: 0;
}

/* Header */
.custom-datatable thead th {
    border: none;
    border-bottom: 1px solid #dee2e6 !important;
    background-color: #f8f9fa;
    padding: 12px 8px;
}

.custom-datatable thead th:first-child {
    border-top-left-radius: 12px;
}

.custom-datatable thead th:last-child {
    border-top-right-radius: 12px;
}

/* Body */
.custom-datatable tbody tr {
    border: none;
    background-color: #ffffff;
}

.custom-datatable tbody td {
    border: none;
    padding: 12px 8px;
    vertical-align: middle;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.custom-datatable tbody tr:hover {
    background-color: #f8f9fa !important;
}

/* แถวสุดท้าย (สำหรับขอบมนด้านล่าง) */
.custom-datatable tbody tr:last-child td {
    border-bottom: none !important;
}

.custom-datatable tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.custom-datatable tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/*
 * ===============================================
 * Bootstrap Overrides (สำหรับ DataTables)
 * ===============================================
 */

/* แก้ปัญหา border ซ้อนของ Bootstrap 5 */
.custom-datatable.table > :not(caption) > * > * {
    border-width: 0 !important;
}

/* ทำให้ .table-striped ใช้พื้นหลังสีขาวของเรา */
.custom-datatable.table-striped > tbody > tr > td,
.custom-datatable.table-striped > tbody > tr > th {
    background-color: #ffffff;
}

.custom-datatable.table > thead > tr > th {
    border-bottom: 1px solid #dee2e6 !important;
}

.custom-datatable.table > tbody > tr > td {
    border-top: none !important;
}


.page-sidebar {
  margin-top: 66px;
}

.resource-card {
  transition: transform 0.2s;
  border: none;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
}
.resource-card:hover {
  transform: translateY(-5px);
}
.list-group-item {
  border: none;
  padding: 12px 15px;
  transition: background-color 0.2s;
}
.list-group-item:hover {
  background-color: #f8f9fa;
}
.list-group-item a {
  color: #333;
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}
.list-group-item a:hover {
  color: #0d6efd;
}
.card-header {
  background-color: transparent;
  border-bottom: 2px solid #f0f0f0;
}
.breadcrumb {
  background: transparent;
  padding: 0.5rem 0;
}

  /*
  * Custom Style for Close Button
  */
.btn-close-custom {
/* โค้ด CSS เดิมของคุณ */
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #f0f0f0;
background-size: 11px;
opacity: 0.8;
transition: all 0.2s ease;

/* เพิ่ม margin-top เพื่อเลื่อนลง */
/* margin-top: 5px; */
margin-top: 5px; /* ปรับค่าตามต้องการ */
}

.btn-close-custom:hover {
/* โค้ด CSS เดิมของคุณ */
background-color: #e0e0e0;
opacity: 1;
transform: scale(1.1);
}

.fullscreen-btn-spacing {
  margin-right: 50px;
}

/* ลบเงาตอน focus เพื่อความสวยงาม */
.btn-close-custom:focus {
  box-shadow: none;
}

.modal-header .btn-close {
  top: 24px; /* ปรับตำแหน่งแนวตั้ง */
}

  /*
 * คลาสใหม่สำหรับสร้างปุ่มวงกลมที่มีไอคอนอยู่ข้างใน
 */
.btn-circle-icon {
  /* 1. กำหนดขนาดและทำให้เป็นวงกลม */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f0f0f0;

  /* 2. ลบสไตล์พื้นฐานของปุ่มที่อาจรบกวน */
  border: none;
  padding: 0;

  /* 3. ใช้ Flexbox เพื่อจัดไอคอนให้อยู่ตรงกลางเป๊ะ */
  display: inline-flex;
  justify-content: center; /* จัดกลางแนวนอน */
  align-items: center;    /* จัดกลางแนวตั้ง */

  /* 4. กำหนดสีไอคอนและเอฟเฟกต์ */
  color: #6c757d; /* สีเทา (เหมือน text-secondary) */
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ปรับขนาดไอคอน Font Awesome ให้พอดี */
.btn-circle-icon .fas {
  font-size: 15px;
  line-height: 1; /* ช่วยให้ไอคอนอยู่ตรงกลางแนวตั้งได้ดีขึ้น */
}

/* 5. เอฟเฟกต์เมื่อนำเมาส์ไปวาง (Hover) */
.btn-circle-icon:hover {
  background-color: #e0e0e0;
  color: #212529; /* ทำให้ไอคอนสีเข้มขึ้น */
  transform: scale(1.1);
}

.sidebar-menu .sidebar-list .sidebar-link {
  border-radius: 0px;
}

.footer {
  padding: 24px 15px;
}

@media (max-width: 1199px) {
  .page-header .logo-wrapper {
    background-color: var(--theme-default);
  }

  .page-header .logo-wrapper .close-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 38px;
      border-radius: 50%;
      height: 38px;
      background-color: rgba(249, 247, 246, 0.2392156863);
      transition: 0.3s all;
      color: #ffffff;
  }

  .page-header .logo-wrapper .close-btn .svg-color {
      stroke: #ffffff;
  }

  .page-header .logo-wrapper .close-btn:hover {
      background-color: var(--body-color);
  }

}

@media (max-width: 767.98px) {
  .page-header .logo-wrapper {
    padding: 14px 4px 14px 14px;
  }
  footer .row p {
    text-align: left;
  }
}

