/* Eduma-Style Courses Section - Refined for 100vh and Spacing */
.eduma-courses-section {
  height: 100vh;
  min-height: 600px; /* Safety minimum */
  padding: -3vh 0; /* Reduced from 4vh to lift the title */
  background: #f8fbff;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.eduma-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  /* Horizontal Spacing: 1.5rem mobile, 5% or 4rem desktop */
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (min-width: 768px) {
  .eduma-container {
    padding: 0 5%;
  }
}

@media (min-width: 1200px) {
  .eduma-container {
    padding: 0 4rem;
  }
}

.eduma-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3vh; /* Responsive margin */
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 15px;
  flex-shrink: 0;
}

.header-left {
  flex-grow: 1;
}

.eduma-title {
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.8rem, 4vh, 2.5rem); /* Responsive font size */
  font-weight: 700;
  color: #2d3436;
  margin: 0 0 5px 0;
}

.title-separator {
  width: 40px;
  height: 2px;
  background: #0047ff;
  margin-bottom: 8px;
}

.eduma-subtitle {
  font-size: clamp(0.9rem, 1.5vh, 1rem);
  color: #64748b;
  margin: 0;
}

/* Filter Bar Styles */
.courses-filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 20px;
  flex-wrap: wrap;
}

/* Consistent Filter Button & Select Styling */
.courses-filters-bar .filter-btn,
.courses-filters-bar .filter-select,
.courses-filters-bar .reset-btn {
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  background-color: rgba(255, 255, 255, 0.6) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0 16px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  color: #475569 !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.courses-filters-bar .filter-btn.active {
  background-color: #0047ff !important;
  color: #fff !important;
  border-color: #0047ff !important;
  box-shadow: 0 4px 12px rgba(0, 71, 255, 0.2);
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 14px;
  padding-right: 40px;
}

.courses-filters-bar .filter-btn:hover,
.courses-filters-bar .filter-select:hover {
  border-color: #0047ff !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
  color: #1e293b !important;
  transform: translateY(-1px);
}

.courses-filters-bar .filter-btn.active:hover {
  background-color: #2c3fb9 !important;
  color: #fff !important;
}

/* Ensure dropdown arrow is ALWAYS visible */
.courses-filters-bar .filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 15px center !important;
  background-size: 14px !important;
  padding-right: 40px !important;
}

.courses-filters-bar .filter-select:hover,
.courses-filters-bar .filter-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231e293b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
}

.courses-filters-bar .filter-select:focus {
  border-color: #0047ff !important;
  background-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(0, 71, 255, 0.1);
}

.reset-btn {
  width: 40px;
  padding: 0;
  justify-content: center;
  border-color: #f1f5f9;
  color: #ef4444;
}

.reset-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

/* Loader Styles */
.eduma-slider-wrapper {
  position: relative;
}

.courses-loader {
  position: absolute;
  inset: 0;
  background: rgba(248, 251, 255, 0.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f1f5f9;
  border-top: 4px solid #0047ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.no-courses-found {
  width: 100%;
  padding: 60px 0;
  text-align: center;
  color: #64748b;
  font-size: 1.1rem;
}

.header-right {
  display: flex;
  align-items: center;
}

.swiper-navigation-custom {
  display: flex;
  gap: 10px;
}

.swiper-button-next-custom,
.swiper-button-prev-custom {
  width: 40px;
  height: 40px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  color: #2d3436;
  transition: all 0.3s;
  background: #fff;
}

.swiper-button-next-custom:hover,
.swiper-button-prev-custom:hover {
  background: #0047ff;
  color: #fff;
  border-color: #0047ff;
}

/* Slider Wrapper */
.eduma-slider-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  max-height: 60vh; /* Constraint to fit 100vh */
}

.eduma-courses-swiper {
  width: 100%;
  padding: 10px 0 30px 0;
}

/* Card Style */
.eduma-course-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.eduma-course-card:hover {
  box-shadow: 0 20px 40px rgba(0, 71, 255, 0.08);
  transform: translateY(-8px);
}

.course-thumb {
  position: relative;
  height: 180px; /* Slightly reduced to fit 100vh */
  overflow: hidden;
}

.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s;
}

.eduma-course-card:hover .course-thumb img {
  transform: scale(1.1);
}

.course-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 71, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.eduma-course-card:hover .course-overlay {
  opacity: 1;
}

.read-more-btn {
  background: #fff;
  color: #0047ff;
  padding: 8px 20px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 4px;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.eduma-course-card:hover .read-more-btn {
  transform: translateY(0);
}

/* Content */
.course-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-author {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 8px;
}

.course-title-link {
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.course-title-link a {
  text-decoration: none;
  color: #1e293b;
  transition: color 0.3s;
}

.course-title-link a:hover {
  color: #0047ff;
}

/* Footer Info */
.course-info-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-left {
  display: flex;
  gap: 12px;
  color: #64748b;
  font-size: 0.8rem;
}

.info-left span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.info-left i {
  color: #0047ff;
}

.price-tag {
  font-weight: 700;
  color: #0047ff;
  font-size: 0.95rem;
}

.price-tag.is-free {
  color: #10b981;
}

/* Footer Actions */
.eduma-footer-actions {
  text-align: center;
  margin-top: 3vh;
  flex-shrink: 0;
}

.view-more-global {
  display: inline-block;
  background: #0047ff;
  color: #fff;
  padding: 12px 35px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: all 0.3s;
  box-shadow: 0 8px 20px rgba(0, 71, 255, 0.2);
}

.view-more-global:hover {
  background: #2c3fb9;
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(0, 71, 255, 0.3);
}

/* Responsive adjustments for Height */
@media (max-height: 800px) {
  .course-thumb {
    height: 150px;
  }
  .course-content {
    padding: 15px;
  }
  .eduma-course-card {
    height: auto;
  }
}
