/* Global Font */
body {
   font-family: 'Prompt', sans-serif;
   font-size: var(--fs-body);
   overflow-x: hidden;
   overflow-wrap: break-word;
   word-wrap: break-word;
   word-break: break-word;
   max-width: 100%;
}

:root {
   --fs-display: 36px;
   --fs-heading: 24px;
   --fs-subheading: 18px;
   --fs-body: 16px;
   --fs-small: 14px;
   --fs-nav: 12px;
}

@media (min-width: 768px) {
   :root {
      --fs-display: 48px;
      --fs-heading: 32px;
      --fs-subheading: 20px;
      --fs-body: 16px;
      --fs-small: 14px;
      --fs-nav: 12px;
   }
}

@media (min-width: 1024px) {
   :root {
      --fs-display: 64px;
      --fs-heading: 40px;
      --fs-subheading: 24px;
      --fs-body: 18px;
      --fs-small: 16px;
      --fs-nav: 14px;
   }
}

.fs-display {
   font-size: var(--fs-display);
}

.fs-heading {
   font-size: var(--fs-heading);
}

.fs-subheading {
   font-size: var(--fs-subheading);
}

.fs-body {
   font-size: var(--fs-body);
}

.fs-small {
   font-size: var(--fs-small);
}

.fs-nav {
   font-size: var(--fs-nav);
}

/* Header Navigation Custom Styles */
.hd-nav-links {
   display: flex;
   gap: 2rem;
   align-items: center;
   list-style: none;
   margin: 0;
   padding: 0;
}

.hd-nav-links li {
   margin: 0;
   padding: 0;
   position: relative;
   /* For sub-menu positioning */
}

/* Sub-menu Styles */
.hd-nav-links .sub-menu {
   position: absolute;
   top: 100%;
   left: 0;
   display: flex;
   flex-direction: column;
   background: #fff;
   max-width: 240px;
   width: max-content;
   padding: 12px 0;
   margin: 0;
   list-style: none;
   box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
   border-radius: 8px;
   opacity: 0;
   visibility: hidden;
   transform: translateY(15px);
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   z-index: 1000;
   border: 1px solid rgba(0, 0, 0, 0.05);
}

.hd-nav-links li:hover>.sub-menu {
   opacity: 1;
   visibility: visible;
   transform: translateY(0);
}

.hd-nav-links .sub-menu li {
   width: 100%;
}

.hd-nav-links .sub-menu a {
   display: block;
   padding: 10px 24px;
   font-size: 14px;
   color: #444;
   text-transform: none;
   border-bottom: none !important;
   transition: all 0.2s ease;
   white-space: nowrap;
}

.hd-nav-links .sub-menu a:hover {
   background-color: #f8faff;
   color: #3b5998;
}

.hd-nav-links a {
   text-decoration: none;
   color: #333;
   transition: color 0.3s;
   font-size: var(--fs-nav);
   white-space: nowrap;
}

.hd-nav-links a:hover,
.hd-nav-links .current-menu-item>a {
   color: #3b5998;
   border-bottom: 2px solid #3b5998;
}

/* ===== Mobile Offcanvas Nav ===== */
.hd-nav-links-mobile {
   font-size: var(--fs-small);
}

.hd-nav-links-mobile li {
   margin: 0;
   padding: 0;
}

.hd-nav-links-mobile a {
   text-decoration: none;
   color: #000;
   /* เปลี่ยนสีเป็นสีดำตามรีเควสต์ */
   display: block;
   padding: 6px 0;
   border-bottom: none !important;
   /* เอาเส้นขีดใต้ออก */
   font-weight: 500;
}

.hd-nav-links-mobile .current-menu-item>a {
   color: #3b5998;
   font-weight: 600;
}

.hd-nav-links-mobile .sub-menu {
   display: block !important;
   visibility: visible !important;
   opacity: 1 !important;
   position: static !important;
   max-height: none !important;
   transform: none !important;
   box-shadow: none !important;
   padding-left: 20px !important;
   margin-top: 5px !important;
   border-left: 2px solid #e9ecef;
}

.hd-nav-links-mobile .sub-menu li a {
   font-size: 14px;
   color: #000;
   padding: 4px 0;
}

/* Hide scrollbar for mobile logos but allow scrolling */
.header-mobile .header-logos::-webkit-scrollbar {
   display: none;
}

/* Helper for Full Screen LayerSlider */
.ls-fullscreen {
   height: calc(100vh - 68px) !important;
   overflow: hidden;
}

.layerslider-mobile {
   display: none;
}

.acf-dynamic-table {
   width: 100%;
   border-collapse: collapse;
   margin-bottom: 20px;
   font-family: inherit;
}

.acf-dynamic-table th,
.acf-dynamic-table td {
   padding: 12px 15px;
   border: 1px solid #ddd;
   text-align: left;
}

.acf-dynamic-table thead tr {
   background-color: #f8f9fa;
   color: #333;
   font-weight: bold;
}

.acf-dynamic-table tbody tr:nth-child(even) {
   background-color: #fdfdfd;
}

.acf-dynamic-table tbody tr:hover {
   background-color: #f1f1f1;
}

@media (min-width: 1200px) {
   .container {
      width: 1170px;
   }
}

@media (max-width: 430px) {
   .layerslider-pc {
      display: none;
   }

   .layerslider-mobile {
      display: block;
   }
}

/* --- Abstract System Styles --- */

/* From abstract-form.php */
#afsys-abstract-form .form-label,
#afsys-fullpaper-form .form-label {
   margin-bottom: 0.5rem;
   color: #344767;
}

#afsys-abstract-form .form-control,
#afsys-abstract-form .form-select,
#afsys-fullpaper-form .form-control,
#afsys-fullpaper-form .form-select {
   padding: 0.75rem 1rem;
   border: 1px solid #d2d6da;
   border-radius: 0.5rem;
   transition: all 0.2s ease;
}

#afsys-abstract-form .form-control:focus,
#afsys-abstract-form .form-select:focus,
#afsys-fullpaper-form .form-control:focus,
#afsys-fullpaper-form .form-select:focus {
   border-color: #3584e4;
   box-shadow: 0 0 0 0.25rem rgba(53, 132, 228, 0.15);
}

#afsys-abstract-form .bg-light.p-4,
#afsys-fullpaper-form .bg-light.p-4 {
   padding: 1.5rem !important;
}

#afsys-abstract-form .mb-5,
#afsys-fullpaper-form .mb-5 {
   margin-bottom: 2rem !important;
}

/* Button Refinements */
.btn {
   transition: all 0.25s ease-in-out;
}

#afsys-abstract-form .btn-primary,
#afsys-fullpaper-form .btn-primary {
   background-color: #0d6efd;
   border-color: #0d6efd;
}

#afsys-abstract-form .btn-primary:hover,
#afsys-fullpaper-form .btn-primary:hover {
   background-color: #0b5ed7;
   border-color: #0a58ca;
   box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.note-editor .dropdown-toggle::after {
   display: none !important;
}

/* From abstract-dashboard.php */
#afsys-abstract-dashboard .table> :not(caption)>*>*,
#afsys-fullpaper-dashboard .table> :not(caption)>*>* {
   padding: 1rem 1.25rem;
}

#afsys-abstract-dashboard .fw-bold,
#afsys-fullpaper-dashboard .fw-bold {
   font-weight: 600 !important;
}

#afsys-abstract-dashboard td .text-dark,
#afsys-fullpaper-dashboard td .text-dark {
   color: #000 !important;
}

.lh-sm {
   line-height: 1.25 !important;
}

.wb-break-word {
   word-break: break-word !important;
}

/* Sticky column for horizontal-scrolling tables */
.col-sticky {
   position: sticky;
   left: 0;
   z-index: 2;
   background-color: #fff;
   box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.12);
}

thead .col-sticky {
   background-color: #f8f9fa;
   z-index: 3;
}

#afsys-abstract-dashboard .btn-primary {
   font-weight: 500;
}

.badge,
.badge-status {
   display: inline-block;
   font-size: 0.85rem !important;
   font-weight: 500 !important;
   padding: 0.5em 0.8em !important;
   border-radius: 0.35rem;
   text-decoration: none;
}

/* Status Colors (Subtle Style) */
.status-pending {
   background-color: #FEF9C3 !important;
   color: #854D0E !important;
}

.status-approved {
   background-color: #DBEAFE !important;
   color: #1E40AF !important;
}

.status-waiting {
   background-color: #F3E8FF !important;
   color: #6B21A8 !important;
}

.status-pending-review {
   background-color: #FFEDD5 !important;
   color: #9A3412 !important;
}

.status-paid {
   background-color: #DCFCE7 !important;
   color: #166534 !important;
}

.status-deny,
.status-rejected {
   background-color: #FEE2E2 !important;
   color: #991B1B !important;
}

/* --- Paper Preview Styles --- */
h5.preview-label {
   font-size: 0.9rem;
   text-transform: uppercase;
   color: #6c757d;
   margin-bottom: 0.5rem;
   border-bottom: 1px solid #eee;
   padding-bottom: 0.2rem;
   margin-top: 1.5rem;
}

.preview-value {
   font-size: 1.1rem;
   margin-bottom: 1rem;
   color: #2c3e50;
}

.preview-value.preview-title {
   font-size: var(--fs-body);
}

.preview-content-area {
   margin-top: 2rem;
   color: #2c3e50;
   line-height: 1.6;
}

.preview-list-item {
   margin-bottom: 0.3rem;
   display: block;
}

.gform_required_legend {
   display: none !important;
}