/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Gabarito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    background-color: #f8f8f8;
}

/* Navbar */
.navbar {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid black;
    gap: 10px;
    align-items: center;
    background-color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.navbar__s1__title {
    color: #a435f0;
    font-size: 24px;
}

.navbar__s2 {
    padding: 10px;
    border: 1px solid black;
    border-radius: 30px;
    width: 60%;
    display: flex;
    gap: 10px;
    align-items: center;
    background-color: white;
}

.navbar__s2 input {
    border: none;
    font-size: 16px;
    width: 100%;
}

.navbar__s2 input:focus {
    outline: none;
}

.navbar__s3 {
    display: flex;
    gap: 10px;
    align-items: center;
}

.navbar__s3 p {
    transition: color 0.3s ease;
    cursor: pointer;
}

.navbar__s3 p:hover {
    color: #a435f0;

}
.navbar__s4 {
  display: none;
  font-size: 22px;
  cursor: pointer;
  position: relative;
  z-index: 100;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 60px; /* Adjust based on your navbar height */
  right: 20px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 10px;
  z-index: 999;
}

.dropdown-menu p {
  padding: 10px;
  margin: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-menu p:hover {
  background-color: #f0f0f0;
}

/* my learning pop-up */
.mylearning {
    position: relative;
    cursor: pointer;
}
.mylearning__popup {
    display: none;
    position: absolute;
    top: 150%;
    left: 0;
    background-color: white;
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.mylearning:hover .mylearning__popup {
    display: block;
}

/* Categories */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* equal width boxes */
    gap: 15px;
    padding: 20px;
    margin-top: 10px;
    background-color: white;
    border-bottom: 1px solid black;
    box-sizing: border-box;
}

.categories p {
    background-color: #a435f0;
    color: white;
    padding: 12px 10px;
    border-radius: 30px;
    font-weight: 600;
    text-align: center;
    margin: 0;
    cursor: pointer;
    border: 1px solid #a435f0;
    transition: all 0.3s ease;
    
    /* make all boxes same height */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* wrap text inside */
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;

    /* make content responsive */
    font-size: clamp(12px, 1.2vw, 16px); /* auto-scales font */
    box-sizing: border-box;
}

.categories p:hover {
    background-color: transparent;
    color: black;
    border: 1px solid #a435f0;
}




/* Sale Image */
.sale-image {
    position: relative;
}
.sale-image img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.sale-image__offer {
    position: absolute;
    top: 300px;
    left: 100px;
    background-color: white;
    color: black;
    width: 35%;
    max-width: 90vw;           /* responsive max width */
    height: auto;              /* let height grow as needed */
    padding: 2%;
    border-radius: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;    /* stack content vertically */
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: bold;
    word-wrap: break-word;     /* wrap long words */
    overflow-wrap: break-word; /* modern equivalent */
    overflow: hidden;          /* hide any overflow */
    animation-name: zoom;
    opacity: 0;
    animation-fill-mode: forwards;
    animation-duration: 2s;
}

@keyframes zoom {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* Recommended Section */
.recommended {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.recommended__container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

/* Course Card */
.course-card {
    width: 300px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
    cursor: pointer;
    flex-grow: 1;
    flex-basis: 20%; /* allows cards to grow and shrink */
    margin: 5px;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.course-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.course-card:hover img {
    transform: scale(1.03);
}

.course-card h3 {
    font-size: 16px;
    margin: 10px 0 5px;
}

.course-card p {
    font-size: 14px;
    margin: 4px 0;
    color: #333;
}

/* Topics Section */
.topics {
    padding: 10px 20px;
    text-align: center;
}

.topics__title {
    font-size: 20px;
    margin-bottom: 10px;
}

.topics__container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    justify-content: space-around;
}

.topics__container p {
    border: 2px solid gray;
    padding: 10px 16px;
    border-radius: 20px;
    flex-grow: 1;
    flex-basis: 25%;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
}

.topics__container p:hover {
    background-color: #a435f0;
    color: white;
    border-color: #a435f0;
}

/* Popular Section */
.popular {
    padding: 20px;
}

.popular__container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

/* Footer */
.footer {
    padding: 30px;
    background-color: black;
    color: white;
}

.footer__one {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.footer__one p {
    margin: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.footer__one p:hover {
    color: #a435f0;
}

.footer__two {
    margin: 20px;
    align-items: center;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 14px;
}
/* media queries */

@media screen and (max-width: 600px) {
  .navbar__s4 {
    display: block; /* Show hamburger on small screens */
  }

  .course-card {
    flex-basis: 40%;
  }

  .categories {
    display: none;
  }

  .navbar__s3 {
    display: none;
  }
  .dropdown-menu {
    display: none; /* default hidden, shown via JS */
  }
}

@media screen and (max-width: 800px) {
  body {
    font-size: 10px;
  }
}



    
   

