@import url("https://fonts.googleapis.com/css2?family=Kanit&display=swap");

* {
  box-sizing: border-box;
}

body {
  font-family: "Kanit", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f7f9fb;
  padding-top: 100px; /* compensate for fixed header */
}

header,
.main-header {
  background-color: white;
  padding: 20px 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  font-family: "Kanit", sans-serif;
  display: flex;
  align-items: center;
  height: 80px;
  position: fixed; /* changed from relative */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  margin-bottom: 0; /* removed space caused by margin */
  justify-content: center;
}

/* header {
  background-color: #8faee0;
  padding: auto 20px;
  text-align: center;
} */

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

nav a {
  color: white;
  font-weight: bold;
  text-decoration: none;
  padding: 10px 15px;
}

nav a:hover,
.mobile-nav a:hover {
  color: #3c65a1;
  transition: color 0.3s ease;
}

/* Match normal nav links */
/* Match normal nav links */
.desktop-nav a,
.dropbtn {
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  color: #3c65a1;
  padding: 10px 15px;
  font-size: 18px;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s ease;
}

/* Hover effect for all links */
.desktop-nav a:hover,
.dropbtn:hover {
  background-color: #3c65a1;
  color: white;
  border-radius: 8px;
}

/* Remove default link underline and button styles */
.dropbtn {
  background: none;
  border: none;
}

/* Dropdown container */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown menu */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #ffffff;
  min-width: 180px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
  z-index: 999;
  border-radius: 8px;
  overflow: hidden;
  top: 100%;
  left: 0;
}

/* Dropdown links */
.dropdown-content a {
  color: #3c65a1;
  padding: 10px 15px;
  text-decoration: none;
  display: block;
  font-weight: 500;
}

.dropdown-content a:hover {
  background-color: #e6edff;
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
  display: block;
}

/* Dropdown icon style */
.dropdown-icon {
  font-size: 0.75em;
  margin-left: 5px;
  transition: transform 0.2s ease;
}

/* Optional: Rotate icon on hover */
.dropdown:hover .dropdown-icon {
  transform: rotate(180deg);
}

/* Container and layout */
.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 20px;
  max-width: 1400px;
  margin: auto;
  gap: 20px;
}

.main-content,
.sidebar {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
}

@media (min-width: 768px) {
  .main-content {
    flex: 6;
    width: auto;
  }
  .sidebar {
    flex: 4;
    width: auto;
  }
}

/* Headings */
h1,
h2,
h3 {
  color: #3c65a1;
}

h1,
h2 {
  border-bottom: 2px solid #3c65a1;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* Banner */
.banner-container {
  text-align: center;
  margin-bottom: 15px;
}

.banner-container img,
.sidebar img {
  max-width: 100%;
  border-radius: 12px;
}

ul {
  padding-left: 20px;
}

/* Boxes */
.box,
.aicf {
  background-color: #f0f4ff;
  border-radius: 20px;
  padding: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: 10px 0;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.aicf {
  background-color: #f0f4ff;
  border-radius: 20px;
  padding: 2px 15px; /* Reduced vertical padding from 15px to 8px */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: 10px 0;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  width: 100%;
  display: block;
  box-sizing: border-box;
}

.aicf:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.aicf:active {
  transform: scale(0.98);
}

.aicf a {
  display: block;
  color: #3c65a1;
  text-decoration: none;
  width: 100%;
}

.box a,
.aicf a {
  text-decoration: none;
  color: #3c65a1;
}

.box:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.box:active {
  transform: scale(0.98);
}

/* Flex rows */
.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.flex-row .box {
  flex: 1 1 calc(50% - 10px);
  min-width: 150px;
}

@media (min-width: 768px) {
  .flex-row .box {
    flex: 1 1 calc(25% - 10px);
  }
}

/* Hamburger & mobile nav */
.hamburger {
  font-size: 28px;
  color: #3c65a1;
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2000;
  transition: transform 0.3s ease;
  display: none;
  padding: 8px 12px;
}

.hamburger:focus {
  outline: 2px solid #3c65a1;
  outline-offset: 2px;
}

.hamburger div {
  width: 24px;
  height: 3px;
  background-color: #2a4a8c;
  border-radius: 2px;
  margin-bottom: 5px;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: -260px;
  width: 240px;
  height: 100vh;
  background-color: #fff;
  padding: 120px 20px 20px 20px;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  display: none;
}

.mobile-nav.show {
  left: 0;
  display: flex;
}

/* Mobile nav links */
.mobile-nav a,
.mobile-nav summary {
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  color: #3c65a1;
  text-align: left;
  padding: 12px 16px;
  margin: 0;
  font-size: 18px;
  text-decoration: none;
  display: block;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

/* Hover effect */
.mobile-nav a:hover,
.mobile-nav summary:hover {
  background-color: #3c65a1;
  color: white;
}

/* Remove default summary triangle */
.mobile-nav summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Dropdown icon */
.mobile-nav .dropdown-icon {
  font-size: 0.75em;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

/* Rotate icon when open */
.mobile-nav details[open] .dropdown-icon {
  transform: rotate(180deg);
}

.mobile-nav details a {
  padding: 10px 16px;
  font-weight: 500;
  font-size: 16px;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3c65a1;
  text-decoration: none;
}

/* Icon pointing right in front of the text */
.mobile-nav details a::before {
  content: "➤";
  font-size: 14px;
  color: #3c65a1;
  margin-right: 6px;
}

/* Optional spacing between dropdown and other links */
.mobile-nav details {
  margin: 0; /* Prevent default margin */
  padding: 0; /* Optional: remove padding */
}
.mobile-nav details summary::before {
  content: "▼"; /* Use any icon or Unicode character */
  font-size: 0.75em;
  margin-right: 8px;
  transition: transform 0.3s;
  display: inline-block;
}
.mobile-nav details[open] summary::before {
  transform: rotate(-180deg);
}
.mobile-nav details summary::after {
  content: none; /* Remove the icon at the end */
}

/* Rotate arrow when open */
.desktop-nav details[open] summary::after,
.mobile-nav details[open] summary::after {
  transform: rotate(-180deg); /* Optional: rotate when open */
}

/* Overlay for mobile nav */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1400;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Desktop nav */
.desktop-nav {
  display: flex;
  justify-content: center; /* center the nav items */
  gap: 20px;
  margin: 0 auto;
  width: 100%;
}

.desktop-nav a {
  color: #3c65a1;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 15px;
  font-size: 18px;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus {
  background-color: #3c65a1;
  color: white;
  outline: none;
}

/* Responsive */
@media (max-width: 767px) {
  nav,
  .desktop-nav {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .mobile-nav {
    display: flex !important;
  }
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none !important;
  }
  .hamburger {
    display: none;
  }
}

/* Book */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.styled-table thead tr {
  background-color: #e7efff;
  color: #3c65a1;
  text-align: left;
}

.styled-table th,
.styled-table td {
  padding: 12px 15px;
  border: 1px solid #d0d7e3;
}

.styled-table tbody tr {
  background-color: #ffffff;
  transition: background-color 0.2s ease;
}

.styled-table tbody tr:nth-child(even) {
  background-color: #f9fbff;
}

.styled-table tbody tr:hover {
  background-color: #dfeeff;
}

.table-container {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: 12px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 20% auto;
  padding: 20px;
  border-radius: 12px;
  width: 80%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-content p {
  font-size: 18px;
  margin-bottom: 20px;
  color: #3c65a1;
}

.modal-content button {
  background-color: #3c65a1;
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.modal-content button:hover {
  background-color: #2a4d7a;
}

@media (max-width: 767px) {
  body {
    animation: fadeIn 0.6s ease-in;
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

.modal-content {
  animation: bounceIn 0.5s ease;
}

.main-footer {
  background-color: #f2f2f2; /* same as header background */
  padding: 1rem;
  text-align: center;
  font-family: "Kanit", sans-serif;
  color: #333;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
  margin-top: 2rem;
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-content {
  background-color: white;
  padding: 20px 15px;
  text-align: center;
  border-radius: 12px;
  animation: bounceIn 0.6s;
  max-width: 90%;
  width: 500px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.popup-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 25px; /* increased space below image */
}

@keyframes bounceIn {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
    opacity: 1;
  }
  80% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

#closePopupBtn {
  padding: 10px 25px;
  background-color: #0052cc; /* Matches the deep blue used in ec67103secb.html */
  color: white;
  border: none;
  border-radius: 8px;
  font-family: "Kanit", sans-serif;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  max-width: 140px;
  margin: 0 auto;
  margin-top: 10px;
  display: block;
  transition: background-color 0.3s ease;
}

#closePopupBtn:hover {
  background-color: #003d99;
}

.iframe-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio (9 / 16 = 0.5625) */
  overflow: hidden;
  border-radius: 12px; /* optional */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* optional */
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  font-family: "Kanit", sans-serif;
}
.modal-content input {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  margin-top: 10px;
  margin-bottom: 20px;
  border-radius: 6px;
  border: 1px solid #ccc;
}
.modal-content .modal-buttons button {
  background-color: #3c65a1;
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 8px;
  font-size: 16px;
  font-family: "Kanit", sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}
.modal-content .modal-buttons button:hover {
  background-color: #2a4d7a;
  transform: translateY(-1px);
}
