/* assets/css/style.css */

/* ===== Color Palette ตาม RD Design System ===== */
:root {
    --rd-primary:    #C1272D;
    --rd-secondary:  #002856;
    --rd-gray-light: #F5F5F5;
    --rd-gray:       #CCCCCC;
    --rd-text:       #333333;
    --rd-rating:     #5192E1;
  
    --font-sans:   'Kanit', sans-serif;
    --font-serif:  'TH Sarabun New', serif;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: var(--font-serif);
    color: var(--rd-text);
    background: var(--rd-gray-light);
    line-height: 1.6;
  }
  
  a {
    color: var(--rd-primary);
    text-decoration: none;
  }
  
  /* Layout elements */
  header, nav, aside, main, footer {
    display: block;
  }
  
  /* 1) Logo Area */
  header {
    background: #FFF;
    padding: 1rem;
    border-bottom: 2px solid var(--rd-secondary);
    display: flex;
    align-items: center;
  }
  
  header img {
    height: 50px;
  }
  
  /* 2) Main Menu */
  nav.main-menu {
    background: var(--rd-secondary);
    padding: 0.5rem 1rem;
  }
  
  nav.main-menu ul {
    list-style: none;
    display: flex;
    gap: 1rem;
  }
  
  nav.main-menu a {
    color: #FFF;
    font-family: var(--font-sans);
    font-weight: 600;
  }
  
  /* 3) Search */
  .search-bar {
    padding: 0.5rem 1rem;
    background: #FFF;
    border-bottom: 1px solid var(--rd-gray);
  }
  
  .search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem;
    border: 1px solid var(--rd-gray);
    border-radius: 4px;
    font-family: var(--font-sans);
  }
  
  /* 4) Breadcrumb */
  nav.breadcrumb {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    background: var(--rd-gray-light);
    font-family: var(--font-sans);
  }
  
  nav.breadcrumb a + a::before {
    content: "›";
    margin: 0 0.5rem;
  }
  
  /* 5) Side Menu */
  .layout {
    display: flex;
    flex-wrap: wrap;
  }
  
  aside.side-menu {
    flex: 0 0 200px;
    background: #FFF;
    padding: 1rem;
    border-right: 1px solid var(--rd-gray);
  }
  
  aside.side-menu ul {
    list-style: none;
    font-family: var(--font-sans);
  }
  
  aside.side-menu li + li {
    margin-top: 0.5rem;
  }
  
  /* 6) Content */
  main.content {
    flex: 1;
    padding: 1.5rem;
    background: #FFF;
  }
  
  /* 7) Footer */
  footer {
    /* background: var(--rd-secondary); */
    color: #FFF;
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-family: var(--font-sans);
  }
  
  /* Form-specific tweaks */
  .required::after {
    content: " *";
    color: var(--rd-primary);
  }
  
  .btn-check:focus + .btn,
  .btn:focus {
    box-shadow: 0 0 0 .25rem rgba(193,39,45,.25);
  }
  /* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    border-bottom: 2px solid var(--rd-secondary);
    padding: 0.5rem 1rem;
  }
  
  /* Left section: logo + title + menu toggle */
  .topbar-left {
    display: flex;
    align-items: center;
  }
  .topbar-logo img {
    height: 40px;
    margin-right: 0.5rem;
  }
  .topbar-menu-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--rd-secondary);
    cursor: pointer;
    margin-right: 1rem;
  }
  .topbar-title {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--rd-secondary);
  }
  
  /* Right section: user menu */
  .topbar-right {
    position: relative;
  }
  .topbar-user-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--rd-secondary);
    cursor: pointer;
    margin-right: 1rem;
  }
  
  /* Dropdown container */
  .topbar-dropdown {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
  }
  .topbar-dropdown > li {
    position: relative;
  }
  .topbar-dropdown > li > a,
  .topbar-dropdown > li > button {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--rd-text);
    text-decoration: none;
    background: none;
    border: none;
    font-family: var(--font-sans);
  }
  .topbar-dropdown > li:hover > .sub-menu {
    display: block;
  }
  
  /* Sub-menu */
  .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #FFFFFF;
    border: 1px solid var(--rd-gray);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1000;
  }
  .sub-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--rd-text);
    text-decoration: none;
  }
  .sub-menu li a:hover {
    background: var(--rd-gray-light);
  }
  .sub-menu .divider {
    border-top: 1px solid var(--rd-gray);
    margin: 0.5rem 0;
  }
  
  /* Adjust icon spacing */
  .topbar-dropdown i,
  .sub-menu i {
    margin-right: 0.5rem;
  }
/* แถบบนสุดสีกรมฯ */
.header-bar {
    width: 100%;
    height: 4px;
    background: var(--rd-secondary);
  }
  /* พื้นหลังหลักของ Header */
  .header-main {
    background: #FFF;
    width: 100%;
    padding-top: .5rem;
    padding-bottom: .5rem;
  }
  
  /* Logo และ Title */
  .topbar-logo img {
    height: 40px;
  }
  .topbar-title {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rd-secondary);
  }
  
  /* ปุ่มเมนู */
  .topbar-menu-btn {
    font-size: 1.5rem;
    color: var(--rd-secondary);
    background: transparent;
    border: none;
  }
    
  /* Container สำหรับปุ่ม 5 ตัว */
.rating-buttons {
  display: flex;
  justify-content: space-between;
  max-width: 300px;   /* ปรับตามต้องการ */
  margin-top: 0.5rem;
}

/* ปุ่มแต่ละตัวมีขนาดเท่ากัน ตัวเลขใหญ่ ชัด */
.rating-btn {
  flex: 1 1 auto;      /* ขยายเท่าๆ กัน */
  margin: 0 0.25rem;   /* เว้นซ้าย-ขวานิดหน่อย */
  font-size: 1.25rem;  /* ตัวเลขใหญ่ขึ้น */
  line-height: 1;      
  height: 3rem;        /* ความสูงเท่ากัน */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;          
  border-radius: 1rem; 
}

/* สไตล์ตอน hover/active */
.rating-btn:hover,
.btn-check:checked + .rating-btn {
  background-color: var(--rd-rating);
  color: #fff;
  border-color: var(--rd-rating);
}
.form-check-label {
    display: block;
  overflow-wrap: break-word;
  font-family: var(--font-serif);   /* 'TH Sarabun New', serif */
  font-weight: 300;                 /* the “light” weight you just loaded */
  font-size: 1.75rem;  /* ตัวเลขใหญ่ขึ้น */
  cursor: pointer;
}
.form-check {
  position: relative;
  padding-left: 1.75em; /* เว้นพื้นที่ให้ input */
  margin-bottom: .75rem;
}
/* ขนาดและเส้นขอบมาตรฐาน */
.form-check-input {  
  position: absolute;
  left: 1.5em;
  top: 0; 
  width: 1em;
  height: 1em;
  border: 1px solid #4187d8;
}

/* เมื่อไม่ได้เลือก (unchecked) */
.form-check-input[type="checkbox"],
.form-check-input[type="radio"] {
  background-color: #fff;
}

/* เมื่อเลือกแล้ว (checked) */
.form-check-input:checked {
  background-color: #4187d8;
  border-color: #4187d8;
}

/* โฟกัส (focus) */
.form-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 .25rem rgba(var(--rd-primary-rgb), .25);
}

/* เปลี่ยน cursor ให้เป็น pointer */
.form-check-input {
  cursor: pointer;
}

/* ไล่สีตอน hover */
.form-check-input:hover {
  border-color: darken(#4187d8, 10%);
}

/* กรณีใช้ Bootstrap’s switch หรือ custom-control อื่นๆ */
.custom-switch .form-check-input:checked {
  background-color: #4187d8;
  border-color: #4187d8;
}
.form-label {
  font-family: var(--font-serif);   /* 'TH Sarabun New', serif */
  font-weight: 700;                 /* the “light” weight you just loaded */
  font-size: 2.15rem;  /* ตัวเลขใหญ่ขึ้น */
  
}

@media (max-width: 576px) {
  .form-control.fs-3 {
    font-size: 1rem !important;
    line-height: 1.2;
  }
  .btn-lg.fs-3 {
    font-size: 1rem !important;
  }
}

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
/* ให้ UL ม้วนแนวนอนได้ถ้าจำนวน li เยอะ */
#suggestionPager {
  white-space: nowrap;
}

/* ทำให้ scrollbar เล็กลง */
#suggestionPager::-webkit-scrollbar {
  height: 6px;
}
#suggestionPager::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

/* ปุ่มปิดเป็นวงกลม สีกลมกลืนกับระบบ */
.btn-close-custom {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: var(--rd-danger, #dc3545);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  /* เงาเล็กน้อย ดูลอยขึ้น */
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);

  /* แอนิเมชันเวลาชี้ */
  transition: background-color 0.2s, transform 0.1s;
}
.btn-close-custom:hover {
  background-color: #c82333; /* หรือปรับเป็น var(--rd-danger-dark) */
  transform: scale(1.05);
}
.btn-close-custom:active {
  transform: scale(0.95);
}
.loader {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loader.hidden {
  display: none !important;
}