body {
  margin: 0;
  padding-top: 50px;
  background-color: var(--bg-body);
}

/* tab-bar */
.logo {
  margin: 0;
}

.logodeptabbar {
  width: 200px;
  height: auto;
}

.topbar {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background-color: var(--bg-home);
}

.indicator {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 80px;
  height: 40px;
  border-radius: 30px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.tab-container {
  position: relative;
  display: flex;
  width: fit-content;
  margin: 10px 10px 10px auto;
  gap: 25px;
  background-color: #F3E6A2;
  border-radius: 33px;
  padding: 10px 15px;
  z-index: 999;
}

.tab-link {
  font-family: 'Kodchasan', sans-serif;
  position: relative;
  z-index: 1;
  text-decoration: none;
  display: flex;
  align-items: center;
  color: #184274;
  padding: 10px 15px;
  border-radius: 30px;
  transition: all 0.4s ease;
  opacity: 0.6;
}

.tab-link .icon {
  width: 20px;
  height: 20px;
  display: block;
}

.tab-link .label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: all 0.4s ease, opacity 0.3s ease;
  font-weight: bold;
  margin-left: 0;
}

.tab-link.active {
  color: #184274;
  background-color: #78C0E6;
  opacity: 1;
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% {
    transform: scale(0.9);
  }

  50% {
    transform: scale(1.05);
  }

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



.tab-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab-link.active .label {
  display: inline-block;
  max-width: 150px;
  opacity: 1;
  margin-left: 10px;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 6px;
}

.hamburger span {
  width: 40px;
  height: 4px;
  background-color: #F3E6A2;
  border-radius: 5px;
  transition: all 0.4s ease;
}


/* footer */
.footer {
  font-family: 'K2D', sans-serif;
  margin-top: 20px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  background-color: var(--color-footer1);
  color: #F3E6A2;
  gap: 10px;
  padding: 40px;
}

.footer-logo-img {
  width: 200px;
  height: auto;
  margin: 0;
}


.footer-contact p {
  margin: 6px 0;
  line-height: 1.6;
}

.footer-address p {
  margin: 6px 0;
  line-height: 1.6;
}

.footer .social {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.footer-bottom {
  display: flex;
  color: #040518;
  background-color: #F3E6A2;
  justify-content: center;
  padding: 12px 16px;
  text-align: center;
  width: 100%;
}


@media (max-width: 768px) {
  .indicator {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hamburger span {
    background-color: #F3E6A2;
  }

  .topbar {
    position: relative;
    z-index: 3000;
  }

  #menu {
    position: absolute;
    top: 65px;
    right: 0;
    width: 150px;

    display: flex;
    flex-direction: column;
    gap: 14px;

    padding: 20px;
    border-radius: 20px;

    transition: transform .35s ease, opacity .35s ease;
  }

  #menu .tab-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #184274;
    font: 16px;
    background: transparent;
    opacity: 1;
    width: 125px;
    justify-content: flex-start;
  }

  #menu .tab-link .label {
    display: inline !important;
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    max-width: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    margin-left: 0 !important;
  }

  #menu .tab-link.active {
    width: 125px;
    color: #184274;
    background-color: #78C0E6;
    opacity: 1;
    animation: pop 0.3s ease;
  }

  .tab-container {
    position: absolute;
    top: 65px;
    height: fit-content;
    width: 150px;

    display: flex;
    flex-direction: column;
    gap: 15px;

    color: #184274;
    background-color: #F3E6A2;
    padding: 20px;
    border-radius: 20px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(120%);
    transition: transform 0.35s ease;
  }


  .tab-container.active {
    transform: translateX(0);
    right: 0px;
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* footer */
  .footer-logo {
    width: 160px;
    margin-left: 0;
  }

  .footer-row {
    flex-direction: column;
    gap: 20px;
  }

  .footer-col,
  .footer-contact,
  .footer-address {
    flex: none;
    width: 100%;
    /*ให้เต็ม*/
  }

  .footer .social {
    flex-direction: row;
    /*เรียงแนวนอน*/
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
  }

  .project-header {
    font-size: 18px;
    padding: 14px 16px;
    gap: 12px;
  }

  .project-header .proj-notop-icon {
    width: 22px;
  }
}

.choose ul {
  display: flex;
  align-items: flex-end;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.choose li {
  margin-left: 0px;
  flex: 1;
  text-align: center;
}

.choose li a {
  text-decoration: none;
  color: #002d62;
  font-weight: normal;
}

.Iot1AC {
  background-color: #78C0E6;
  border-radius: 30px 30px 0 0;
  border-right: 2px solid #161942;
  padding: 15px 10px;
  z-index: 2;
  position: relative;
  width: 40%;
}

.choose .Iot1AC a {
  color: #161942;
  font-size: 24px;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
}

.Iot2AC,
.continuousAC,
.poTopoEggAC {
  background-color: #184274;
  border-radius: 20px 20px 0 0;
  padding: 15px 30px;
  box-shadow: inset 0px 8px 15px rgba(0, 0, 0, 0.2);
  width: 20%;
}

.choose .Iot2AC a,
.choose .continuousAC a,
.choose .poTopoEggAC a {
  color: #e8ebcd;
  font-size: 18px;
}

h1 {
  background-color: var(--color-h1-bg);
  color: var(--color-h1-text);
  text-align: center;
  padding: 40px 30px;
  font-size: 60px;
  font-weight: normal;
  margin: 0px;
  transition: padding 0.4s ease, background-color 0.35s ease, color 0.35s ease;
}

้h1:hover {
  padding: 60px 30px;
}

.NameEngAC {
  font-size: 30px;
  font-weight: normal;
  height: 0;
  opacity: 0;
  display: block;
  /* ให้ขึ้นบรรทัดใหม่ */
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.8s ease;
  padding: 0px 30px;
}

h1:hover .NameEngAC {
  opacity: 1;
  height: auto;
  /* กลับมาเข้มปกติ */
  visibility: visible;
  /* ทำให้มองเห็นและโต้ตอบได้ */
  transform: translateY(0);
  /* เลื่อนกลับมาตำแหน่งเดิม */
  margin-top: 10px;
}

.explain-list {
  display: flex;
  flex-wrap: wrap;
  /* รองรับมือถือ ถ้าที่แคบจะตัดขึ้นบรรทัดใหม่ */
  justify-content: center;
  /* จัดให้อยู่กึ่งกลางหน้าจอ */
  gap: 40px;
  /* ระยะห่างระหว่างแต่ละวิชา */
  list-style: none;
  /* เอาจุดเดิมของ HTML ออก */
  padding: 0;
  margin: 30px 0;
}

.explain-list li {
  display: flex;
  align-items: center;
  /* ให้จุดกับตัวหนังสืออยู่กึ่งกลางบรรทัดเดียวกัน */
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  font-weight: normal;
}

/* สร้างจุดวงกลมจำลองด้วย ::before */
.explain-list li::before {
  content: "";
  width: 14px;
  /* ความกว้างของจุด */
  height: 14px;
  /* ความสูงของจุด */
  border-radius: 50%;
  /* ทำให้เป็นวงกลมเป๊ะ */
  margin-right: 15px;
  /* <<< ระยะห่างระหว่างจุดกับตัวหนังสือ */
  display: inline-block;
}

.ex1::before {
  background-color: #f7bd59;
}

.ex2::before {
  background-color: #83c1e3;
  /* สีฟ้าสำหรับวิชาบังคับ */
}

.ex3::before {
  background-color: #f08cb6;
  /* สีเขียวสำหรับศึกษาทั่วไป */
}

.curriculum-container {
  border: 2px solid #63a9d8;
  border-radius: 25px;
  padding: 40px 30px 30px 30px;
  position: relative;
  width: 85%;
  max-width: 1000px;
  margin: 0 auto;
  margin-top: 50px;
  background-color: var(--bg-curriculum);
}


.year-badge {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #63a9d8 0%, #3e8ebf 100%);
  color: #1a1e36;
  padding: 10px 40px;
  border-radius: 10px;
  font-size: 22px;
  font-weight: bold;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
}

.semesters-wrapper {
  margin-top: 25px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 50px;
}

.semester-box {
  border: 1px solid #B2DBF0;
  border-radius: 15px;
  padding: 20px 15px;
  width: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--bg-semester);
}

.semester-title {
  color: var(--color-text);
  font-size: 25px;
  margin-top: 0;
  margin-bottom: 20px;
  font-weight: normal;
}

.subject-list {
  display: none;
  /* ซ่อนไว้ก่อน */
  width: 100%;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.subject-item {
  display: flex;
  align-items: center;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--color-h1-text);
  font-size: 12px;
  font-weight: bold;
}

.bg-yellow {
  background-color: #f7bd59;
}

.bg-blue {
  background-color: #83c1e3;
}

.bg-pink {
  background-color: #f08cb6;
}

.dots {
  font-size: 50px;
  margin-right: 0px;
  letter-spacing: 10px;
}

.subject-info {
  font-size: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.divider {
  border: none;
  border-bottom: 1px solid var(--color-text);
  width: 90%;
  margin: 4px 0;
}


.action-btn {
  background-color: #e0e0e0;
  border: none;
  border-radius: 15px;
  padding: 8px 20px;
  color: #1a1e36;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: inset 0px -2px 5px rgba(0, 0, 0, 0.2);
}

.semesterP4 {
  align-self: center;
  color: var(--text-color);
  font-weight: normal;
}

.blue1 {
  background-color: var(--background-blue1);
  padding: 70px 30px;
  display: flex;
  border-bottom: solid #161942;
  justify-content: center;
  align-items: center;
  border-width: 10px;
}

.blue2 {
  background-color: var(--background-blue2);
  padding: 70px 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-width: 10px;
}

.book {
  width: 50px;
}

.resources {
  margin: 0 auto 20px auto;
  width: fit-content;
  flex-wrap: wrap;
  justify-content: center;
  background-color: #F3E5AB;
  display: flex;
  padding: 15px 30px;
  gap: 20px;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
}

.resources-explain {
  font-size: 20px;
  text-align: center;
}


.click-resources {
  align-self: center;
  background: linear-gradient(to bottom, #2b327b, #12153a);
  color: white;
  padding: 5px 5px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

/* คอนเทนเนอร์คุมระยะห่าง */
.table-container {
  display: none;
  padding: 0px 45px;
  justify-content: flex-end;
}

.table-container.active {
  display: block;
}

.resources.hide {
  display: none;
}

/* ตั้งค่าตัวตาราง */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-resaca1);
  /* background-color: #3D5E85; สีพื้นหลังหัวข้อ  */
  color: var(--color-resaca1);
  font-family: 'Sarabun', sans-serif;
  border: var(--outline-resaca1);
  /* border: 2px solid #5fb6df; สีกรอบนอก */
}

/* หัวตาราง */
.custom-table th {
  padding: 15px;
  border: var(--outline-resaca2);
  /* border: 1px solid #5fb6df; สีเส้นตารางหัวข้อ */
  /* เส้นขอบระหว่างเซลล์ */
  font-weight: normal;
  color: var(--color-resaca1);
  font-size: 20px;
  /* color: #e0f2fe; สีของอะไร */
}

/* เนื้อหาตาราง */
.custom-table td {
  padding: 12px 15px;
  text-align: center;
  border: var(--outline-resaca3);
  /* border: 1px solid #5fb6df; สีกรอบตาราง */
  background: var(--bg-resaca2);
  /* background-color: #040518;สีพื้นหลังเอกสาร */
  font-size: 18px;
}

/* ตกแต่งปุ่ม Download */
.btn-download {
  display: inline-block;
  text-decoration: none;
  color: var(--color-resaca1);
  border: 2px solid #5fb6df;
  padding: 4px 20px;
  background-color: var(--bg-resaca2);
  border-radius: 20px;

  font-size: 13px;
  transition: all 0.3s ease;
}

/* เอฟเฟกต์เวลาเอาเมาส์ไปชี้ปุ่ม */
.btn-download:hover {
  background-color: #F3E6A2;
  color: #1e3a8a;
}

/* เพิ่ม :not(.topbar) เข้าไป เพื่อบอกว่า ห้ามซ่อน class topbar ด้วยนะ */
body.viewing-table>*:not(.topbar):not(#target-table) {
  display: none !important;
}

/* ส่วนแสดงผลตาราง (ถ้ามีอยู่แล้วให้คงไว้ครับ) */
body.viewing-table #target-table {
  display: block !important;
  /* อาจจะเพิ่ม margin-top นิดหน่อยเผื่อไม่ให้ตารางชิด Top bar เกินไป */
  margin-top: 80px;
}

.btn-back {
  display: block;
  margin-left: auto;
  margin-right: 30px;
  margin-bottom: 20px;
  padding: 10px 20px;
  background-color: #5fb6df;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-back:hover {
  background-color: #ffffff;
  transform: translateY(-2px);
}

.lang-toggle-container {
  position: absolute;
  top: 12px;
  right: 80px;
  z-index: 10001;
  display: flex;
  gap: 4px;
  background-color: #F3E6A2;
  border-radius: 20px;
  padding: 4px;
}

.lang-btn {
  background: transparent;
  border: none;
  border-radius: 15px;
  padding: 4px 12px;
  font-size: 13px !important;
  font-weight: bold !important;
  font-family: inherit !important;
  color: #184274;
  cursor: pointer;
  transition: background 0.3s ease;
  min-width: 40px;
  text-align: center;
}

.lang-btn.active {
  background-color: #78C0E6;
  animation: pop 0.3s ease;
}

.goog-te-banner-frame,
.skiptranslate {
  display: none !important;
}

body.translated-ltr {
  top: 0 !important;
}

body {
  top: 0 !important;
}

.bch-container {

  display: flex;
  height: 120px;
  align-items: flex-end;
  overflow: hidden;
  width: 100%;
}

.bch-tab {
  display: flex;
  flex: 1;
  height: 90px;

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px 25px 0 0;

  padding: 10px;
  align-items: center;
  justify-content: center;

  color: #F3E6A2;
  font-size: 24px;
  font-family: 'K2D', sans-serif;

  background-color: #184274;
  cursor: pointer;

  /* animation */
  transform: translateY(15px);
  transition: all 0.35s ease;
}

.bch-tab[aria-selected="true"] {
  display: flex;
  flex: 2;
  padding: 20px;
  height: 100px;

  color: #040518;
  font-size: 32px;
  font-weight: 700;
  text-align: center;

  background-color: #78C0E6;

  /* animation */
  transform: translateY(0);
}

.content-about[role="tabpanel"] {
  margin: 0;
  padding: 0;
}

.content-about[role="tabpanel"]>h1 {
  margin-top: 0;
}

.content-about[role="tabpanel"] {
  margin-top: -20px;
  /*แก้ให้2,ต่อเนื่อง,เอกโทไม่เว้นกับแท็บบาร์*/
}