:root {
    --text-dark: #333;
  }
  
/* Responsive Gradient Background */
.gradient-background {
  min-height: 250px; /* Changed from fixed height to min-height */
  background: linear-gradient(62deg, #2e2cef, #713ce7, #23A6D5, #236dd5);
  animation: gradient 15s ease infinite;
  background-size: 400% 400%;
  color: white !important;
  padding: 30px 0; /* Added padding for better spacing */
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .gradient-background {
    min-height: 200px;
    padding: 20px 0;
  }
  
  .gradient-background h2.text-header {
    font-size: 2.5rem;
  }
}

@media (max-width: 576px) {
  .gradient-background {
    min-height: 180px;
    padding: 15px 0;
  }
  
  .gradient-background h2.text-header {
    font-size: 2rem;
  }
  
  .gradient-background h6 {
    font-size: 0.9rem;
  }
  
  .gradient-background p {
    font-size: 0.9rem;
  }
}
  
  .ag-courses-item_link {
      background-color: #0101010d;
      transition: background-color 0.3s ease-in-out;
      display: block;
      padding: 30px 20px;
      position: relative;
      overflow: hidden;
      border-top-left-radius: 30px;
    border-top-right-radius: 5px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 30px;
      /* for Mozila version less than 3.6  */
      -moz-border-radius-topleft: 30px;
      -moz-border-radius-topright: 5px;
      -moz-border-radius-bottomleft: 5px;
      -moz-border-radius-bottomright: 30px;
    
    /* Shadow */
    box-shadow: 1px 1px 5px 0 rgba(69,69,69,0.5);
  }
  
  .ag-courses-item_link:hover {
    background-color: var(--hover-bg);
    color: #fff !important;
  }
  
  .ag-courses-item_link:hover .ag-courses-item_bg {
    transform: scale(10);
  }
  
  .ag-courses-item_link:hover .btn-card-audience {
    border: 2px solid #ffffff6b !important;
  }
  
  /* Underline Animation */
  .ag-courses-item_title {
    position: relative;
    display: inline-block;
    color: var(--text-dark);
    font-weight: bold;
    font-size: 18px;
    min-height: 1rem;
    margin-bottom: 3rem;
    overflow: hidden;
    z-index: 2;
    width: 100%
    text-align: center;
  }
  
  .ag-courses-item_title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease-in-out;
  }
  
  .ag-courses-item_title:hover::after {
    width: 100%;
  }
  
  .card-count,
  .ag-courses-item_date-box,
  sub,
  p {
    color: var(--text-dark);
  }
  
  .ag-courses-item_date-box {
    font-size: 18px;
    position: relative;
    z-index: 2;
  }
  
  /* Buttons */
  .btn-card-audience {
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
  }
  
  .btn-card-audience:hover {
    color: #fff;
  }
  
  /* Background Circle */
  .ag-courses-item_bg {
    height: 128px;
    width: 128px;
    background-color: #f9b234;
    z-index: 1;
    position: absolute;
    top: -75px;
    right: -75px;
    border-radius: 50%;
    transition: all 0.5s ease;
  }
  
  /* Alternating background colors */
  .ag-courses_item:nth-child(2n) .ag-courses-item_bg {
    background-color: #3ecd5e;
  }
  .ag-courses_item:nth-child(3n) .ag-courses-item_bg {
    background-color: #e44002;
  }
  .ag-courses_item:nth-child(4n) .ag-courses-item_bg {
    background-color: #952aff;
  }
  .ag-courses_item:nth-child(5n) .ag-courses-item_bg {
    background-color: #cd3e94;
  }
  .ag-courses_item:nth-child(6n) .ag-courses-item_bg {
    background-color: #4c49ea;
  }
  
  /* Responsive Styles */
  @media only screen and (max-width: 979px) {
    .ag-courses_item {
      flex-basis: calc(50% - 30px);
    }
    .ag-courses-item_title {
      font-size: 24px;
    }
  }
  
  @media only screen and (max-width: 639px) {
    .ag-courses_item {
      flex-basis: 100%;
    }
    .ag-courses-item_title {
      min-height: 72px;
      font-size: 24px;
    }
    .ag-courses-item_link {
      padding: 22px 40px;
    }
    .ag-courses-item_date-box {
      font-size: 16px;
    }
  }

/* Basic styles for layout */
.ag-courses_box {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 50px 0;
}

.ag-courses_item {
  flex-basis: calc(33.33333% - 30px);
  margin: 0 15px 30px;
  overflow: hidden;
  border-radius: 15px;
  position: relative;
}