/* ตั้งค่าฟอนต์เริ่มต้นเป็น Sarabun */
body, h1, h2, h3, h4, h5, h6, .btn, .table {
  font-family: 'Sarabun', sans-serif;
  font-size: 1rem; /* ใช้ rem เพื่อให้มีการปรับขนาดได้ตามขนาดหน้าจอ */
}

/* ตัวอย่างการปรับใช้กับหัวข้อ */
h1, h2 {
  font-size: 2rem; /* ขนาดฟอนต์ที่ใหญ่ขึ้นใน h1, h2 */
}

/* ปรับแต่งปุ่ม */
.btn, .btn-primary, .btn-warning, .btn-danger, .btn-banner, .btn-banner2 {
  font-family: 'Sarabun', sans-serif;
  border-radius: 5px;
  transition: all 0.3s ease-in-out;
  font-size: 1rem; /* ขนาดฟอนต์ปกติ */
}

.btn-warning, .btn-danger {
  font-weight: 500;
}

.btn-primary {
  padding: 12px 20px;
  font-size: 1.125rem; /* ขนาดฟอนต์ปุ่ม */
}

.btn-primary:hover, .btn-warning:hover, .btn-danger:hover {
  transform: scale(1.05);
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

/* ปรับแต่ง Navbar และ Footer */
.navbar, footer {
  font-weight: 400;
}

.navbar {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background: linear-gradient(45deg, #343a40, #083a6e);
  border-bottom: 3px solid #29496c;
}
/* ปรับแต่ง Navbar และ Footer */
@media (min-width: 1200px) {
  .navbar {
    --bs-navbar-padding-y: 0.2rem !important;
  }
  }
.navbar {
  position: fixed; /* ตรึง Navbar ที่ตำแหน่งคงที่ */
  top: 0; /* ให้ Navbar อยู่ที่ด้านบนสุดของหน้าจอ */
  left: 0; /* ให้ Navbar อยู่ที่ขอบซ้ายสุด */
  width: 100%; /* ให้ Navbar กว้างเต็มหน้าจอ */
  z-index: 1000; /* ให้ Navbar อยู่เหนือเนื้อหาของหน้า */
}

.nav-logo {
  height: 50px; /* ตั้งขนาดเริ่มต้น */
  width: auto;
}


/* ปรับเมื่อ Responsive */
@media (max-width: 768px) {
  .navbar-toggler {
    position: absolute;
    top: 0.5rem; /* ตำแหน่งใกล้ขอบบน */
    left: 0.5rem; /* ชิดขอบซ้าย */
    z-index: 1050; /* ให้อยู่บนสุด */
  }

  .navbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0.5rem; /* จัดให้อยู่ตรงกลาง */
  }
}

.d-flex2 {
  display: flex !important
;
}



@media (max-width: 768px) {
  .navbar-brand {
    justify-content: flex-start; /* โลโก้และข้อความอยู่ทางซ้าย */
  }

  .nav-logo {
    /* display: none; /* ซ่อนโลโก้ */
    margin-top: -5px;
    height: 40px;
  }

  .navbar-nav {
    text-align: left; /* เมนูชิดซ้าย */
    margin-top: 27px;
  }

  .navbar {
    --bs-navbar-padding-y: 1.6rem; /* Adjust vertical padding */
  }
}

/* Body Layout */
body {
  display: flex;
  flex-direction: column; /* จัดเลย์เอาต์ในแนวตั้ง */
  min-height: 100vh; /* ความสูงขั้นต่ำให้เท่ากับความสูงของหน้าจอ */
  margin: 0; /* ลบ Margin เริ่มต้นของ Body */
}

main {
  flex: 1; /* ทำให้พื้นที่ส่วนกลางขยายได้ */
}

/* Footer Styles */
footer {
  /*position: fixed;  ตรึงตำแหน่ง */
  bottom: 0; /* ให้ Footer อยู่ที่ด้านล่างสุด */
  left: 0; /* ให้ Footer อยู่ที่ขอบซ้ายสุด */
  width: 100%; /* ให้ Footer กว้างเต็มหน้าจอ */
  background-color: #343a40; /* สีพื้นหลัง */
  color: #fff; /* สีตัวอักษร */
  padding: 20px 0; /* ระยะห่างด้านบนและล่าง */
  text-align: center; /* จัดข้อความให้อยู่กลาง */
  font-size: 0.875rem; /* ขนาดฟอนต์ */
  border-top: 2px solid #444; /* เส้นขอบด้านบน */
  z-index: 9999; /* ให้ Footer อยู่บนสุด */
}

/* ตาราง */
.table, .table-bordered {
  width: 100%;
  margin-top: 20px;
  border-radius: 8px;
  border: 2px solid #ddd;
}

.table th, .table td {
  text-align: center;
  vertical-align: middle;
  font-size: 0.875rem; /* ขนาดฟอนต์ของตาราง */
}

.table-bordered th, .table-bordered td {
  border: 1px solid #ddd;
}

.table-dark {
  background-color: #343a40;
  color: white;
}

.table-pri {
  --bs-table-color: #ffffff;
  --bs-table-bg: #171836;
}

.table-pri2 {
  --bs-table-color: #ffffff;
  --bs-table-bg: #261d58;
}

.table-striped tbody tr:nth-child(odd) {
  background-color: #f9f9f9;
}

/* การตั้งค่าการแสดงผลในมือถือ */
@media (max-width: 768px) {
  .table th, .table td {
    font-size: 0.75rem; /* ปรับขนาดฟอนต์ในตารางให้เล็กลง */
  }

  .navbar-brand {
    font-size: 1rem; /* ปรับขนาดฟอนต์ใน navbar */
  }

  .banner h1 {
    font-size: 2.5rem; /* ขนาดฟอนต์ของ h1 ใน banner */
  }

  .banner p {
    font-size: 1.2rem; /* ขนาดฟอนต์ของข้อความใน banner */
  }

  .btn-primary {
    font-size: 1rem;
    padding: 10px 16px;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .table th, .table td {
    font-size: 0.875rem; /* ปรับขนาดฟอนต์ในตารางให้เล็กลง */
  }

  .btn-primary {
    font-size: 0.875rem; /* ปรับขนาดฟอนต์ของปุ่มในอุปกรณ์ขนาดเล็ก */
    padding: 8px 14px;
  }
}

/* การตั้งค่าพื้นหลังของ header */
header {
  background-image: url('banner-image.jpg');
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 5rem 0;
}

/* สไตล์ของปุ่มใน header */
header .btn {
  font-size: 1.2rem;
  padding: 0.75rem 1.5rem;
  text-transform: uppercase;
  font-weight: bold;
  border-radius: 30px;
  transition: all 0.3s ease;
}

header .btn:hover {
  background-color: #007bff;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

/* เพิ่มขนาดฟอนต์ในข้อความ */
header h1 {
  font-size: 3rem;
  font-weight: 700;
}

header p {
  font-size: 1.25rem;
  font-weight: 300;
}

/* ---- Statistics Section ---- */
.container .mt-5 {
  margin-top: 50px;
}

h2 {
  font-size: 1.75rem; /* ปรับขนาดฟอนต์ของ h2 */
  margin-bottom: 20px;
  text-align: center;
}

/* กราฟแท่งแนวนอน */
#statsChart {
  max-height: 400px;
  margin: 0 auto;
  display: block;
}

/* Footer */
footer {
  background: #212529;
  color: #d9d9d9;
  border-top: 3px solid #495d73;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
}

/* ปรับแต่ง Banner */
.banner {
  background: linear-gradient(to bottom, rgba(0, 123, 255, 0.7), rgba(0, 0, 0, 0.7)), 
              url('https://source.unsplash.com/1920x400/?leadership,teamwork');
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 40px 20px;
  font-family: 'Sarabun', sans-serif;
  position: relative;
  overflow: hidden;
}

/*.banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1;
}*/

.banner-logo {
  max-width: 150px; /* ปรับขนาดโลโก้ให้เหมาะสม */
  margin-bottom: 20px;
  border-radius: 10px;
  transition: transform 0.3s ease-in-out;
}

.banner-logo:hover {
  transform: scale(1.05); /* ขยายภาพเล็กน้อยเมื่อชี้เมาส์ */
}


.banner h1, .banner p {
  position: relative;
  z-index: 2;
  font-family: 'Sarabun', sans-serif;
}

.banner h1 {
  font-size: 2vw; /* ใช้ vw เพื่อให้ขนาดฟอนต์ยืดหยุ่นตามขนาดหน้าจอ */
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Media Query เพื่อปรับขนาดฟอนต์เมื่อขนาดหน้าจอเล็กลง */
@media (max-width: 768px) {
  .banner h1 {
    font-size: 3rem; /* ลดขนาดฟอนต์สำหรับหน้าจอขนาดกลาง */
  }
}

@media (max-width: 576px) {
  .banner h1 {
    font-size: 2rem; /* ลดขนาดฟอนต์สำหรับหน้าจอขนาดเล็ก */
  }
}

.banner p {
  font-size: 1.5rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.btn-banner {
  margin-top: 20px;
  padding: 12px 30px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
  background: #007bff;
  border: 2px solid #007bff;
  border-radius: 8px;
  text-align: center;
  text-transform: uppercase;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
  cursor: pointer;
  text-decoration: none;
}

.btn-banner:hover {
  background: #0056b3;
  border-color: #0056b3;
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 123, 255, 0.5);
}

.btn-banner:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.btn-banner2 {
  margin-top: 20px;
  padding: 12px 30px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
  background: #009688;
  border: 2px solid #1c8d82;
  border-radius: 8px;
  text-align: center;
  text-transform: uppercase;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
  cursor: pointer;
  text-decoration: none;
}

.btn-banner2:hover {
  background: #01776c;
  border-color: #006a71;
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 123, 255, 0.5);
}

.btn-banner2:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

/* สำหรับปุ่ม */
button, .btn {
  font-family: 'Sarabun', sans-serif;
}

.card-title {
  font-weight: 500;
}

/* กรอบเงาและเอฟเฟกต์ */
.table-striped tbody tr:nth-child(odd) {
  background-color: #f9f9f9;
}

/* จัดแถวเดียวกัน */
.form-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.form-group {
  flex: 1;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
}

.form-group input {
  width: 100%;
}

/* ปรับให้เป็นแถวเดียวในมือถือ */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column; /* ให้แต่ละช่องกรอกข้อมูลอยู่ในแถวเดียวกัน */
    gap: 15px; /* ลดระยะห่างระหว่างช่อง */
  }

  .form-group {
    flex: none; /* ให้ช่องไม่ยืดเต็ม */
  }
}

/* ปรับปุ่ม */
button.btn-primary {
  background: linear-gradient(45deg, #007bff, #00c6ff); /* สี Gradient */
  border: none;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

button.btn-primary:hover {
  background: linear-gradient(45deg, #0056b3, #007bff); /* สีเข้มเมื่อ Hover */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.3s, box-shadow 0.3s;
}


/* เงาสำหรับกล่องฟอร์ม */
.form-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  padding: 40px;
  margin-top: 40px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

/* Message Boxes (Announcements or Posts) */
/* Equal height for cards */
.row {
  display: flex;
  flex-wrap: wrap;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 10px; /* Rounded corners */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

/* Card body that grows */
.card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden; /* Prevents text overflow outside the card */
  font-size:0.8em;
}

/* Truncate text with ellipsis if too long */
.card-title, .card-text {
  /* overflow: hidden;*/
  text-overflow: ellipsis;
  white-space: nowrap; /* Prevent text from wrapping */
  text-align: justify; /* Align text to both sides */
}

/* Add some space at the bottom of the text */
.card-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 10px;
}

/* Optional: Add more styling to the text */
.card-text {
  font-size: 0.9rem;
  color: #f0f0f0;
  line-height: 1.5;
  height: 60px; /* Limit text height for consistency */
}

/* Styling the card headers with icons */
.card-header {
  background-color: #5c6bc0; /* Beautiful blue */
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px 10px 0 0;
  font-size: 1rem;
  font-weight: bold;
  padding: 15px;
}

.card-header i {
  margin-right: 10px;
}

/* Change background color for cards */
.card.bg-info {
  background-color: #4caf50; /* Green color for info cards */
}

.card.bg-warning {
  background-color: #f44336; /* Red color for warning cards */
}

/* Responsive design adjustments */
@media (max-width: 768px) {
  .card-body {
    padding: 15px;
    font-size: 0.75rem;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .card-text {
    font-size: 0.85rem;
    height: 50px; /* Adjust height for smaller screens */
  }
}

/* Background Color for Different Message Types */
.bg-info {
  background-color: #17a2b8 !important;
}

.bg-warning {
  background-color: #ffc107 !important;
}

/* Image Grid */
.card-img-top {
  border-radius: 0px;
}

.card-body p {
  font-size: 0.9rem;
  color: #555;
}

/* Image Grid Section */
section h2 {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

/* Carousel Styles */
.carousel-item img {
  border-radius: 8px;
}

.carousel-inner {
  border-radius: 8px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: invert(1);
}

/* Horizontal Timeline */
/* General timeline container styles */
.timeline {
  display: flex;
  justify-content: center;
  align-items: stretch; /* Ensure all items stretch to the same height */
  overflow-x: auto;
  padding: 20px 0;
  scroll-behavior: smooth;
  /*background-color: #f9f9f9;*/
  border-radius: 10px;
  /*box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);*/
  gap: 20px;
}

/* Individual timeline items */
.timeline-item {
  flex: 0 0 auto;
  width: 250px;
  /*min-height: 300px; /* Set a minimum height to ensure equal size */
  display: flex;
  flex-direction: column; /* Stack content vertically */
  justify-content: space-between; /* Distribute content evenly */
  background: linear-gradient(145deg, #ffffff, #e6e6e6);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.1), -4px -4px 10px rgba(255, 255, 255, 0.5);
  transition: transform 0.3s ease-in-out;
}

.timeline-item:hover {
  transform: scale(1.05);
  box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.2), -6px -6px 15px rgba(255, 255, 255, 0.7);
}

/* Timeline icons */
.timeline-icon {
  font-size: 2.5rem;
  color: #007bff;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #eaf3ff;
  width: 60px;
  height: 60px;
  margin: 0 auto 10px;
  border-radius: 50%;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1), -2px -2px 5px rgba(255, 255, 255, 0.7);
}

/* Content inside timeline items */
.timeline-content h5 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 10px;
  font-weight: 600;
}

.timeline-content p {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.4;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .timeline {
    flex-direction: column;
    align-items: center;
  }

  .timeline-item {
    width: 100%;
    margin-bottom: 20px;
  }
}

@media (max-width: 576px) {
  .carousel-inner img {
    height: 300px;
    object-fit: cover;
  }

  .card-body p {
    font-size: 0.8rem;
  }
}

.link {
  color: #007bff; /* สีฟ้า */
  text-decoration: none; /* ไม่มีขีดเส้นใต้ */
}

.link i {
  margin-left: 5px; /* เว้นระยะจากข้อความ */
  font-size: 1.2em; /* ขนาดของไอคอน */
}

.link:hover {
  color: #0056b3; /* สีเมื่อเอาเมาส์ไปวาง */
  text-decoration: underline; /* ขีดเส้นใต้เมื่อ hover */
}

.link:hover i {
  color: #0056b3; /* เปลี่ยนสีของไอคอนเมื่อ hover */
}


/* Section Background */
.custom-section {
  background: linear-gradient(120deg, #6a11cb, #2575fc);
  padding: 40px 20px;
  border-radius: 10px;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Card Customization */
.custom-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  transition: transform 0.3s ease-in-out;
}

.custom-card:hover {
  transform: translateY(-10px);
}

/* Card Icon Customization */
.card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 15px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #007bff;
  color: #fff;
  font-size: 40px;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.card-icon i {
  font-size: 50px; /* เพิ่มขนาดไอคอน */
}

.card-icon:hover {
  background: #0056b3;
}

/* Card Content */
.card-body1 h5 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.card-body1 p {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 10px;
}

.card-body1 h2 {
  font-size: 2.5rem;
  color: #333;
  margin: 0;
}

.custom-gradient-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 3rem 0;
  position: relative;
}

.custom-gradient-divider::before,
.custom-gradient-divider::after {
  content: '';
  flex: 1;
  height: 3px;
  background: linear-gradient(to right, #007bff, #00c6ff);
}

.custom-gradient-divider::before {
  margin-right: 20px;
}

.custom-gradient-divider::after {
  margin-left: 20px;
}

.custom-gradient-divider span {
  font-size: 1.1rem;
  font-weight: bold;
  color: #007bff;
  text-transform: uppercase;
  background: #fff;
  padding: 0 15px;
}

.custom-divider span {
  animation: fadeIn 1.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-gradient-divider2 {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.custom-gradient-divider2::before,
.custom-gradient-divider2::after {
  content: '';
  flex: 1;
  height: 5px;
  background: linear-gradient(to right, #c57e00, #fff700);
}

.custom-gradient-divider2::before {
  margin-right: 20px;
}

.custom-gradient-divider2::after {
  margin-left: 20px;
}

.custom-gradient-divider2 span {
  font-size: 1.8rem;
  font-weight: bold;
  color: #c57e00;
  text-transform: uppercase;
  background: #fff;
  padding: 0 15px;
}

.custom-divider span {
  animation: fadeIn 1.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ปรับ CSS สำหรับ Responsive */
@media (max-width: 768px) {
  .custom-gradient-divider2 span {
    font-size: 1.2rem;
  }

}


.custom-gradient-divider3 {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.custom-gradient-divider3::before,
.custom-gradient-divider3::after {
  content: '';
  flex: 1;
  height: 5px;
  background: linear-gradient(to right, #60c3c9, #777cff);
}

.custom-gradient-divider3::before {
  margin-right: 20px;
}

.custom-gradient-divider3::after {
  margin-left: 20px;
}

.custom-gradient-divider3 span {
  font-size: 1.8rem;
  font-weight: bold;
  color: #12a6ef;
  text-transform: uppercase;
  background: #fff;
  padding: 0 15px;
}

.custom-divider3 span {
  animation: fadeIn 1.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ปรับ CSS สำหรับ Responsive */
@media (max-width: 768px) {
  .custom-gradient-divider3 span {
    font-size: 1.2rem;
  }

}



.modern-bar {
  width: 100%;
  padding: 60px 30px;
  color: #fff;
  text-align: center;
  background: linear-gradient(120deg, rgba(255, 0, 150, 0.7), rgba(0, 204, 255, 0.7)), 
              url('https://www.toptal.com/designers/subtlepatterns/uploads/triangles.png');
  background-blend-mode: overlay;
  background-size: cover;
}

.modern-bar h2 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.modern-bar p {
  font-size: 1.2rem;
  line-height: 1.6;
}

/* ตั้งค่ากล่อง */
.box {
  position: relative;
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, #6a11cb, #2575fc); /* ไล่สีพื้นหลัง */
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Overlay Icon และข้อความ */
.overlay {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  z-index: 2;
}

.overlay i {
  font-size: 40px;
  margin-bottom: 10px;
}

.overlay p {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}

/* เพิ่มเงาบางๆ */
.box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2); /* เงาเล็กน้อย */
  z-index: 1;
}

/* เพิ่มพื้นที่รอบๆ การ์ด PDF */
.pdf-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* เอฟเฟกต์ hover */
.pdf-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* การตั้งค่ารูปภาพ */
.pdf-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* ชื่อ PDF */
.pdf-info h5 {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin: 0;
    color: #343a40;
}

/* เพิ่มพื้นที่ระหว่างการ์ด */
.row > div {
    margin-bottom: 5px; /*เดิมคือ 20px*/
}

/* ปรับ CSS สำหรับ Responsive */
@media (max-width: 768px) {
    .pdf-info h5 {
        font-size: 14px;
    }
    .pdf-card {
        padding: 10px;
    }
}


/* การตั้งค่ากริด */
.container .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* ตารางคะแนน */
.medal-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(135deg, #e9ecef, #f8f9fa);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);

}


/* แถวคะแนน */
.medal-row {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #ddd;
  background: #ffffff;
  border-radius: 10px;
  transition: transform 0.2s ease, background-color 0.3s ease;
  position: relative;
}

/* Hover Effect */
.medal-row:hover {
  background: #f0f8ff;
  transform: scale(1.02);
}

/* เส้นคั่นในแถว */
.medal-row:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
}

/* ภาพของทีม */
.medal-row img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: cover;
  border: 2px solid #ddd;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Hover Effect for Images */
.medal-row:hover img {
  transform: rotate(-5deg) scale(1.1);
  border-color: #ff7f50;
}

/* หัวตาราง */
.medal-row.header {
  background-color: #343a40;
  color: #fff;
  font-weight: bold;
  display: flex;
  padding: 15px;
  border-radius: 5px;
  text-align: center;
}

/* ชื่อทีม */
.team-info {
  flex: 3;
  display: flex;
  align-items: center;
  font-size: 18px;
}

/* รายละเอียดทีม */
.team-details {
  display: flex;
  flex-direction: column;
}

.team-name {
  font-size: 16px;
  font-weight: bold;
  color: #212529;
}

.additional-info {
  font-size: 12px;
  color: #6c757d;
}

/* เหรียญ */
.medal {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* สีเหรียญ */
.medal.gold i {
  color: #ffc107; /* ทอง */
}

.medal.silver i {
  color: #adb5bd; /* เงิน */
}

.medal.bronze i {
  color: #cd7f32; /* ทองแดง */
}

.medal.total i {
  color: #28a745; /* รวม */
}

.badge-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: white;
  font-weight: bold;
  border-radius: 50%;
  font-size: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.badge-circle.gold { background-color: #f1c40f; }
.badge-circle.silver { background-color: #bdc3c7; }
.badge-circle.bronze { background-color: #e67e22; }
.badge-circle.average { background-color: #2ecc71; }


/* Responsive Design */
@media (max-width: 768px) {
  .medal-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
  }

  .team-info {
    flex-direction: row;
    align-items: center;
  }

  .team-details {
    margin-left: 10px;
  }

  .medal {
    font-size: 16px; /* ตัวหนังสือเล็กลง */
  }

  .medal-row img {
    width: 40px; /* ลดขนาดภาพ */
    height: 40px;
  }
}

@media (max-width: 576px) {
  .medal-row {
    gap: 5px;
    padding: 8px;
  }

  .team-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .team-name {
    font-size: 14px; /* ตัวหนังสือเล็กลงสำหรับมือถือ */
  }

  .additional-info {
    font-size: 12px;
  }

  .medal {
    font-size: 14px; /* ขนาดเล็กสำหรับมือถือ */
  }

  .medal-row img {
    width: 35px; /* ลดขนาดภาพลงอีก */
    height: 35px;
  }
}

/* แถวรวม (Summary Row) */
.medal-row.summary {
  background: linear-gradient(90deg, #343a40, #212529);
  color: #fff;
  font-weight: bold;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.medal-row.summary .medal {
  color: #ffd700; /* สีของข้อความรวม */
}

/* modal */

.table-responsive table {
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .custom-modal .modal-dialog {
    margin: 1rem;
  }
  .custom-modal .modal-body {
    padding: 1.5rem;
  }
  .custom-modal .modal-header {
    padding: 1rem 1.5rem;
  }

  .table th,
  .table td {
    white-space: nowrap;
  }
}

/* เพิ่มความกว้างของ modal และตกแต่ง 
.custom-modal .modal-dialog {
  max-width: 65vw; 
}
  */

.custom-modal .modal-content {
  /*background: linear-gradient(135deg, #c4e2f5 0%, #a0cfee 50%, #87bcd9 100%);
  border-radius: 1rem;*/
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

/* เพิ่มขอบมนเฉพาะด้านบน */
.custom-modal .modal-header {
  border-bottom: 1px solid #dee2e6;
}

/* เพิ่ม padding ด้านล่างให้ตัว modal ดูโปร่ง */
.custom-modal .modal-body {
  padding-bottom: 2rem;
}

/* ปรับปุ่มให้สวยขึ้น */
.custom-modal .btn-primary {
  font-weight: 500;
  border-radius: 0.5rem;
}

/* ปรับฟอร์มเลือกให้ดูเรียบร้อย */
.custom-modal .form-select {
  border-radius: 0.5rem;
}

.table-custom-head{
  --bs-table-color: #ffffff;
  --bs-table-bg: rgb(24 58 93);
}

.bg-custom{
  background-color: rgb(24 58 93);
}

.modal {
  margin-top:1% !important;
  --bs-modal-border-radius:0px !important;
  --bs-modal-inner-border-radius:0px !important; 
}

/*แสดงชื่อเต็มเมื่อเป็นคอม หรือแสดงชื่อย่อเมื่อเป็นโทรศัพท์*/
@media (max-width: 576px) {
  .full-name {
      display: none !important;
  }
  .short-name {
      display: inline !important;
  }
}
@media (min-width: 577px) {
  .full-name {
      display: inline !important;
  }
  .short-name {
      display: none !important;
  }
}

/* tab */
.custom-tab .nav-link {
  border-radius: 1.5rem;
  padding: 0.6rem 1.5rem;
  font-weight: 500;
  background-color: #f1f3f5;
  color: #333;
  transition: all 0.3s ease-in-out;
}

.custom-tab .nav-link:hover {
  background-color: #dbe4ff;
  color: #1c3faa;
}

.custom-tab .nav-link.active {
  background-color: #1c3faa;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

    /* ปรับลักษณะปุ่มให้ดูทันสมัย */
    .btn-rounded {
      border-radius: 30px; /* ทำให้ปุ่มมีมุมโค้ง */
      padding: 12px 24px; /* เพิ่มขนาดปุ่ม */
  }

  /* ปุ่มเมื่อ hover */
  .btn-outline-info:hover {
      background-color: #17a2b8;
      color: white;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  /* ปุ่มเมื่อคลิก */
  .btn-outline-info:active {
      background-color: #138496;
      color: white;
      transform: translateY(2px); /* ทำให้ปุ่มดูเหมือนถูกกด */
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  #chartCanvas {
    width: 100%;
    /* min-width: 1200px;  ปรับตามจำนวนห้อง */
    height: 400px;     /* หรือให้ Chart.js ควบคุม */
  }
  
  @media screen and (min-device-width: 768px) and (max-device-width: 834px) and (orientation: portrait) {
    .card-body {
    font-size:0.75rem;
  }
    .card {
      height:95%;
    }
  }