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

body {
  font-family: 'Sarabun', sans-serif;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  color: #333;
}
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* ความสูงเต็มหน้าจอ */
}

/*--------------------- Header -------------------------*/
.section-heading {
    width:80%;
    cursor: pointer;
    background-color: rgb(207, 250, 209);
    padding: 20px 0 20px 30px;
    margin-left: 50px;
    margin-bottom: 10px;
    border-left: 6px solid rgb(207, 250, 209);
    border-radius: 6px;
    position: relative;
    user-select: none;
  }

  .section-heading h3 {
    margin: 0;
    font-size: 18px;
  }

.section-heading h3 small {
  font-size: 0.8em;
  color: #666;
  margin-left: 5px;
}

  /*---------- Breadcrumb link styles ---------*/
  .breadcrumb-container {
  margin: 10px 0 20px 16px;
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  font-size: 15px;
  padding: 0;
  margin: 20px 10px;
  gap: 8px;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-link {
  text-decoration: none;
  color: #007bff;
  border: 1px solid #dee2e6;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: #f8f9fa;
  display: inline-block;
  transition: background-color 0.2s, color 0.2s;
}

.breadcrumb-link:hover {
  background-color: #e2e6ea;
}

.breadcrumb-icon {
  font-size: 12px;
  color: #6c757d;
}

.breadcrumb-current {
  color: #6c757d;
  border: 1px solid #dee2e6;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: #f8f9fa;
  display: inline-block;
}
/*--------------------- toggle -------------------------*/
  .toggle-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.2s ease;
  }

  .collapsed .toggle-arrow {
    transform: translateY(-50%) rotate(-90deg);
  }

  .collapsible {
    display: block;
    transition: max-height 0.3s ease;
    overflow: hidden;
  }

  .collapsed + .collapsible {
    display: none;
  }
/*--------------------- Effect loading -------------------------*/
#loadingOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  display: flex; /* <--- เพิ่มไว้เลย ไม่ต้อง toggle ทุกครั้ง */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#loadingOverlay.show {
  opacity: 1;
  pointer-events: auto;
}
.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: white;
  margin-top: 15px;
  font-size: 18px;
  font-weight: bold;
}

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


/*--------------------- Layout -------------------------*/
.main-layout {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

.main-content {
    width: 100%;
    flex-grow: 1;
    padding: 0px;
    box-sizing: border-box;
    margin-left: 250px; /* ขยับเนื้อหาไปขวาเท่ากับ header */
    margin-top: 0px;
}

.content-title {
  /* background-color: #00796b;     */
  color: #fff;                   /* สีตัวอักษร */
  padding:18px 25px 20px;          /* เพิ่มพื้นที่ว่าง */
  font-size: 1.2rem;             /* ขนาดใหญ่ขึ้น */
  font-weight: bold;            /* เน้นหนัก */
  display: flex;
  align-items: center;
  margin-top: 0px;
  margin-bottom: 0px;
}


/*------------------ สไลด์ --------------------*/

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์พอดี */
  gap: 15px;
  padding: 20px 20px; /* เว้นขอบซ้าย-ขวา 20px */
}
.image-grid a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.image-grid img {
  cursor: zoom-in; /* แสดงเม้าส์เป็นแว่นขยาย */
  width: 100%;   /* ให้ภาพเต็มกรอบของ cell */
  height: auto;
  display: block;
  border-radius: 8px;
  transition: transform 0.3s ease;
}
/* เมื่อ hover ที่รูป */
.image-grid a:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.image-grid a:hover img {
  transform: scale(1); /* ซูมเล็กน้อยเฉพาะภาพ */
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  display: block;
  margin: auto;
  max-width: 95vw;    /* เดิม 90% → กว้างขึ้น */
  max-height: 90vh;   /* เดิม 80vh → สูงขึ้น */
  border-radius: 8px;
  object-fit: contain; /* กันภาพบวมหรือยืดเกิน */
}

.close, .prev, .next {
  position: absolute;
  top: 20px;
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  padding: 10px 16px 20px 16px;
  cursor: pointer;
  user-select: none;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
}

.close { right: 8%; }
.prev { left: 8%; top: 45%; transform: translateY(-50%); }
.next { right: 8%; top: 45%; transform: translateY(-50%); }


/*------------------ footer --------------------*/
.modern-footer {
  background-color: #343a40;
  color: white;
  text-align: center;
  padding: 10px 0;
  font-size: 0.9rem;
  margin-left: 250px;
  transition: margin-left 0.3s ease-in-out;
  z-index: 1;
}
.footer-content {
   max-width: 100%;
  /* text-shadow: 0 0 3px rgba(0, 123, 255, 0.35); เรืองแสงอ่อนชัดขึ้น */
}


/*------------------- ปุ่ม submit ------------------------*/
.btn-submit {
    display: block;
    width:53%;
    min-width: 400px;
    height:60px;
    margin: 30px 0px 0px 14%;
    font-size: 1.1rem;
    background-color: #2196f3;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 18px;
    font-weight: bold;
}

.btn-submit:hover {
    background-color: #1976d2;
}

/*------------------- ส่วนของคำแนะนำการกรอกข้อมูล ------------------------*/
.form-instruction {
    width: 80%;
    background-color: #f0f8ff;
    border-left: 5px solid #2196f3;
    padding: 10px 0 0px 30px;
    margin-top: 20px;
    margin-left: 50px;
    margin-bottom: 20px;
    border-radius: 6px;
    color: #333;
    font-size: 0.95em;
}

.form-instruction h3 {
    margin-top: 5px;
    margin-bottom: 0px;
    font-size: 1.1em;
    color: #0a5ea8;
}

.form-instruction li {
    margin-bottom: 6px;
}

.form-instruction ul {
    margin-top: 10px;
    padding-left: 20px;
    padding-top: 0px;
}

/* ✅ เพิ่มใหม่ทั้งหมด: ใช้จัด layout 2 คอลัมน์ในคำแนะนำ */
.form-instruction-wrapper {
  display: flex;          /* ใช้ Flexbox แบ่งเป็นสองคอลัมน์ */
  flex-wrap: wrap;        /* ให้คอลัมน์เรียงลงเมื่อจอแคบ */
  gap: 0px;              /* ระยะห่างระหว่างคอลัมน์ */
  align-items: flex-start; /* ✅ เพิ่มบรรทัดนี้ */
}

/* ✅ เพิ่มใหม่: ส่วนเนื้อหา list หลัก */
.form-instruction-main {
  flex: 1;                /* กินพื้นที่เท่ากัน */
  min-width: 280px;       /* ป้องกันเล็กเกินเมื่อจอแคบ */
}
.form-instruction-remark {
  flex: 1;
  min-width: 280px;
  line-height: 0.8em;     /* ระยะบรรทัดชัดขึ้น */
  font-weight: bold;

}

/*------------------- ฟอร์ม ------------------------*/
.form-control {
  width: 100%;              
  /* background-color: #f1bebe; */
  margin: 10px 0px 0px 50px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  line-height: 1.6;
  gap: 20px;                  /* ระยะห่างระหว่าง label กับ input */
}

.form-control p {
  width: 10%;               
  margin: 0px;
  text-align: right;
  font-weight: bold;
}

.form-control p small {
  font-size: 80%;
  color: #555; /* หรือสีเทาอ่อน */
  font-weight: normal;
}

.error-message {
    background-color: #ffe0e0;
    border-left: 5px solid #ff4d4d;
    color: #b30000;
    padding: 20px 0 20px 30px;
    border-radius: 6px;
    margin: 20px auto 20px 50px;
    font-weight: bold;
    width: 80%;
}   
.success {
    background-color: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
    border-radius: 6px;
    width: 80%;
    padding: 20px 0 20px 30px;
    margin: 20px 0 15px 50px;
    font-weight: bold;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 5px solid #dc3545;
    border-radius: 4px;
    width: 80%;
    padding: 20px 20px 20px 20px;
    margin: 20px 0 15px 50px;
    font-weight: bold;
}

.input-error {
  border: 0.5 solid red !important;
  box-shadow: 0 0 6px red;
  transition: box-shadow 0.3s ease;
}

.input-wrapper {
  flex: 1;
}

.input-month {
  display: flex;
  align-items: center;
  gap: 10px; /* ระยะห่างระหว่าง input และขีด - */
  flex-wrap: wrap; /* เผื่อจอแคบ */
}
.input-month input.txt {
  display: inline-block;
  width: auto; /* ปรับขนาดตามเนื้อหา */
  min-width: 150px; /* ป้องกันเล็กเกินไป */
}

.radio-group {
    display: flex;
    gap: 10px;
    margin: 5px 0 5px 0;
}

.radio-option {
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Student (โทนแดงอ่อน) */
.radio-option input[type="radio"][value="internship"]:checked + span {
    background-color: #ef5350;                           /* แดงอ่อน */
    color: #fff;
    border-color: #ef5350;
    box-shadow: 0 0 10px rgba(239, 83, 80, 0.5);         /* เรืองแสงแดงอ่อน */
}

/* Staff (โทนฟ้า) */
.radio-option input[type="radio"][value="research"]:checked + span {
    background-color: #1c7dc2;                           /* พื้นหลังฟ้า */
    color: #fff;
    border-color: #1c7dc2;
    box-shadow: 0 0 10px rgba(28, 125, 194, 0.6);         /* เรืองแสงฟ้า */
}

/* Guest (โทนเขียว) */
.radio-option input[type="radio"][value="register"]:checked + span {
    background-color: #16c21c;                           /* พื้นหลังเขียว */
    color: #fff;                                         /* ตัวหนังสือขาว */
    border-color: #16c21c;
    box-shadow: 0 0 10px rgba(22, 194, 28, 0.6);         /* เรืองแสงเขียว */
}

/* Plan A และ Plan B ใช้โทนฟ้าอ่อน */
.radio-option input[type="radio"][value="A"]:checked + span,
.radio-option input[type="radio"][value="B"]:checked + span {
  background-color: #6cbae7; /* ฟ้าอ่อน */
  color: #fff;
  border-color: #6cbae7;
  box-shadow: 0 0 10px rgba(94, 207, 211, 0.6); /* เงาฟ้าอ่อน */
}

/* Pending (โทนส้ม) */
.radio-option input[type="radio"][value="Pending"]:checked + span {
    background-color: #f0ad4e;
    color: #fff;
    border-color: #f0ad4e;
    box-shadow: 0 0 10px rgba(240, 173, 78, 0.5);
}

/* Approved (โทนฟ้า) */
.radio-option input[type="radio"][value="Approved"]:checked + span {
    background-color: #5bc0de;
    color: #fff;
    border-color: #5bc0de;
    box-shadow: 0 0 10px rgba(91, 192, 222, 0.6);
}

/* Accepted (โทนเขียว) */
.radio-option input[type="radio"][value="Accepted"]:checked + span {
    background-color: #5cb85c;
    color: #fff;
    border-color: #5cb85c;
    box-shadow: 0 0 10px rgba(92, 184, 92, 0.6);
}

/* Closed (โทนแดงเข้ม) */
.radio-option input[type="radio"][value="Closed"]:checked + span {
    background-color: #d9534f;
    color: #fff;
    border-color: #d9534f;
    box-shadow: 0 0 10px rgba(217, 83, 79, 0.5);
}

/* ทำให้ label ทึบ เมื่อ input ข้างในถูก disabled */
.radio-option input[type="radio"]:disabled + span {
  background-color: #e9ecef !important;
  color: #6c757d !important;
  border: 1px solid #dee2e6 !important;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1; /* ไม่จางเกินไป */
}

.radio-option span {
    display: inline-block;
    min-width: 120px;
    padding: 20px 20px;
    border: 2px solid #ccc;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    text-align: center;
    transition: all 0.3s ease;
}

.radio-option span:hover {
    border-color: #999;
}
/* กรณี uncheck → กลับเป็นปุ่มปกติ */
.radio-option span.unchecked {
  background-color: #fff !important;
  color: #333 !important;
  border-color: #ccc !important;
  box-shadow: none !important;
}

.txt {
    font-size: 1.0rem;
    font-family: 'Roboto', sans-serif;
    padding: 10px 20px 10px 20px;
    background: #F7F7F7;
    border: 1px solid #E5E5E5;
    border-radius: 5px;
    width: 60%;
}
/*------------------- ส่วน Tooltip Program model ------------------------*/

/* Tooltip ลอย หน้า view */
  .tooltip-box-floating-view {
    display: none;
    position: absolute;
    transform: translate(-105%, -50%);
    background-color: #dfffe9ff;
    color: #333;
    /* border: 1px solid #8997a3ff; */
    padding: 16px 30px;
    border-radius: 8px;
    box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    line-height: 2;
    z-index: 9999;
    width: 400px;
    overflow: hidden;
  }
/* Tooltip ลอย หน้า add */
  .tooltip-box-floating {
    display: none;
    position: absolute;
    transform: translate(21%, -68%);
    background-color: #dfffe9ff;
    color: #333;
    /* border: 1px solid #8997a3ff; */
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    line-height: 2;
    z-index: 9999;
    width: 700px;
    overflow: hidden;
  }

  .tooltip-content {
    margin-left: 10px;
    display: flex;
    flex-direction: row;
  }

  .tooltip-left,
  .tooltip-right {
    flex: 1;
    padding: 0 10px;
  }

  .tooltip-divider {
    border-left: 2px solid #746f6f1c;
    margin-left: -10px;
    margin-right: 20px;
  }

  .tooltip-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    z-index: 10000;
  }

  .tooltip-close:hover {
    color: #000;
  }

  .custom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* background-color: #2749dfff; */
    color: rgb(39, 66, 187);
    margin:auto 0;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 14px;
    cursor: pointer;
    /* border: 1px solid transparent; */
    transition: background-color 0.2s ease-in-out;
    user-select: none;
    gap: 6px;
    position: relative;
  }

    .custom-iconi-toggleTooltip {
    display: inline-block;
    background: none;
    color: #007bff;
    font-size: 15px;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 3px;
    margin-right: 3px;
    vertical-align: middle;
  }

  .arrow-indicator {
    display: none;
    margin-left: 8px;
    font-weight: bold;
  }

  .custom-btn:hover {
    color: rgb(93, 118, 233);

    /* background-color: #273ea8ff; */
  }

  .custom-btn:active {
    color: rgb(93, 118, 233);

    /* background-color: #2749dfff; */
  }
  .custom-iconi-toggleTooltip:hover {
  color: #52a1f5;
}
  .custom-iconi-toggleTooltip:active {
    color: #52a1f5;
  }


/*------------------- Badge สถานะ ------------------------*/
.badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 120px;         /* กำหนดความกว้างแน่นอน */
    height: 40px;         /* กำหนดความสูงแน่นอน */
    font-size: 0.85rem;
    border-radius: 15px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    white-space: nowrap;
    /* box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15); เงาเบา ๆ */
}

.badge-pending {
    background-color: #f0ad4e; /* ส้ม */
}

.badge-approved {
    background-color: #5bc0de; /* ฟ้า */
}

.badge-accepted {
    background-color: #5cb85c; /* เขียว */
}

.badge-closed {
    background-color: #d9534f; /* แดง */
}

  /*------------------ modal --------------------*/
  .modal-backdrop {
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 4000 !important;
    /* สูงกว่า sidebar/main-content */
  }

  .modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }

  @keyframes bounceInCenter {
    0% {
      opacity: 0;
      transform: translate(-50%, -60%);
    }

    100% {
      opacity: 1;
      transform: translate(-50%, -50%);
    }
  }

  .modal-dialog {
    opacity: 0;
    transform: translate(-50%, -60%);
    animation: none;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 4100 !important;
    /* สูงกว่า backdrop */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-backdrop.show .modal-dialog {
    opacity: 1;
    animation: bounceInCenter 0.2s ease forwards;
  }


/*---------------------- เพิ่ม responsive หรือ media query (มือถือ) -------------*/
@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
    width: 100%;
  }
  .main-content {
    width: 100%;
  }
  .sidebar-menu {
    height: auto;
    border-right: none;
  }
    .menu-container {
      padding: 10px;
  }
  .menu-list li {
      font-size: 14px;
  }
  .form-control {
    flex-direction: column;
    align-items: flex-start;
  }
  .form-control p {
    text-align: left;
    margin-bottom: 5px;
  }
  .txt, .txtarea {
    width: 100%;
  }
  .modern-footer {
  width: 100%;
  margin-left: 250px;
  padding-left: 20px;
  padding-right: 20px;
  box-shadow: none;
  }

  /*------------ รูปสไลด์ -------------*/
  .image-grid {
    grid-template-columns: 1fr;
  }
}
/*--------------------------------------------*/
