@import url("https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css");

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Kanit", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 {
  margin-top: 3rem;
  margin-bottom: 3rem;
  text-align: center;
  font-size: 45px;
  font-weight: bold;
}

#bmr-text {
  font-size: 35px;
}

.bmi-section {
  padding: 2rem;
  text-align: center;
}

.bmi-card {
  max-width: 500px;
  margin: 2rem auto;
  padding: 1.5rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.bingo-button {
  display: inline-block;
  padding: 1rem 2rem;
  background-color: #1c8ce4;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  margin-top: 3rem;
}

/* Typography */
.pnormal {
  font-size: 25px;
  padding-left: 16rem;
  padding-right: 16rem;
}

/* Helper Classes */
.page-padding {
  padding-left: 5%;
  padding-right: 5%;
}

/* Banner */
.banner-wrapper {
  width: 100%;
  padding: 0 5%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.banner-image {
  margin-top: 3rem;
  width: 100%;
  height: auto;
  max-width: 1200px;
  display: block;
  object-fit: contain;
}

.banner-image2 {
  margin-top: 2rem;
  width: 100%;
  height: auto;
  max-width: 800px;
  display: block;
  object-fit: contain;
}

/* Important Message */
.important-message {
  font-size: 25px;
  color: black;
  text-align: center;
  margin-left: 2rem;
  margin-right: 2rem;
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1c8ce4;
  padding: 10px 20px;
  position: relative;
}

.topic {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #64b2f0;
  padding: 10px 20px;
  position: relative;
  color: white;
  text-align: center;
}

.ndtopic {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #91bde1;
  padding: 10px 20px;
  position: relative;
  color: white;
  margin-top: -3rem;
}

/* Logo Section */
.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  background-image: url("https://img5.pic.in.th/file/secure-sv1/afc232858f422859d.png");
  background-size: contain;
  background-repeat: no-repeat;
  width: 40px;
  height: 40px;
}

.brand {
  color: white;
  margin-left: 10px;
  font-size: 20px;
  white-space: nowrap;
}

.lh3 {
  text-align: center;
  font-weight: bold;
  margin-left: 3rem;
  margin-right: 3rem;
  font-size: 25px;
}

/* Menu */
.menu {
  display: flex;
  gap: 20px;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.menu a {
  color: white;
  text-decoration: none;
  font-size: 18px;
  transition: color 0.3s ease;
}

.menu a:hover,
.menu a.active {
  color: yellow;
}

.menu-toggle {
  display: none;
  cursor: pointer;
  color: white;
  font-size: 28px;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #1c8ce4;
  flex-direction: column;
  padding: 10px 0;
  min-width: 150px;
  z-index: 10000;
  border-radius: 4px;
  cursor: default;
  margin-left: -2.5rem;
}

.dropdown-menu a {
  padding: 10px 20px;
  display: block;
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.dropdown-menu a:hover {
  background-color: #1c8ce4;
}

.dropdown .submenu {
  display: none;
}

.dropdown.active .submenu {
  display: block;
}

.dropdown:hover .submenu {
  display: block;
}

.dropdown.active .dropdown-menu {
  display: flex;
}

/* PDF */
.pdf-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 0;
  padding-bottom: 130%; /* ปรับสัดส่วนตามความสูง PDF */
  margin: 2rem auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  overflow: hidden;
  background-color: #f9f9f9;
}

.pdf-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 3rem 5%;
  margin-top: -2.5rem;
}

.small-card-grid {
  display: flex;
  justify-content: center;
  padding: 3rem 5%;
  margin-left: 4rem;
  margin-right: 4rem;
  margin-top: -2.5rem;
}

.card {
  background: white;
  padding: 0rem;
  text-align: center;
}

.card img {
  width: 100%;
  height: auto;
  border-radius: 0px;
}

.card h3 {
  margin-top: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.card a {
  color: #0056d2;
  text-decoration: underline;
}

.card p {
  text-align: left;
  margin-top: 0.5rem;
  font-size: 1.5rem;
  line-height: 1.6;
}

/* Loading Animation */
#loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: #2196f3;
  letter-spacing: 5px;
  z-index: 9999;
  background-color: white;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#loader span {
  animation: blink 1.2s infinite;
}

#loader span:nth-child(2) {
  animation-delay: 0.2s;
}

#loader span:nth-child(3) {
  animation-delay: 0.4s;
}

.contact-page section {
  background-color: #efefef;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 2rem auto;
  max-width: 800px;
  font-family: "Kanit", sans-serif;
}

.contact-page section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #1c8ce4;
  border-bottom: 2px solid #1c8ce4;
  padding-bottom: 0.5rem;
}

.contact-page section p {
  font-size: 1rem;
  margin: 0.5rem 0;
  line-height: 1.6;
}

.contact-page section strong {
  color: #000;
  font-weight: 600;
}

.contact-page section a {
  color: #1c8ce4;
  text-decoration: none;
}

.contact-page section a:hover {
  text-decoration: underline;
}

.ifooter {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: auto;

  width: 100%;
  background-color: #1c8ce4;
  z-index: 9999;
  height: 10vh;
}

.border {
  border: white solid 1px;
  margin-left: 1rem;
  margin-right: 1rem;
}

.copyright {
  color: white;
  font-size: 1.2rem;
  text-align: center;
}

.grid-layout {
  display: none; /* ซ่อนไว้ สำหรับตัวอย่างวิธีที่ 2 */
  min-height: 100vh;
  grid-template-rows: 1fr auto;
}

.slider-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 24px;
  margin-top: 3rem;
}

.slider-wrapper {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.slider-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 584px;
}

.slide {
  min-width: 100%;
  height: 100%;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.nav-button:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-50%) scale(1.1);
}

.nav-button.prev {
  left: 16px;
}

.nav-button.next {
  right: 16px;
}

.status-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10;
}

.status-auto {
  background: #10b981;
  color: white;
}

#content {
  flex: 1;
}

.status-manual {
  background: #ef4444;
  color: white;
}

.dots-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: #f9fafb;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.dot:hover {
  background: #9ca3af;
}

.dot.active {
  background: #2563eb;
  transform: scale(1.25);
}

.info-section {
  padding: 16px 24px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.description {
  margin-top: 24px;
  padding: 16px;
  background: #dbeafe;
  border-radius: 8px;
}

@keyframes blink {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.popup-content {
  width: 90vw;
  max-width: 600px;
  max-height: 80vh;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.popup-content img {
  margin-top: 1rem;
  margin-bottom: 1rem;
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff4c4c;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 10px;
  line-height: 1;
  z-index: 10;
  transition: background 0.3s ease;
}

.close-btn:hover {
  background: #e04343;
}

.dont-show-label {
  margin-top: 10px;
  align-self: flex-start;
  font-size: 16px;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  padding: 5px 10px;
  border-radius: 4px;
  user-select: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  position: static;
}

.dont-show-label input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  margin: 0;
}
/* ------------------------------------------------------------------------------------------------------------------------------------------------------ */
/* Responsive Styles */
@media (min-width: 769px) {
  #bigbanner {
    padding-left: 7rem;
    padding-right: 7rem;
    margin-bottom: -3rem;
  }
}

@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
  }

  .pnormal {
    margin-top: -1rem;
    font-size: 15px;
  }

  #bigbanner {
    padding-left: -0rem;
    padding-right: -0rem;
  }

  .card > img {
    display: flex;
    justify-content: center;
  }

  .card > p {
    font-size: 15px;
  }

  .pdf-container {
    padding-bottom: 160%; /* เพิ่มความสูงเมื่อจอแคบ */
  }

  .topic {
    font-size: 20px;
  }

  .slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 384px;
  }

  .contact-page section {
    padding: 1.5rem 1rem;
    margin: 1rem;
  }

  .contact-page section h2 {
    font-size: 1.5rem;
    text-align: center;
  }

  .contact-page section p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .contact-page section a {
    word-break: break-word;
  }

  .menu {
    flex-direction: column;
    background-color: #1976d2;
    position: absolute;
    top: 60px;
    right: 0;
    width: 100%;
    overflow: hidden;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.3s ease;
    padding: 15px 20px;
    overflow: visible;
    z-index: 999;
  }

  h1 {
    font-size: 25px;
  }

  .card h3 {
    font-size: 1.2rem;
  }

  .card > p {
    margin-bottom: 1rem;
  }

  .pnormal {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .copyright {
    margin-left: 2rem;
    margin-right: 2rem;
  }
  .menu.active {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    display: block;
  }

  .dropdown-menu {
    position: static;
    background-color: #1876d2;
    margin-left: -0rem;
  }

  .popup-content {
    max-width: 90vw;
    max-height: 90vh;
  }

  .popup-content img {
    max-height: 50vh;
  }

  .dont-show-label {
    font-size: 14px;
    padding: 4px 8px;
  }

  .close-btn {
    font-size: 20px;
    padding: 3px 8px;
  }

  .lh3 {
    font-size: 18px;
    margin-top: -2rem;
  }

  h1 {
    font-size: 22px;
  }

  #bmr-text {
    margin-top: -2rem;
    font-size: 18px;
  }
}