/* ===== COURSES SECTION STYLES ===== */

/* Background gradient */
#courses {
  padding: 80px 0 60px !important;
  margin: 0;
  position: relative;
  background: linear-gradient(135deg, #f5f7fa 0%, #f8f9fc 100%);
  z-index: 2;
}


.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;
  text-fill-color: transparent;
  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-line-clamp: 2;
  -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);
}

/* ===== NO NEWS MESSAGE ===== */
.no-news-container {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.no-news-content {
  text-align: center;
  max-width: 500px;
  animation: fadeInUp 0.6s ease-out;
}

.no-news-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 30px;
  background: linear-gradient(135deg, rgba(137, 40, 127, 0.1) 0%, rgba(82, 113, 255, 0.1) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.no-news-icon::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(137, 40, 127, 0.2) 0%, rgba(82, 113, 255, 0.2) 100%);
  animation: pulse 2s ease-in-out infinite;
}

.no-news-icon i {
  font-size: 3.5rem;
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.no-news-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.no-news-description {
  font-size: 1.1rem;
  color: #6c757d;
  margin: 0;
  line-height: 1.6;
}

/* ===== VDO SECTION STYLES ===== */
.vdo-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.vdo-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(137, 40, 127, 0.1), transparent);
}

/* Featured Video Card */
.featured-video-card {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  background: white;
}

.featured-video-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 80px rgba(137, 40, 127, 0.15);
}

/* Video Thumbnail Wrapper */
.video-thumbnail-wrapper {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.featured-video-card .video-thumbnail-wrapper {
  height: 500px;
}

.video-card .video-thumbnail-wrapper {
  height: 220px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.video-thumbnail-wrapper:hover .video-thumbnail {
  transform: scale(1.1);
}

/* Video Overlay */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-thumbnail-wrapper:hover .video-overlay {
  opacity: 1;
}

/* Play Button */
.play-button-wrapper {
  position: relative;
  z-index: 2;
}

.play-button {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  box-shadow: 0 8px 25px rgba(137, 40, 127, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.play-button::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s ease;
}

.video-thumbnail-wrapper:hover .play-button {
  transform: scale(1.1);
}

.video-thumbnail-wrapper:hover .play-button::before {
  opacity: 1;
  transform: scale(1.1);
}

.play-button.pulse {
  animation: vdoPulse 1.5s ease-in-out infinite;
}

@keyframes vdoPulse {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(137, 40, 127, 0.4);
  }
  50% {
    box-shadow: 0 8px 35px rgba(137, 40, 127, 0.6);
    transform: scale(1.05);
  }
}

.play-button i {
  padding-left: 4px;
}

/* Video Info */
.video-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  color: white;
  z-index: 1;
}

.video-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.video-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.video-description {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0;
}

/* Video Card */
.video-card {
  background: white;
  border-radius: 20px;
  padding: 0;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(137, 40, 127, 0.12);
}

.video-card-content {
  padding: 0 5px 5px 5px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.video-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-description {
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: auto;
}

.duration-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(137, 40, 127, 0.1);
  color: #89287f;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ===== VIDEO MODAL - FULLSCREEN STYLE ===== */

/* Modal z-index - สูงที่สุด */
.video-modal {
  z-index: 99999 !important;
}

.video-modal.show {
  z-index: 99999 !important;
}

.modal-backdrop {
  z-index: 99998 !important;
}

.modal-backdrop.show {
  z-index: 99998 !important;
}

/* Modal Dialog - เกือบเต็มจอ */
.video-modal .modal-dialog {
  max-width: 98vw !important;
  width: 98vw !important;
  height: 98vh !important;
  margin: 1vh auto !important;
  z-index: 99999 !important;
}

/* Modal Content */
.video-modal .modal-content {
  height: 98vh !important;
  background: #000 !important;
  border-radius: 12px !important;
  overflow: hidden;
}

/* Modal Header - ลดความสูง */
.video-modal .modal-header {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 25px;
  position: relative;
  z-index: 10;
  min-height: auto;
}

.video-modal .modal-title {
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
}

.video-modal .btn-close-white {
  filter: brightness(0) invert(1);
  opacity: 0.8;
  transition: opacity 0.3s ease;
  padding: 0.5rem;
}

.video-modal .btn-close-white:hover {
  opacity: 1;
}

/* Modal Body - เต็มพื้นที่ */
.video-modal .modal-body {
  padding: 0 !important;
  height: calc(98vh - 60px) !important;
  background: #000;
  display: flex;
  flex-direction: column;
}

/* Carousel Container */
.video-modal #videoCarousel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.video-modal .carousel-inner {
  flex: 1;
  display: flex;
  height: 100%;
}

.video-modal .carousel-item {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
}

/* Video Player Container - ใหญ่สุด */
.video-modal .ratio {
  flex: 1;
  background: #000;
  max-height: calc(100% - 100px);
}

/* YouTube Player */
.video-modal .youtube-player {
  width: 100%;
  height: 100%;
}

.video-modal iframe {
  width: 100%;
  height: 100%;
}

/* Video Info - ด้านล่าง */
.video-modal .video-modal-info {
  padding: 20px 30px;
  background: rgba(0, 0, 0, 0.95);
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 100px;
  max-height: 120px;
  overflow-y: auto;
}

.video-modal .video-modal-info h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: white;
}

.video-modal .video-modal-info p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Carousel Controls - ปรับตำแหน่ง */
.video-modal .carousel-control-prev,
.video-modal .carousel-control-next {
  width: 60px;
  height: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s ease;
  margin: 0 15px;
}

.video-modal .carousel-control-prev {
  left: 0;
}

.video-modal .carousel-control-next {
  right: 0;
}

.video-modal:hover .carousel-control-prev,
.video-modal:hover .carousel-control-next {
  opacity: 0.9;
}

.video-modal .carousel-control-prev:hover,
.video-modal .carousel-control-next:hover {
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.video-modal .carousel-control-prev-icon,
.video-modal .carousel-control-next-icon {
  width: 24px;
  height: 24px;
}

/* Backdrop */
.video-modal.modal {
  backdrop-filter: blur(10px);
}

.video-modal .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.95);
}

/* Scrollbar Styling สำหรับ Video Info */
.video-modal .video-modal-info::-webkit-scrollbar {
  width: 6px;
}

.video-modal .video-modal-info::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.video-modal .video-modal-info::-webkit-scrollbar-thumb {
  background: rgba(137, 40, 127, 0.8);
  border-radius: 3px;
}

.video-modal .video-modal-info::-webkit-scrollbar-thumb:hover {
  background: rgba(137, 40, 127, 1);
}

/* Animation */
.video-modal.show .modal-content {
  animation: modalZoomIn 0.3s ease-out;
}

@keyframes modalZoomIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== QUALITY/PARTNERS SECTION - ULTRA COMPACT ===== */
#partners.quality-section {
  padding: 25px 0;
  background: transparent;
  position: relative;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Quality Grid - Ultra Tight */
.quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 2px;
  align-items: center;
  justify-items: center;
}

/* Quality Card - Minimal */
.quality-card {
  width: 100%;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.quality-card:hover {
  background: rgba(137, 40, 127, 0.02);
  transform: translateY(-2px);
  z-index: 1;
}

/* Logo Image */
.quality-logo {
  max-width: 100%;
  max-height: 50px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: all 0.3s ease;
  filter: grayscale(30%) opacity(0.85);
}

.quality-card:hover .quality-logo {
  filter: grayscale(0%) opacity(1);
  transform: scale(1.05);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Desktop Large */
@media (min-width: 1400px) {
  .video-modal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    height: 95vh !important;
    margin: 2.5vh auto !important;
  }
  
  .video-modal .modal-content {
    height: 95vh !important;
  }
  
  .video-modal .modal-body {
    height: calc(95vh - 60px) !important;
  }
}

/* Tablet & Desktop */
@media (max-width: 1199px) {
  .video-modal .modal-dialog {
    max-width: 96vw !important;
    width: 96vw !important;
    height: 96vh !important;
  }
  
  .video-modal .modal-content {
    height: 96vh !important;
  }
  
  .video-modal .modal-body {
    height: calc(96vh - 55px) !important;
  }
  
  .video-modal .video-modal-info {
    padding: 15px 20px;
    min-height: 80px;
    max-height: 100px;
  }
}

@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;
  }
  
  .featured-video-card .video-thumbnail-wrapper {
    height: 400px;
  }
  
  .video-info {
    padding: 30px;
  }
  
  .video-title {
    font-size: 1.75rem;
  }
  
  .play-button {
    width: 70px;
    height: 70px;
    font-size: 1.75rem;
  }
  
  #partners.quality-section {
    padding: 20px 0;
  }

  .quality-grid {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 2px;
  }

  .quality-card {
    padding: 3px;
  }

  .quality-logo {
    max-height: 45px;
  }
  
  .video-modal .modal-header {
    padding: 10px 20px;
  }
  
  .video-modal .modal-title {
    font-size: 1rem;
  }
  
  .video-modal .video-modal-info h4 {
    font-size: 1.1rem;
  }
  
  .video-modal .video-modal-info p {
    font-size: 0.9rem;
  }
  
  .video-modal .carousel-control-prev,
  .video-modal .carousel-control-next {
    width: 50px;
    height: 50px;
  }
}

@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;
  }
  
  .vdo-section {
    padding: 60px 0;
  }
  
  .featured-video-card .video-thumbnail-wrapper {
    height: 300px;
  }
  
  .video-card .video-thumbnail-wrapper {
    height: 200px;
  }
  
  .video-info {
    padding: 20px;
  }
  
  .video-title {
    font-size: 1.5rem;
  }
  
  .video-description {
    font-size: 1rem;
  }
  
  .play-button {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  #partners.quality-section {
    padding: 18px 0;
  }

  .quality-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
  }

  .quality-card {
    padding: 2px;
  }

  .quality-logo {
    max-height: 40px;
  }
  
  .video-modal .modal-dialog {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
  }
  
  .video-modal .modal-content {
    height: 100vh !important;
    border-radius: 0 !important;
  }
  
  .video-modal .modal-body {
    height: calc(100vh - 50px) !important;
  }
  
  .video-modal .modal-header {
    padding: 8px 15px;
  }
  
  .video-modal .modal-title {
    font-size: 0.95rem;
  }
  
  .video-modal .video-modal-info {
    padding: 12px 15px;
    min-height: 70px;
    max-height: 90px;
  }
  
  .video-modal .video-modal-info h4 {
    font-size: 1rem;
  }
  
  .video-modal .video-modal-info p {
    font-size: 0.85rem;
  }
  
  .video-modal .carousel-control-prev,
  .video-modal .carousel-control-next {
    width: 40px;
    height: 40px;
    margin: 0 8px;
  }
  
  .video-modal .carousel-control-prev-icon,
  .video-modal .carousel-control-next-icon {
    width: 20px;
    height: 20px;
  }
}

@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;
  }
  
  .no-news-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
  }

  .no-news-icon i {
    font-size: 2.25rem;
  }

  .no-news-title {
    font-size: 1.25rem;
  }

  .no-news-description {
    font-size: 0.95rem;
  }
  
  .featured-video-card .video-thumbnail-wrapper {
    height: 250px;
  }
  
  .video-card .video-thumbnail-wrapper {
    height: 180px;
  }
  
  .video-info {
    padding: 15px;
  }
  
  .video-title {
    font-size: 1.25rem;
  }
  
  .video-description {
    font-size: 0.9rem;
  }
  
  .video-badge {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
  
  .play-button {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
  
  .video-card-title {
    font-size: 1.1rem;
  }
  
  .video-card-description {
    font-size: 0.875rem;
  }
  
  #partners.quality-section {
    padding: 15px 0;
  }

  .quality-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
  }

  .quality-card {
    padding: 2px;
  }

  .quality-logo {
    max-height: 35px;
  }
  
  .video-modal .video-modal-info {
    padding: 10px;
    min-height: 60px;
    max-height: 80px;
  }
  
  .video-modal .video-modal-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
  }
  
  .video-modal .video-modal-info p {
    font-size: 0.8rem;
    line-height: 1.4;
  }
}

/* Landscape Mode สำหรับมือถือ */
@media (max-height: 500px) and (orientation: landscape) {
  .video-modal .modal-header {
    padding: 5px 15px;
    min-height: 40px;
  }
  
  .video-modal .modal-title {
    font-size: 0.9rem;
  }
  
  .video-modal .modal-body {
    height: calc(100vh - 40px) !important;
  }
  
  .video-modal .video-modal-info {
    padding: 8px 15px;
    min-height: 50px;
    max-height: 60px;
  }
  
  .video-modal .video-modal-info h4 {
    font-size: 0.9rem;
    margin-bottom: 3px;
  }
  
  .video-modal .video-modal-info p {
    font-size: 0.75rem;
    line-height: 1.3;
  }
  
  .video-modal .ratio {
    max-height: calc(100% - 60px);
  }
}

/* ===== 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);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.3;
  }
}

/* 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;
}

/* Additional spacing after carousel to prevent overlap */
#partners {
  margin-bottom: 0;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #89287f 0%, #5271ff 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(137, 40, 127, 0.3);
  text-decoration: none;
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(137, 40, 127, 0.4);
  color: white;
}

.back-to-top i {
  font-size: 1.2rem;
}