/* Course content container positioning only */
.course-content {
  position: relative;
  width: 100vw !important;
  margin: 0 auto;
  padding-top: 10px;
}

@media (min-width: 1024px) {
  .course-content {
    width: 85vw !important;
  }
}

/* Background overlay matching legacy exactly */
.course-content::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("/img/course-content-grid.webp");
  content: "";
  background-size: cover;
  opacity: 0.7;
  z-index: 1;
}

@media (max-width: 767px) {
  .course-content::after {
    background-size: cover;
  }
}

/* Tab pane visibility - exact legacy */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadein 0.5s ease-out 1 forwards;
}

/* Active button styling - exact legacy colors */
.course-content-slider button {
  width: 100px;
  font-weight: 600;
  padding: 40px 20px;
}
.course-content-slider button.active {
  background-color: #26174e !important;
  color: #fff !important;
  border-color: #26174e !important;
}

.course-content-slider button.active p {
  color: #fff !important;
}

/* Dark mode - add main title color border for active state */
html.dark .course-content-slider button.active {
  background-color: #26174e !important;
  border: 1px solid #7043e3 !important;
}

/* Legacy animation */
@keyframes fadein {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Mobile dropdown behavior - exact legacy */
@media (max-width: 767px) {
  .select-course-dropdown {
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    z-index: 99999 !important;
    box-shadow:
      0 4px 6px -1px rgba(0, 0, 0, 0.1),
      0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 300px;
    overflow-x: hidden;
  }

  /* Dark mode - remove borders for mobile dropdown */
  html.dark .select-course-dropdown {
    border: none !important;
    background: #2f1c5e !important;
  }

  /* Hide slider on mobile */
  .course-content-slider {
    display: none !important;
  }

  /* Ensure the parent container doesn't change height when dropdown opens */
  .course-toggle .wow.fadeInUp.relative {
    position: relative;
  }

  /* Position the dropdown relative to the button */
  .select-course-mobile {
    position: relative;
  }

  /* Keep toggle titles on the left side in mobile view */
  .course-content .flex.md\:ml-auto {
    margin-left: 0 !important;
  }

  /* Ensure toggle buttons are full width and left-aligned on mobile */
  .course-content .toggle-button {
    width: 100% !important;
    text-align: left !important;
    margin-right: 0 !important;
    margin-bottom: 8px !important;
  }

  /* Make lecture containers full width on mobile */
  .course-content .flex.lg\:flex-row > div:last-child {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .course-content .flex.lg\:flex-row > div:first-child {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Alternative approach for lecture container width - full width on mobile */
  .course-content .lg\:w-1\/2:last-child {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .course-content .lg\:w-1\/2:first-child {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Force full width for image and lecture containers on mobile */
  .course-content .flex.lg\:flex-row.flex-col > div {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Ensure the flex container itself takes full width on mobile */
  .course-content .flex.lg\:flex-row.flex-col {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Remove any width constraints on mobile for the content containers */
  .course-content .lg\:w-1\/2 {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Override w-full class to use viewport width on mobile */
  .course-content .w-full {
    width: 100vw !important;
    max-width: 90vw !important;
  }

  /* Force the tab content container to full viewport width */
  .course-content .tab-content {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Force the tab pane to full viewport width */
  .course-content .tab-pane {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Remove padding from the inner container on mobile */
  .course-content .relative.z-10 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Ensure the tab content takes full width without padding */
  .course-content .tab-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Remove gap between image and lecture containers on mobile */
  .course-content .flex.lg\:flex-row.flex-col {
    gap: 0 !important;
  }
}

.select-course-dropdown.active {
  opacity: 1 !important;
  visibility: visible !important;
  height: auto !important;
  max-height: 400px !important;
  overflow: auto !important;
  overflow-x: hidden !important;
  pointer-events: auto !important;
}

/* Proper spacing between slider and tab content */
.course-content .slider {
  margin-bottom: 40px;
  display: flex !important;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  z-index: 10;
  flex-wrap: nowrap;
  align-items: stretch;
}

.course-content .slider::-webkit-scrollbar {
  display: none;
}

/* Tab content wrapper spacing */
.course-content .tab-content {
  margin-top: 0;
  position: relative;
  z-index: 1;
}

/* Ensure proper z-index stacking */
.course-content .relative.z-10 {
  position: relative;
  z-index: 10;
}

/* Remove horizontal scroll from course content modules in mobile view */
@media (max-width: 767px) {
  .course-content .tab-content {
    overflow-x: hidden;
  }
  
  .course-content .tab-pane {
    overflow-x: hidden;
  }
  
  .course-content .flex.lg\:flex-row.flex-col {
    overflow-x: hidden;
  }
  
  .course-content .w-screen {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Add right padding for arrow buttons in desktop view */
@media (min-width: 768px) {
  .course-content .hidden.md\:flex.items-center.gap-2 {
    padding-right: 34px;
  }
}

/* Add top padding to the header container */
.course-content .flex.flex-col.md\:flex-row.md\:justify-between.md\:items-center.gap-4 {
  padding-top: 20px;
}

/* Fix specific spacing issues */
.course-content .course-toggle {
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.course-content .tab-content {
  clear: both;
  position: relative;
  z-index: 1;
}

/* Ensure slider doesn't interfere with content */
.course-content .select-course-dropdown {
  position: relative;
  z-index: 999999 !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

@media (min-width: 768px) {
  .course-content .select-course-dropdown {
    position: static;
  }
}

/* Scroll navigation button styles */
.course-content .select-course-dropdown .relative {
  overflow: visible;
  position: relative;
  z-index: 10;
}

/* Ensure scroll buttons are visible */
.course-content .slider {
  position: relative;
  padding: 0 30px;
  z-index: 10;
  min-height: 60px;
}

@media (max-width: 768px) {
  .course-content .slider {
    padding: 0;
  }
}

/* Toggle button styling - exact legacy match */
.course-content .toggle-button {
  background-color: white !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  color: black !important;
  font-size: 16px;
  line-height: 1.5;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
  padding-left: 20px !important;
  padding-right: 20px !important;
  width: 150px;
  text-align: center;
  margin-right: 16px;
  font-weight: 700;
}

.course-content .toggle-button.active {
  background-color: #26174e !important;
  color: white !important;
  border-color: #26174e !important;
}

.course-content .toggle-button.active p {
  color: white !important;
}

html.dark .course-content .toggle-button {
  background-color: #26174e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

html.dark .course-content .toggle-button.active {
  border: 1px solid #7043e3 !important;
}

/* Ensure proper text styling */
.course-content .toggle-button p {
  font-size: 16px;
  font-weight: 400;
  margin: 0;
  pointer-events: none;
}

/* Right alignment for toggle buttons */
.course-content .flex.md\:ml-auto {
  margin-left: auto;
}

/* Module tab button styling - exact legacy match */
.course-content-slider button {
  font-size: 14px;
  line-height: 1.5;
  background-color: white !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  color: black !important;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 294px;
  height: 60px;
  flex-shrink: 0;
}

.course-content-slider button p {
  font-size: 14px;
  font-weight: 400;
  color: black !important;
  margin: 0;
  text-align: center;
}

html.dark .course-content-slider button {
  background-color: #26174e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

html.dark .course-content-slider button p {
  color: white !important;
}

@media (min-width: 1024px) {
  .course-content-slider button {
    font-size: 16px;
  }

  .course-content-slider button p {
    font-size: 16px;
  }
}

/* Lecture item styling - exact legacy match */
.course-content .bg-white {
  background-color: white !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  position: relative;
  z-index: 10;
  opacity: 1 !important;
  visibility: visible !important;
}

html.dark .course-content .bg-white {
  background-color: #26174e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.course-content .bg-white p {
  color: black !important;
}

html.dark .course-content .bg-white p {
  color: white !important;
}

/* Header styling - exact legacy match */
.course-content h2 {
  color: white !important;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 3px;
  position: relative;
  z-index: 10;
}

@media (min-width: 1024px) {
  .course-content h2 {
    font-size: 40px;
    margin-bottom: 80px;
    padding-left: 40px;
    padding-top: 8px;
  }
}

/* Container styling - exact legacy match */
.course-content {
  background-color: #7043e3 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px;
  overflow: visible !important;
}

html.dark .course-content {
  background-color: #1e1433 !important;
  border-color: transparent !important;
}

/* Gap styling for header layout */
.course-content .flex.md\:gap-\[30\%\] {
  gap: 30%;
}

/* Mobile dropdown button styling */
.course-content .select-course-mobile {
  background-color: white !important;
  color: black !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  position: relative;
  z-index: 10;
  width: 98% !important;
}

/* Dark mode - remove borders and set text color for mobile dropdown */
html.dark .course-content .select-course-mobile {
  border: none !important;
  color: white !important;
}

html.dark .course-content .select-course-mobile span {
  color: white !important;
}

html.dark .course-content .select-course-mobile svg {
  color: white !important;
}

html.dark .course-content .select-course-dropdown {
  border: none !important;
}

html.dark .course-content .select-course-dropdown button {
  border: none !important;
}

/* Course content image styling - only for the main course image */
.course-content .lg\:w-1\/2 img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  position: relative;
  z-index: 10;
}

/* Play icon styling - override the general img rule */
.course-content .play-icon {
  width: 30px !important;
  height: 30px !important;
  flex-shrink: 0;
  margin-left: 10px;
}

/* Lecture container styling */
.course-content .lg\:gap-\[30px\] {
  gap: 30px;
}

.course-content .gap-2 {
  gap: 8px;
}

/* Max height for lecture list */
.course-content .md\:max-h-\[423px\] {
  max-height: 423px;
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

/* Reduce lecture container width by 30% */
.course-content .flex.lg\:flex-row > div:last-child {
  width: 60% !important;
  gap: 10px;
}

.course-content .flex.lg\:flex-row > div:first-child {
  width: 65% !important;
}

/* Alternative approach for lecture container width reduction */
.course-content .lg\:w-1\/2:last-child {
  width: 35% !important;
}

.course-content .lg\:w-1\/2:first-child {
  width: 65% !important;
}

/* Play icon styling */
.course-content .dark\:hidden {
  display: block;
}

html.dark .course-content .dark\:hidden {
  display: none;
}

.course-content .dark\:block {
  display: none;
}

html.dark .course-content .dark\:block {
  display: block;
}

.course-content * {
  position: relative;
  z-index: 10;
  transition: all 0.3s ease;
}

.course-content .wow {
  opacity: 1 !important;
  visibility: visible !important;
}

.course-content .fadeInUp {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.course-content .nav-tabs {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.dark .course-content .nav-tabs button.active {
  border: 1px solid #7043e3 !important;
}
.light .course-content .nav-tabs button.active {
  background-color: #26174e !important;
}
.course-content .course-content-slider {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 60px;
}

/* Ensure dropdown is always visible on desktop */
@media (min-width: 768px) {
  .course-content .select-course-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
}
@media (max-width: 767px){
.course-content{
padding: 0px 20px !important;
  margin: auto;
}
 .course-content .flex.lg\:flex-row > div:last-child {
  width: 90% !important;
  margin-top: 20px;
  gap: 20px;
}

.course-content .toggle-button {
  width: 90% !important;
}
}

