/* ===== COURSES SECTION STYLES ===== */

/* Background gradient */
#courses {
  padding: 80px 0 60px !important;
  margin: 0;
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
  z-index: 2;
}

/* ===== SECTION TITLE (สำหรับทั้ง Courses และ News) ===== */
.section-title {
  text-align: center;
  margin-bottom: 50px;
}    

.section-title h2 {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 600;
  color: #6c757d; /* สีเทา */
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.section-title p {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

/* Gradient Text - ใช้ร่วมกันทั้ง Courses และ News */
.text-gradient {
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  display: inline-block;
}

/* ===== COURSE CARDS ===== */
.course-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px rgba(137, 40, 127, 0.15);
}

/* Course Image - NO ZOOM, NO OVERLAY */
.course-image-wrapper {
  position: relative;
  overflow: hidden;
  height: 280px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.course-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: none;
}

/* Remove icon on image */
.course-image-wrapper .position-absolute.top-0.start-0 {
  display: none;
}

/* Remove overlay effect */
.course-overlay {
  display: none !important;
}

/* Course Content */
.course-content {
  padding: 30px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 15px;
}

.course-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Course Action Buttons */
.course-content .d-grid {
  margin-top: auto;
}

.course-content .btn {
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 12px 20px;
  border-radius: 8px;
}

.course-content .btn-outline-primary {
  border-width: 2px;
  color: #89287f;
  border-color: #89287f;
}

.course-content .btn-outline-primary:hover {
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  border-color: transparent;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(137, 40, 127, 0.2);
}

.course-content .btn-primary {
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  border: none;
  color: white;
}

.course-content .btn-primary:hover {
  background: linear-gradient(135deg, #6a1d60 0%, #4160df 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(137, 40, 127, 0.4);
}

/* ===== CALL TO ACTION BOX ===== */
.cta-box {
  background: linear-gradient(135deg, 
    rgba(137, 40, 127, 0.03) 0%, 
    rgba(82, 113, 255, 0.03) 100%);
  border-radius: 20px;
  padding: 50px 40px;
  margin-top: 60px;
  border: 2px solid rgba(137, 40, 127, 0.08);
  transition: all 0.3s ease;
}

.cta-box:hover {
  border-color: rgba(137, 40, 127, 0.15);
  box-shadow: 0 10px 30px rgba(137, 40, 127, 0.1);
}

/* CTA Badge */
.cta-badge .badge {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 50px;
  display: inline-block;
}

.bg-purple-light {
  background-color: rgba(137, 40, 127, 0.1) !important;
}

.text-purple {
  color: #89287f !important;
  font-weight: 600;
}

/* CTA Title */
.cta-title {
  color: #2c3e50;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 15px;
}

/* CTA Description */
.cta-description {
  color: #6c757d;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* CTA Buttons Container */
.cta-buttons {
  width: 100%;
}

.cta-buttons .btn {
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 30px;
  border-radius: 10px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
}

/* CTA Primary Button */
.btn-cta-primary {
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(137, 40, 127, 0.3);
}

.btn-cta-primary:hover {
  background: linear-gradient(135deg, #6a1d60 0%, #4160df 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(137, 40, 127, 0.4);
  color: white;
}

.btn-cta-primary i {
  font-size: 1.1rem;
}

/* CTA Secondary Button */
.btn-cta-secondary {
  background: white;
  color: #89287f;
  border: 2px solid #89287f;
}

.btn-cta-secondary:hover {
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  border-color: transparent;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(137, 40, 127, 0.3);
}

.btn-cta-secondary i {
  font-size: 1.1rem;
}

/* Button Hover Lift Effect */
.btn-hover-lift {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn-hover-lift::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-hover-lift:hover::before {
  width: 300px;
  height: 300px;
}

/* Course Features Badges */
.course-features {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
}

.bg-primary-light {
  background-color: rgba(82, 113, 255, 0.1) !important;
}

/* Button Primary Override */
.btn-primary {
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(137, 40, 127, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #6a1d60 0%, #4160df 100%);
  box-shadow: 0 6px 20px rgba(137, 40, 127, 0.4);
}

.btn-outline-primary {
  color: #89287f;
  border-color: #89287f;
  border-width: 2px;
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  border-color: transparent;
  color: white;
}

/* ===== NEWS SECTION ===== */
#news {
  padding: 80px 0;
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
}

/* News Navigation Tabs - จัดกลาง */
.news-nav-wrapper {
  margin-bottom: 40px;
  width: 100%;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 15px;
}

.news-nav-wrapper::-webkit-scrollbar {
  display: none;
}

.news-tabs-container {
  display: inline-block;
}

.news-tabs {
  display: inline-flex;
  gap: 12px;
  padding: 8px;
  background: white;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin: 0;
  flex-wrap: nowrap;
}

.news-tabs .nav-item {
  margin: 0;
}

.news-tabs .nav-link {
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #6c757d;
  background: transparent;
  border: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.news-tabs .nav-link:hover {
  color: #89287f;
  background: rgba(137, 40, 127, 0.05);
}

.news-tabs .nav-link.active {
  color: white;
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  box-shadow: 0 4px 15px rgba(137, 40, 127, 0.3);
}

/* News Cards */
.news-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(137, 40, 127, 0.15);
}

/* News Image - ไม่มี date badge */
.news-image-link {
  text-decoration: none;
  display: block;
}

.news-image-wrapper {
  position: relative;
  height: 250px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.news-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.news-card:hover .news-image {
  transform: scale(1.1);
}

/* ลบ Date Badge ออก */
.news-date-badge {
  display: none !important;
}

/* News Card Content */
.news-card-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 15px;
  flex-grow: 1;
}

.news-card-title a {
  color: #2c3e50;
  text-decoration: none;
  transition: color 0.3s ease;
  display: -webkit-box;

  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-title a:hover {
  color: #89287f;
}

/* News Meta */
.news-card-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.news-date-text {
  color: #6c757d;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.news-date-text i {
  color: #89287f;
}

/* SDG Badges */
.sdg-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.sdg-badge-link {
  display: inline-block;
  transition: transform 0.3s ease;
}

.sdg-badge-link:hover {
  transform: translateY(-3px);
}

.sdg-badge-icon {
  width: 45px;
  height: 45px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* View More Button */
.btn-view-more {
  display: inline-flex;
  align-items: center;
  padding: 14px 35px;
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(137, 40, 127, 0.3);
}

.btn-view-more:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(137, 40, 127, 0.4);
  color: white;
}

.btn-view-more i {
  transition: transform 0.3s ease;
}

.btn-view-more:hover i {
  transform: translateX(5px);
}

/* ===== GALLERY SECTION ===== */
.gallery-scroll-wrapper {
  width: 100%;
  overflow: hidden;
  background: #f8f9fa;
  padding: 20px 0;
  margin-bottom: 40px;
}

.gallery-scroll {
  display: flex;
  gap: 15px;
  padding: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-scroll::-webkit-scrollbar {
  display: none;
}

.gallery-scroll.paused {
  animation-play-state: paused;
}

.gallery-img {
  flex: 0 0 auto;
  width: 300px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.gallery-img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
  .cta-box {
    padding: 40px 30px;
  }
  
  .cta-title {
    font-size: 1.75rem;
  }
  
  .cta-description {
    font-size: 1rem;
  }
  
  .cta-buttons {
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  #courses, #news {
    padding: 60px 0 40px !important;
  }
  
  .section-title h2 {
    font-size: 0.875rem;
  }
  
  .section-title p {
    font-size: 2rem;
  }
  
  .course-image-wrapper,
  .news-image-wrapper {
    height: 220px;
  }
  
  .course-content,
  .news-card-content {
    padding: 20px;
  }
  
  .course-title,
  .news-card-title {
    font-size: 1.25rem;
  }
  
  .cta-box {
    padding: 30px 20px;
    margin-top: 40px;
  }
  
  .cta-title {
    font-size: 1.5rem;
  }
  
  .cta-description {
    font-size: 0.95rem;
  }
  
  .cta-buttons .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  
  .news-tabs {
    gap: 8px;
    padding: 6px;
  }

  .news-tabs .nav-link {
    padding: 10px 20px;
    font-size: 0.875rem;
  }

  .sdg-badge-icon {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 576px) {
  .section-title h2 {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
  }
  
  .section-title p {
    font-size: 1.75rem;
  }
  
  .cta-badge .badge {
    font-size: 0.75rem;
    padding: 6px 16px;
  }
  
  .cta-title {
    font-size: 1.3rem;
  }
  
  .cta-description {
    font-size: 0.9rem;
  }

  .news-tabs .nav-link {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  .btn-view-more {
    padding: 12px 28px;
    font-size: 0.9rem;
  }
}

/* ===== ANIMATIONS ===== */
[data-aos="fade-up"] {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

[data-aos="fade-up"].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* Hover Animation for Mobile Touch */
@media (hover: none) {
  .course-card:active,
  .news-card:active {
    transform: scale(0.98);
  }
  
  .course-overlay {
    opacity: 0 !important;
  }
}

/* Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.course-card.loading,
.news-card.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Tab Content Animation */
.tab-pane {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Fix z-index issues with overlapping elements */
#myCarousel {
  position: relative;
  z-index: 1;
}

#courses, #news {
  position: relative;
  z-index: 2;
}