/* โหลดฟอนต์จาก Google */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@100;200;300;400;500;600;700&display=swap");

/* บังคับให้ใช้ฟอนต์ */
body,
html {
  font-family: "IBM Plex Sans Thai", sans-serif !important;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #f8f9fa;
}

/* โครงสร้างหลักของเว็บ */
.main-container {
  flex: 1;
}

/* เว้นระยะห่างระหว่างเนื้อหาหลักกับ Footer */
.page-content {
  margin-bottom: 80px; /* ปรับให้มีระยะห่างที่เหมาะสม */
}

/* เปลี่ยนสี Navbar เป็นสีน้ำเงินกรม */
.navbar.bg-dark {
  background-color: #002060 !important;
}

/* ปรับสีตัวอักษร Navbar */
.navbar .nav-link {
  color: white !important;
  font-weight: bold;
  transition: color 0.3s ease-in-out, background 0.3s ease-in-out;
  padding: 10px 15px;
  border-radius: 5px;
}

/* Hover Effect: เปลี่ยนเป็นสีเหลือง */
.navbar .nav-link:hover {
  background-color: #ffdd00;
  color: #002060 !important;
}

/* ปรับสีของ Dropdown */
.navbar .dropdown-menu {
  background-color: #48546d;
  border: none;
}

/* เปลี่ยนสีของตัวเลือกใน Dropdown */
.navbar .dropdown-menu .dropdown-item {
  color: white !important;
}

/* Hover ใน Dropdown ให้เป็นสีเหลือง */
.navbar .dropdown-menu .dropdown-item:hover {
  background-color: #ffdd00;
  color: #002060 !important;
}
/* รองรับ dropdown submenu */
.dropdown-submenu .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
}
.dropdown-submenu:hover > .dropdown-menu {
  display: block;
}
.dropdown-submenu > .dropdown-toggle::after {
  transform: rotate(-90deg);
  float: right;
  margin-top: 5px;
}
.dropdown-submenu > a {
  white-space: nowrap; /* ไม่ขึ้นบรรทัดใหม่ */
  min-width: 200px; /* ป้องกันข้อความยาวบรรจุไม่พอ */
  display: flex; /* ให้ icon อยู่บรรทัดเดียวกัน */
  justify-content: space-between; /* ชิดขอบซ้าย-ขวา */
  align-items: center; /* จัดให้ icon อยู่ตรงกลางแนวแกน Y */
}

/* ปรับสีของ Navbar Toggler สำหรับมือถือ */
.navbar-toggler {
  border: 1px solid white;
}

.navbar-toggler-icon {
  filter: invert(1);
}

/* ปรับระยะห่างของ Navigation */
.navbar-nav {
  gap: 10px;
}

/* ปรับช่องค้นหา */
.search-form {
  max-width: 400px;
  width: 100%;
}

.search-input {
  border-radius: 8px;
  padding: 8px;
}

/* แสดงเฉพาะไอคอน ไม่มีพื้นหลัง */
.icon-only {
  font-size: 24px; /* ขนาดใหญ่ขึ้น */
  color: #222;
  padding: 8px;
  transition: color 0.3s ease, transform 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

/* Hover Effect */
.icon-only:hover {
  color: #ffcc00;
  transform: scale(1.1);
}

/* ตรวจสอบว่าปุ่มไม่ถูกซ่อน */
.icon-only i {
  visibility: visible;
  opacity: 1;
}

/* ปรับ Dropdown */
.dropdown-menu {
  border: none;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.container {
  flex: 1; /* ทำให้ container ขยายเต็มที่ */
}

.card-social {
  border: none; /* เอาขอบออกให้ดูสะอาดตา */
  border-radius: 12px;
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2); /* เพิ่มเงา */
  background: white;
  transition: all 0.3s ease-in-out;
}

/* กล่องลิงก์ */
.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 10px;
  color: white;
  text-decoration: none;
  height: 150px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.link-card img.icon {
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
}

.link-card span {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
}

.link-card .icon {
  margin-bottom: 15px; /* เพิ่มระยะห่างระหว่างไอคอนกับข้อความ */
}

/* เอฟเฟกต์ Hover */
.link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
}

/* Animation Slide to Top */
@keyframes slideTop {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-top {
  animation: slideTop 0.6s ease-out;
}

/* ทำให้แต่ละกล่องแสดง animation ทีละตัว */
.col-md-4:nth-child(1) .slide-top {
  animation-delay: 0.1s;
}
.col-md-4:nth-child(2) .slide-top {
  animation-delay: 0.2s;
}
.col-md-4:nth-child(3) .slide-top {
  animation-delay: 0.3s;
}
.col-md-4:nth-child(4) .slide-top {
  animation-delay: 0.4s;
}
.col-md-4:nth-child(5) .slide-top {
  animation-delay: 0.5s;
}
.col-md-4:nth-child(6) .slide-top {
  animation-delay: 0.6s;
}

/* กล่องลิงก์แบบ Fade In */
.link-box {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: white;
  text-decoration: none;
  height: 80px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, border 0.3s;
  font-size: 1.5rem;
  font-weight: bold;
  border: 3px solid transparent; /* เริ่มต้นเป็นโปร่งใส */
}

/* Hover Effect ให้แสดงกรอบสีขาว */
.link-box:hover {
  border: 3px solid white; /* เปลี่ยนเป็นกรอบสีขาวเมื่อ Hover */
  transform: translateY(-5px);
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
}

/* Animation Fade In */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 1s ease-out;
  animation-fill-mode: forwards;
  opacity: 0; /* เริ่มต้นให้โปร่งใส */
}

/* กำหนด delay ให้แต่ละกล่องลิงก์ */
.col-md-4 a:nth-child(1) {
  animation-delay: 0.1s;
}
.col-md-4 a:nth-child(2) {
  animation-delay: 0.2s;
}
.col-md-4 a:nth-child(3) {
  animation-delay: 0.3s;
}
.col-md-4 a:nth-child(4) {
  animation-delay: 0.4s;
}

/* ปรับความสูงของ Carousel ให้อัตโนมัติเท่ากับกล่องด้านข้าง */
.carousel-container {
  min-height: 320px; /* ปรับค่าให้เท่ากับกล่อง */
  display: flex;
  align-items: center;
}

/* Carousel Image */
.carousel-item img {
  height: 370px;
  object-fit: cover;
  border-radius: 10px;
}

/* ปุ่มลูกศรใน Carousel */
.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 15px;
  border-radius: 50%;
  transition: background-color 0.3s, transform 0.2s;
}

/* Hover Effect ให้ลูกศรสว่างขึ้น */
.carousel-control-prev-icon:hover,
.carousel-control-next-icon:hover {
  background-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

.carousel-controls .btn {
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

/* Section พื้นหลังลายเส้นเฉียง */
.section-striped {
  background-color: #f8f8f8;
  background-image: linear-gradient(
    45deg,
    #ddd 25%,
    transparent 25%,
    transparent 50%,
    #ddd 50%,
    #ddd 75%,
    transparent 75%,
    transparent
  );
  background-size: 40px 40px;
  padding: 50px 0;
}

/* หัวข้อ Section */
.section-title {
  font-size: 2rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

/* ลิงก์ "ทั้งหมด" */
.section-more a {
  color: #333;
  font-weight: normal;
  text-decoration: none;
  font-size: 0.9rem;
}

.section-more a:hover {
  text-decoration: underline;
  color: #ff0000;
}

/* เส้นแบ่งสีเทา (เพิ่มความหนาและระยะห่าง) */
.section-divider {
  width: 100%;
  height: 3px; /* เพิ่มความหนา */
  background-color: #ccc; /* ปรับสีให้ซอฟต์ลงเล็กน้อย */
  margin-bottom: 8px; /* เพิ่มระยะห่างจากเนื้อหาด้านบน */
}

/* เส้นสีแดงใต้เส้นสีเทา (เพิ่มความหนาและระยะห่าง) */
.section-highlight {
  width: 80px; /* ยาวขึ้น */
  height: 6px; /* เพิ่มความหนา */
  background-color: #ff0000;
  margin-top: 1px; /* ขยับขึ้นให้อยู่ติดกับเส้นสีเทา */
  border-radius: 3px; /* ทำให้มุมโค้งเล็กน้อย */
}

/* การ์ดบทความ */
.article-card {
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.2);
}

.article-title {
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  margin: 10px 0;
}

.article-description {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.article-date {
  font-size: 0.8rem;
  color: #999;
  border-top: 1px solid #ddd;
  padding-top: 5px;
}

/* การ์ดการแข่งขัน */
.competition-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.competition-card:hover {
  transform: translateY(-5px);
  box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.2);
}

.competition-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  margin: 10px 0;
}

.competition-date {
  font-size: 0.9rem;
  color: #999;
}

/* พื้นหลัง Footer */
.footer {
  background: #002060;
  color: white;
  padding: 50px 0;
  position: relative;
}

footer p {
  margin: 0;
}

/* ลวดลายพื้นหลัง */
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("/NCBcardshop/public/images/footer-pattern.png") repeat;
  opacity: 0.2;
  z-index: 0;
}

/* ให้เนื้อหา Footer อยู่ด้านหน้า */
.footer .container {
  position: relative;
  z-index: 1;
}

/* หัวข้อแต่ละคอลัมน์ */
.footer h5 {
  font-weight: bold;
  margin-bottom: 15px;
}

/* รายการลิงก์ */
.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 5px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: 0.3s;
}

.footer-links a:hover {
  text-decoration: underline;
  color: #ffdd00;
}

/* โลโก้บริษัท */
.footer-logo {
  width: 150px;
  margin-bottom: 10px;
}

/* เส้นแบ่ง */
.footer-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  margin-top: 30px;
}

/* ปุ่ม Scroll to Top */
.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ffdd00;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: 0.3s;
}

.scroll-to-top:hover {
  background: #ffd700;
}

/* ไอคอนในปุ่ม Scroll to Top */
.scroll-to-top i {
  font-size: 20px;
  color: #002060;
}

/* ปรับขนาดโลโก้ของ Channel */
.channel-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

/* ปรับปุ่มให้เด่น */
.btn-yt-channel {
  font-size: 1rem;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
}

.product-card img {
  height: 220px;
  object-fit: cover;
}
.product-card .card-title {
  font-size: 1rem;
  font-weight: bold;
}
.product-card .card-text {
  font-size: 0.9rem;
  color: #666;
}
.category-sidebar {
  position: sticky;
  top: 1rem;
}
.category-section,
.social-section {
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}
.list-group-item {
  border: none;
  padding: 0.6rem 1rem;
  transition: all 0.2s;
}
.list-group-item:hover {
  font-weight: bold;
  background-color: #f8f9fa;
}
.list-group-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.list-group-item a:hover {
  text-decoration: none;
}
.social-section a {
  display: block;
  font-size: 0.85rem;
  color: #333;
  margin-bottom: 0.5rem;
  text-decoration: none;
}
.social-section a:hover {
  text-decoration: underline;
}
.product-link:hover .card {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  transform: translateY(-3px);
  transition: all 0.2s ease;
}

.product-card {
  transition: all 0.2s ease;
}

.icon-only {
  font-size: 1.2rem;
  position: relative;
}

.badge {
  font-size: 0.75rem;
}

.rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
}
.rating input {
  display: none;
}
.rating label {
  color: #ddd;
}
.rating input:checked ~ label,
.rating label:hover,
.rating label:hover ~ label {
  color: #ffc107; /* สีเหลือง */
}
