body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
}

/* Header พร้อมพื้นหลัง */
header {
  background: url('assets/images/header-cover.png') center top no-repeat;
  background-size: cover;
  height: 480px;
  position: relative;
  overflow: hidden;
}

/* โลโก้กลางลอยเด้ง */
.floating-logo-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 480px;
  z-index: 2;
  animation: float 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-12px); }
}

/* เมนูลอยใต้ header */
.floating-nav {
  background: #fff;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.8rem 1.2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  top: -20px;
  z-index: 3;
  border-radius: 8px;
  width: fit-content;
  margin: 0 auto;
}

.floating-nav a {
  color: #2c3e50;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s ease;
}

.floating-nav a:hover {
  color: #e67e22;
}

/* เนื้อหา */
main {
  padding: 0.5rem 1rem 2rem 1rem;
}

main h2 {
  margin: 0.5rem 1rem 2rem 1rem;
  text-align: center;
  font-size: 2.5rem;
  color: #2c3e50;
  position: relative;
  padding-bottom: 0.5rem;
  font-weight: bold;
}

main h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #e67e22, #f1c40f);
  border-radius: 3px;
}

/* เพิ่มเอฟเฟกต์เมื่อโฮเวอร์ */
main h2:hover {
  color: #e67e22;
  transition: color 0.3s ease;
}

main h2:hover::after {
  width: 120px;
  transition: all 0.3s ease;
}

main p {
  font-size: 1rem;
  color: #333;
}

/* ตาราง */
table {
  width: 80%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: white;
  margin-left: auto;
  margin-right: auto;
  float: left;
}

th,
td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  text-align: center;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #2c3e50, #1a1a2e);
  color: #fff;
  padding: 2rem 1rem;
  font-family: 'Segoe UI', Arial, sans-serif;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

footer p {
  margin: 0;
  line-height: 1.6;
  font-size: 12px; /* Changed from 0.9rem to 8px */
  opacity: 0.8;
}

.footer-links {
  margin-top: 1rem;
}

.footer-links a {
  color: #a0c4ff;
  text-decoration: none;
  margin: 0 0.5rem;
  font-size: 8px; /* Changed from 0.85rem to 8px */
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.chat-support-button {
  position: fixed;
  bottom: -20px;
  right: 20px;
  z-index: 999;
  animation: floatButton 3s ease-in-out infinite;
}

.chat-support-button img {
  height: 200px;
  width: auto;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.chat-support-button:hover img {
  transform: scale(1.05);
}

@keyframes floatButton {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Vertical Image Menu - Top Right */
.vertical-image-menu {
  position: fixed;
  right: 20px;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 10;
}

.vertical-image-menu a {
  display: block;
  width: 180px;
  height: 55px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vertical-image-menu a:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.vertical-image-menu img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ซากุระโปรย */
.sakura-petal {
  position: absolute;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffb6c1"><path d="M12 2C13.1 2 14 2.9 14 4s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm8 7h-5v12c0 .55-.45 1-1 1s-1-.45-1-1v-5h-2v5c0 .55-.45 1-1 1s-1-.45-1-1V9H4c-.55 0-1-.45-1-1s.45-1 1-1h16c.55 0 1 .45 1 1s-.45 1-1 1z"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  width: 20px;
  height: 20px;
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
  animation: falling linear infinite;
}

@keyframes falling {
  0% {
    transform: translate(0, -10px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  100% {
    transform: translate(var(--end-x), var(--end-y)) rotate(360deg);
    opacity: 0;
  }
}

/* Facebook Share Button */
.fb-share-button {
  position: fixed;
  bottom: 150px;
  right: 70px;
  z-index: 999;
  background: #3b5998;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.fb-share-button:hover {
  background: #2d4373;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.fb-share-button iframe {
  margin: 0 !important;
}

/* Content Image */
.content-image {
  margin: 2rem auto;
  text-align: center;
  max-width: 800px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.content-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.content-image:hover img {
  transform: scale(1.02);
}

/* Text box with background */
.text-box {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin: 1rem auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
  max-width: 1400px;
  width: 90%;
  text-align: left;
  font-family: Arial, sans-serif;
  font-size: 14px;
  column-count: 1; /* Number of columns */
  column-gap: 2rem; /* Space between columns */
  column-rule: 1px solid rgba(0, 0, 0, 0.1); /* Line between columns */
}

.text-box p {
  margin: 0 0 1rem 0; /* Add space between paragraphs */
  color: #2c3e50;
  font-weight: 500;
  font-size: 14px;
  break-inside: avoid; /* Prevent paragraphs from breaking across columns */
  page-break-inside: avoid; /* For older browsers */
}

/* เพิ่มหรือแก้ไขใน style.css */
.class-table-container {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  margin-left: 0;
  padding-left: 0;
}

.class-table {
  border: none;
  border-collapse: collapse;
  background-color: transparent;
  width: auto; /* เปลี่ยนจาก 50% เป็น auto */
  margin-left: 0; /* กำหนดให้ชิดซ้ายสุด */
  margin-right: auto;
  background: transparent !important;
}

.class-table th,
.class-table td {
  background-color: transparent !important;
  border: none !important;
  padding: 0.5rem 1rem; /* ปรับ padding ให้เหมาะสม */
  text-align: left; /* จัดข้อความชิดซ้าย */
}

.class-table img {
  background: transparent !important;
  display: block;
  margin: 0 auto;
  transition: all 0.3s ease;
  filter: grayscale(0%) brightness(100%);
  transform: scale(0.95);
}

.class-table img:hover {
  filter: grayscale(0%) brightness(100%);
  transform: scale(1.05);
  cursor: pointer;
}

.class-table td {
  position: relative;
  overflow: hidden;
}

.class-table td:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, #e67e22, #f1c40f);
  animation: underlineGrow 0.3s ease-out;
}

@keyframes underlineGrow {
  from {
    width: 0;
  }
  to {
    width: 60%;
  }
}


/* หรือแบบมีเอฟเฟกต์พิเศษ */
hr.fancy-hr {
  border: 0;
  height: 3px;
  background-image: linear-gradient(
    to right,
    rgba(241, 196, 15, 0),
    rgba(241, 196, 15, 0.75),
    rgba(230, 126, 34, 0.75),
    rgba(241, 196, 15, 0.75),
    rgba(241, 196, 15, 0)
  );
  margin: 2rem auto;
  width: 80%;
  position: relative;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0% { width: 80%; }
  50% { width: 100%; }
  100% { width: 80%; }
}

/* Tab Menu Styles */
.tab-container {
  max-width: 1200px;
  margin: 2rem auto;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.tabs {
  display: flex;
  background: linear-gradient(135deg, #2c3e50, #1a1a2e);
}

.tab-button {
  flex: 1;
  padding: 1rem;
  border: none;
  background: transparent;
  color: #a0c4ff;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.9rem;
}

.tab-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tab-button.active {
  color: #fff;
  background: #e67e22;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid white;
}

.tab-content {
  padding: 1.5rem;
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.button1 {
  background: linear-gradient(135deg, #e67e22, #f1c40f);
  color: white;
  box-shadow: 0 4px 8px rgba(230, 126, 34, 0.3);
}

.button1:hover {
  background: linear-gradient(135deg, #d35400, #e67e22);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(230, 126, 34, 0.4);
}

.button1:active {
  transform: translateY(0);
}

/* Optional: Add a shine effect on hover */
.button1::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 50%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(30deg);
  transition: all 0.3s ease;
}

.button1:hover::after {
  left: 120%;
}

/* For the table buttons specifically */
.class-table .button1 {
  min-width: 100px;
  margin: 0 auto;
  display: block;
}

/* Not Done Popup */
.not-done-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 2rem;
  border-radius: 10px;
  font-size: 3rem;
  font-weight: bold;
  z-index: 9999;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
  animation: pulse 2s infinite;
  display: none;
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

