@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Prompt:wght@300;400;500;600;700&display=swap');

/* ========================================================= */
/* 🌟 MODERN UI/UX OVERRIDES 🌟 */
/* ========================================================= */

/* 1. Typography & Global Spacing */
:root {
    --primary-blue: #003366;
    --primary-orange: #ff8c00;
    --surface-color: #ffffff;
    --bg-color: #f4f7f6;
    --soft-shadow: 0 10px 30px rgba(0, 51, 102, 0.08);
    --hover-shadow: 0 20px 40px rgba(0, 51, 102, 0.15);
}
body, h1, h2, h3, h4, h5, h6, p, a, span, div, li, button, input {
  font-family: 'Kanit', sans-serif !important;
}
body {
  background-color: var(--bg-color);
}
.section-sp2 {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
.con-title h2 {
  font-weight: 700;
  color: #003366; /* สีน้ำเงินเข้ม */
  position: relative;
  margin-bottom: 15px !important; /* ลดระยะห่างใต้หัวข้อ */
}
.bottom35 {
  margin-bottom: 10px !important; /* ลดช่องว่างเดิมที่มีคลาสนี้ */
}
.m-b30 {
  margin-bottom: 15px !important;
}
.con-title h2 span {
  color: #ff8c00; /* สีส้มประจำโรงเรียน */
}
.con-title p {
  color: #556b82; /* สีเทาอมน้ำเงินนิดๆ ให้เข้าโทน */
  font-size: 16px;
}

/* 2. Cards & Box Design (Soft Shadows & Radius) */
.cours-bx, .event-bx, .recent-news {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 51, 102, 0.05); /* เปลี่ยนสีเงาให้อมน้ำเงินนิดๆ */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  border: 1px solid rgba(0,51,102,0.03);
  margin-bottom: 20px;
}

/* Hover effect for cards */
.cours-bx:hover, .event-bx:hover, .recent-news:hover {
  transform: translateY(-8px); /* ยกกล่องขึ้นเมื่อโฮเวอร์ */
  box-shadow: 0 15px 35px rgba(0, 51, 102, 0.12); /* เพิ่มความเข้มของเงา */
}

/* 3. Image Treatments */
.action-box img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.6s ease; /* เตรียมเอฟเฟกต์ซูม */
}

/* แก้ไขรูปจดหมายข่าวประชาสัมพันธ์ให้กว้างเต็มกรอบ */
.recent-news .action-box img {
  width: 100%;
  height: auto; /* ปล่อยความสูงให้ยืดตามสัดส่วนของรูป */
  object-fit: cover; 
  background: #f8f9fa; 
}

.cours-bx:hover .action-box img, 
.event-bx:hover .action-box img, 
.recent-news:hover .action-box img {
  transform: scale(1.03); /* ซูมภาพเข้าเบาๆ */
}

/* 4. Premium Hero Slider */
#myCarousel .carousel-inner {
  height: 65vh;
  min-height: 400px;
  overflow: hidden;
  background-color: #000;
}
#myCarousel .item {
  height: 100%;
}
#myCarousel .item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 51, 102, 0.8), transparent); /* Cinematic overlay */
  pointer-events: none;
}
#myCarousel .carousel-control {
  width: 8%;
  min-width: 70px; /* Ensure enough space on mobile */
  background: none !important;
  opacity: 0;
  transition: all 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
#myCarousel:hover .carousel-control {
  opacity: 1;
}
#myCarousel .carousel-control .slider-arr {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px); /* Glassmorphism */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  transition: all 0.3s ease;
}
#myCarousel .carousel-control .slider-arr:hover {
  background: var(--primary-orange);
  border-color: var(--primary-orange);
  transform: scale(1.1);
}
#myCarousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 4. Button Modernization */
.btn, .btn-success, .enter-button {
  border-radius: 30px !important; /* ปุ่มโค้งมนแบบ Pill */
  padding: 10px 25px;
  font-weight: 600;
  border: none;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.btn.btn-success, .btn {
  background: linear-gradient(135deg, #0056b3 0%, #003d82 100%) !important; /* สีน้ำเงินไล่ระดับ */
  box-shadow: 0 4px 15px rgba(0, 86, 179, 0.3);
  color: #fff !important;
}

.btn:hover, .btn-success:hover {
  background: linear-gradient(135deg, #ff8c00 0%, #e67e00 100%) !important; /* โฮเวอร์เปลี่ยนเป็นสีส้ม */
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 140, 0, 0.5);
}

/* 5. Miscellaneous Refinements */
.h-vid iframe {
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  margin-bottom: 10px;
}
.bot-gal {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  margin-bottom: 30px; /* เพิ่มระยะห่างแยกกล่องหลักออกจากกัน */
}
.ho-event ul li {
  border: 1px solid #e0e6ed; /* สร้างกรอบชัดเจนล้อมรอบแต่ละข่าว */
  padding: 15px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02); /* เงาบางๆ ให้ดูลอยขึ้น */
}
.ho-event ul li:hover {
  background: #fdf2e9; /* โฮเวอร์กล่องข้อความย่อยเป็นสีส้มอ่อนมาก */
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255,140,0,0.1);
  border-color: #ff8c00; /* เปลี่ยนสีกรอบเวลาโฮเวอร์ */
}

/* ปรับแต่งรายละเอียดในการ์ดเล็กน้อย */
.info-bx {
  padding: 20px !important;
}
.info-bx h5 a, .event-title a {
  color: #003366; /* สีน้ำเงินเข้ม */
  font-weight: 700;
  transition: color 0.3s;
}
.info-bx h5 a:hover, .event-title a:hover {
  color: #ff8c00; /* สีส้ม */
}

/* สไตล์ปุ่มใน Popup (ปุ่ม enter-button) */
.enter-button {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(5px);
}
.enter-button:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* 6. Accessibility Toolbar */
.accessibility-tools {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #003366;
  padding: 10px;
  border-radius: 10px 0 0 10px;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.accessibility-tools button {
  background: #fff;
  border: 2px solid #003366;
  color: #003366;
  font-weight: bold;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.accessibility-tools button:hover {
  background: #ff8c00;
  color: #fff;
  border-color: #ff8c00;
  transform: scale(1.1);
}

/* 7. Premium Navbar (Glassmorphism) */
.ed-mob-menu {
  position: relative;
  z-index: 1000;
}
.top-logo {
  position: relative;
  z-index: 999;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}
.top-logo.affix {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 10px 40px rgba(0, 51, 102, 0.08);
}
.main-menu ul li a {
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #003366;
}
.main-menu ul li a:hover {
  color: var(--primary-orange) !important;
}

/* 8. High Contrast Mode */
body.high-contrast {
    background-color: #000000 !important;
    color: #ffff00 !important;
}
body.high-contrast * {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}
body.high-contrast img {
    filter: grayscale(100%) contrast(120%);
}
body.high-contrast .accessibility-tools button {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}
body.high-contrast .accessibility-tools button:hover {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* 9. Back to Top Button */
#backToTopBtn {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: #ff8c00;
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  font-size: 24px;
  width: 60px;
  height: 60px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: background-color 0.3s, transform 0.3s;
}
#backToTopBtn:hover {
  background-color: #e67e00;
  transform: scale(1.1);
}

/* ========================================================================== */
/* 10. MOBILE PERFECTION                                                      */
/* ========================================================================== */
@media (max-width: 768px) {
  .event-bx, .cours-bx, .recent-news {
    margin-bottom: 30px !important;
  }
  .accessibility-tools {
    padding: 8px;
    gap: 5px;
  }
  .accessibility-tools button {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  #backToTopBtn {
    width: 45px;
    height: 45px;
    font-size: 18px;
    bottom: 20px;
    right: 20px;
  }
  #myCarousel .carousel-control .slider-arr {
    width: 30px;
    height: 30px;
  }
  #myCarousel .carousel-control .slider-arr i {
    font-size: 18px;
    line-height: 30px;
  }
}
}

