:root {
  --primary-navy: #072ac8;
  --primary-yellow: #ffc600;
  --primary-blue: #1e96fc;
  --background: #f7f7f7;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Ubuntu";
}
html {
  scroll-behavior: smooth;
}
body {
  background: #f7f7f7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
/* RTL Adjustments */
html[dir="rtl"] .course-info {
  text-align: right;
}




/* --- Original Collage Section (Desktop) --- */
.collage-container {
  max-width: 1400px;
  width: 100%;
  padding: 40px 20px;
  margin: 0 auto;
  text-align: center;
}

.header {
  text-align: center;
  margin: 0 auto 40px; /* Centered the header and kept bottom margin */
  color: var(--primary-yellow);
  max-width: 600px; /* Added max-width */
}

.header h1 {
  font-size: 2.5rem; /* Resized font */
  margin-bottom: 15px;
}
.header p {
  font-size: 1.1rem; /* Resized font */
  max-width: 800px;
  margin: 0 auto 20px auto;
  line-height: 1.6;
  color: #555;
}
.parent {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 15px;
  height: 75vh;
  max-height: 700px;
}

.div {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: all 0.4s ease;
  border: 2px solid var(--primary-navy);
  opacity: 0; /* Start invisible */
  animation: fadeInFromLeft 0.8s ease-out forwards;
}
@keyframes fadeInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.div img {
  width: 100%;
  height: 100%;
  object-fit: fit;
  display: block;
}

/* Original grid positions */
.div1 {
  grid-row: 2 / span 4;
  grid-column: 1;
  border-radius: 82px 144px 84px 127px / 82px 144px 84px 127px;
  animation-delay: 0.4s;
}
.div2 {
  grid-row: 4 / span 3;
  grid-column: 2;
  border-radius: 73px 130px 117px 81px / 73px 130px 117px 81px;
  animation-delay: 0.6s;
}
.div3 {
  grid-row: 1 / span 3;
  grid-column: 2;
  border-radius: 92px 86px 97px 130px / 92px 86px 97px 130px;
  animation-delay: 0.2s;
}
.div4 {
  width: 300px;
  grid-row: 1 / span 6;
  grid-column: 3;
  border-radius: 188px 259px 180px 231px / 188px 259px 180px 231px;
  animation-delay: 0s;
} /* Center fades in first */
.div5 {
  grid-row: 1 / span 3;
  grid-column: 4;
  border-radius: 95px 82px 130px 87px / 95px 82px 130px 87px;
  animation-delay: 0.3s;
}
.div6 {
  grid-row: 4 / span 3;
  grid-column: 4;
  border-radius: 117px 60px 86px 80px / 117px 60px 86px 80px;
  animation-delay: 0.7s;
}
.div7 {
  grid-row: 2 / span 4;
  grid-column: 5;
  border-radius: 67px 121px 116px 144px / 67px 121px 116px 144px;
  animation-delay: 0.5s;
}

.logo-carousel-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
  background-color: transparent; /* Changed to transparent */
}
.logo-carousel-section .container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.logo-carousel-section .header-text {
  text-align: center;
  margin-bottom: 3rem;
}
.logo-carousel-section .header-text h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #212529;
}
.logo-carousel-section .header-text p {
  color: rgba(33, 37, 41, 0.8);
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
.slider {
  height: 100px;
  margin: auto;
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 100%;
}
.slider::before,
.slider::after {
  content: "";
  height: 100px;
  position: absolute;
  width: 200px;
  z-index: 2;
}
.slider::before {
  left: 0;
  top: 0;
}
.slider::after {
  right: 0;
  top: 0;
}
.slide-track {
  display: flex;
  animation: scroll 30s linear infinite;
}
html[dir="rtl"] .slide-track {
    
  animation: scrollar 28s linear infinite;
}

@keyframes scrollar {
  0% {
    transform: translateX(-100);
  }
  100% {
    transform: translateX(calc(250px * 14));
  } /* Updated for 14 items */
}
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-250px * 14));
  } /* Updated for 14 items */
}

.slide {
  height: 100px;
  width: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  box-sizing: border-box;
}
.slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  opacity: 0.8;
  transition: opacity 0.3s ease-in-out;
}
.slide img:hover {
  opacity: 1;
}
.slide-text {
  font-size: 2rem;
  font-weight: bold;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  transition: opacity 0.3s ease-in-out;
}
.slide-text:hover {
  opacity: 1;
}

/* --- New Features Section --- */
.features-section {
  padding: 8rem 2rem;
  overflow: hidden;
  position: relative;
}
.scroll-path-container {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100%;
  max-width: 800px;
  height: 95%;
  z-index: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

.scroll-path svg {
  height: 100%;
  width: 100%;
}
.feature-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto 12rem auto;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.feature-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.feature-row:last-child {
  margin-bottom: 0;
}
.feature-row:nth-child(odd) {
  flex-direction: row-reverse;
}
html[dir="rtl"] .feature-row:last-child{
  flex-direction: row-reverse;
}
html[dir="rtl"] .feature-row:nth-child(2){
  flex-direction: row-reverse;
}
html[dir="rtl"] .feature-row:nth-child(3){
  flex-direction: row;
}
.feature-content {
  flex: 1;
  max-width: 500px;
}
.feature-content h3 {
  font-size: 2.2rem;
  color: var(--primary-navy);
  margin-bottom: 1rem;
}
.feature-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 2rem;
}
.feature-benefits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.feature-benefits li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.1rem;
  color: #333;
}
.feature-benefits i {
  color: var(--primary-blue);
  font-size: 1.2rem;
}
.feature-image-container {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-image-container .blob-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 1;
  animation: morph 10s ease-in-out infinite alternate;
}
@keyframes morph {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
  100% {
    transform: translate(-50%, -50%) rotate(10deg) scale(1.1);
  }
}
.feature-image {
  width: 100%;
  height: auto;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  clip-path: circle(50% at 50% 50%);
  z-index: 2;
  position: relative;
}

/* --- Top Courses Section --- */
.top-courses-section {
  padding: 6rem 2rem;
  text-align: center;
}

.courses-container {
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Align items to the top */
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.top-courses-section h2 {
  color: var(--primary-navy);
  margin-bottom: 15px;
  font-size: 48px;
}

.course-card {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: 320px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--primary-blue);
  opacity: 0;
  transform: translateY(30px);
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Keep existing transitions */
}

/* Add this new rule for the expanded state */
.course-card.expanded {
    height: auto !important; /* Override the inline height set by JS */
}

.course-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.course-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.course-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

.course-info {
  padding: 1.9rem;
  text-align: left;
}

.course-info h3 {
  font-size: 1.3rem;
  color: var(--primary-navy);
  margin-bottom: 0.5rem;
}

/* Modified description styles */
.course-description {
  font-size: 1rem;
  line-height: 1.5; /* 24px */
  color: #555;
  max-height: 4.5em; /* 3 lines of text (1.5 * 3) */
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease-out;
}

/* Expanded state for the description */
.course-card.expanded .course-description {
  max-height: 500px; /* Large value to reveal all content */
}

.show-more-btn {
  color: var(--primary-blue);
  background: none;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  font-weight: bold;
  display: none; /* Hidden by default, shown by JS */
  margin-top: 10px;
}

.show-more-btn:hover {
    text-decoration: underline;
}

.course-badge {
  position: absolute;
  top: 15px;
  right: -50px;
  background: var(--primary-yellow);
  color: #fff;
  padding: 8px 60px;
  font-weight: bold;
  font-size: 1rem;
  transform: rotate(45deg);
  animation: bounce-badge 1.5s ease-in-out infinite;
}
@keyframes bounce-badge {
  0%,
  100% {
    transform: rotate(45deg) scale(1);
  }
  50% {
    transform: rotate(45deg) scale(1.1);
  }
}

.course-badge.first-place {
  background: #ffd700;
  color: #523d00;
} /* Gold */
.course-badge.second-place {
  background: #c0c0c0;
  color: #3e3e3e;
} /* Silver */
.course-badge.third-place {
  background: #cd7f32;
  color: #fff;
} /* Bronze */

.browse-button-container {
  display: flex;
  justify-content: center;
  text-align: center;
  margin-top: 3rem;
}

.browse-button {
  background-color: var(--primary-blue);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.browse-button:hover {
  background-color: var(--primary-navy);
  transform: translateY(-5px);
}
.buttonn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background-color: var(--primary-blue);
  border: 8px solid #c0dfff;
  color: white;
  gap: 8px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
}
.text {
  font-size: 1.6em;
  font-weight: 700;
  letter-spacing: 1px;
}
.svg {
  padding-top: 5px;
  height: 100%;
  width: fit-content;
}
.svg svg {
  width: 50px;
  height: 30px;
}
.buttonn:hover {
  border: 8px solid #9dbddd;
  background-color:var(--primary-navy);
}
.buttonn:active {
  border: 5px solid #c0dfff;
}
.buttonn:hover .svg svg {
  animation: jello-vertical 0.9s both;
  transform-origin: left;
}
html[dir="rtl"] .buttonn{
  flex-direction: row-reverse;
}

@keyframes jello-vertical {
  0% {
    transform: scale3d(1, 1, 1);
  }
  30% {
    transform: scale3d(0.75, 1.25, 1);
  }
  40% {
    transform: scale3d(1.25, 0.75, 1);
  }
  50% {
    transform: scale3d(0.85, 1.15, 1);
  }
  65% {
    transform: scale3d(1.05, 0.95, 1);
  }
  75% {
    transform: scale3d(0.95, 1.05, 1);
  }
  100% {
    transform: scale3d(1, 1, 1);
  }
}


/* --- Responsive Styles --- */
@media (max-width: 1024px) {
  .courses-container {
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 820px) {

 html[dir="rtl"] .feature-row:last-child{
    flex-direction: column;
  }
  html[dir="rtl"] .feature-row:nth-child(2){
    flex-direction: column;
  }
  html[dir="rtl"] .feature-row:nth-child(3){
    flex-direction: column;
  }
  
  /* Mobile Collage Carousel */
  .collage-container {
    padding: 20px 0;
    flex-direction: row-reverse;
    overflow: hidden;
  }
  .header {
    margin-bottom: 20px;
  }
  .header h1 {
    font-size: 2rem;
  }
  .header p {
    font-size: 1rem;
    padding: 0 20px;
    margin-bottom: 20px;
  }

  .parent {
    display: flex;
    width: 700%;
    height: 40vh;
    max-height: 300px;
    grid-template-columns: none;
    grid-template-rows: none;
    gap: 0;
    animation: scroll-collage 28s linear infinite;
  }

  .div {
    width: calc(100% / 7);
    height: 100%;
    margin: 0 10px;
    flex-shrink: 0;
    grid-row: auto;
    grid-column: auto;
    border-radius: 25px;
    display: block !important;
    opacity: 1;
    animation: none;
    border: 2px solid var(--primary-navy);
  }
  @keyframes scroll-collagear {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(100% + 100vw));
    }
  }
  @keyframes scroll-collage {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-100% + 100vw));
    }
  }
  html[dir="rtl"] .parent {
    animation: scroll-collagear 28s linear infinite;
  }


  /* Mobile Logo Carousel */
  .logo-carousel-section {
    padding-left: 0;
  }
  .logo-carousel-section .header-text h2 {
    font-size: 1.5rem;
  }
  html[dir="rtl"] .slide-track {
    
    animation: scrollar 28s linear infinite;
  }
  
  @keyframes scrollar {
    0% {
      transform: translateX(-100);
    }
    100% {
      transform: translateX(calc(250px * 14));
    } /* Updated for 14 items */
  }
  /* Mobile Features Section */
  .features-section {
    padding: 4rem 1rem;
  }
  .scroll-path-container {
    display: none;
  }
  .feature-row,
  .feature-row:nth-child(odd) {
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 4rem;
    margin-left: auto;
    margin-right: auto;
  }
  .feature-content {
    text-align: center;
  }
  .feature-image-container .blob-svg {
    width: 130%;
  }
  .feature-benefits {
    align-items: center;
    justify-content: center;
    display: inline-flex;
    flex-direction: column;
  }

  /* Mobile Top Courses Section */
  .top-courses-section h2 {
    font-size: 2.2em;
  }
  .top-courses-section {
    padding: 4rem 1rem;
  }
.courses-container {
  align-items: center;
   flex-direction: column;
  }

}

