/* Font imports for Poppins and Raleway*/
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Raleway:wght@300;400;500;600;700&display=swap');

/* Reset any potential inherited properties */
html body .course-grid,
html body .course-item,
html body .image-wrapper,
html body .course-title {
  box-sizing: border-box;
}

/* Main grid container with high specificity */
html body .course-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  column-gap: 180px !important; /* Very wide horizontal gaps */
  row-gap: 30px !important; /* Reduced from 50px to 30px for better vertical spacing */
  max-width: 1500px !important;
  width: 95% !important;
  margin: 60px auto !important;
  padding: 30px !important;
}

/* Course item styling */
html body .course-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  margin-bottom: 40px !important; /* Increased from 20px to 40px for more space between rows */
  position: relative !important;
  width: 100% !important;
}

/* Image wrapper styling with added link functionality */
html body .image-wrapper {
  position: relative !important;
  width: 100% !important;
  padding-bottom: 100% !important;
  overflow: visible !important; /* Allow elements to extend beyond container */
  border-radius: 0.40rem !important;
  cursor: pointer !important;
  transform: scale(1.5) !important;
  transform-origin: center center !important; /* Centered scaling */
  margin-bottom: 70px !important; /* Reduced from 140px to 70px */
  transition: transform 0.5s ease-in-out !important;
  will-change: transform !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  /* Make the entire area clickable */
  display: block !important;
  text-decoration: none !important;
}

/* Image styling */
html body .u-image-1 {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 0.40rem !important;
  display: block !important;
  border: none !important;
  transition: all 0.3s ease-in-out !important; /* Changed to 'all' to include box-shadow */
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

/* Enhanced shadow effect on hover */
html body .image-wrapper:hover .u-image-1 {
  box-shadow: 0 15px 35px rgba(134, 181, 173, 0.3),
              0 5px 15px rgba(0, 0, 0, 0.1) !important; /* 3D lift effect with brand color */
}

/* Price tag styling */
html body .image-wrapper::before {
  content: attr(data-price-label) !important;
  position: absolute !important;
  top: 30px !important;
  left: 0 !important;
  width: 96px !important;
  height: 56px !important;
  padding: 0 15px !important; /* Slightly increased for better text spacing */
  background-color: rgba(134, 181, 173, 1.0) !important;
  border-radius: 0 3rem 3rem 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  font-family: 'Poppins', 'Raleway', sans-serif !important;
  font-weight: 600 !important;
  font-size: 1.40rem !important;
  color: white !important;
  opacity: 0 !important;
  transition: opacity 0.5s ease-in-out !important; /* Faster transition */
  z-index: 10 !important;
  transform: scale(0.67) !important; /* Counteract parent scaling */
  transform-origin: left center !important;
  pointer-events: none !important; /* Prevents interfering with clicks */
}

/* Button styling */
html body .image-wrapper::after {
  content: attr(data-button-text) !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  padding: 9px 0 !important;
  background-color: rgba(232, 152, 141, 1.00) !important;
  color: white !important;
  font-family: 'Poppins', 'Raleway', sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.96rem !important;
  text-align: center !important;
  /* text-transform: uppercase !important; */ /* Commented out as in your code */
  border-radius: 0 0 0.40rem 0.40rem !important;
  opacity: 0 !important;
  transition: opacity 0.5s ease-in-out !important; /* Faster transition */
  z-index: 10 !important;
  transform: scale(1) !important;
  transform-origin: center bottom !important;
  left: 0 !important;
  right: 0 !important;
  pointer-events: none !important; /* Prevents interfering with clicks */
}

/* Hover effect for the image wrapper */
html body .image-wrapper:hover {
  transform: scale(1.65) !important; /* Your custom scale value */
  z-index: 100 !important; /* Higher z-index to ensure it stays on top */
}

/* Show interactive elements on hover */
html body .image-wrapper:hover::before,
html body .image-wrapper:hover::after {
  opacity: 1 !important;
}

/* Course title styling with link styles */
html body .course-title {
  font-size: 1.4rem !important;
  font-weight: 550 !important;
  font-family: 'Poppins', 'Raleway', sans-serif !important;
  margin: 0 !important;
  margin-top: 10px !important; /* Added explicit margin-top */
  margin-bottom: 30px !important; /* Added explicit margin-bottom */
  color: #86B5AD !important;
  text-align: center !important;
  position: relative !important;
  z-index: 5 !important;
  padding-top: 0 !important; /* Removed padding-top */
}

/* Link styling within course titles */
html body .course-title a {
  color: #86B5AD !important;
  text-decoration: none !important;
  transition: color 0.3s ease-in-out !important;
}

html body .course-title a:hover {
  color: #E8988D !important; /* Change to salmon color on hover */
}

/* Page title styling */
html body .page-title {
  font-size: 2.7rem !important;
  font-weight: 600 !important;
  font-family: 'Poppins', 'Raleway', sans-serif !important;
  margin: 40px 0 !important;
  color: #86B5AD !important;
  text-align: center !important;
}

/* Body font styling */
.u-body {
  color: #111111;
  background-color: #ffffff;
  font-family: 'Poppins', 'Raleway', 'Open Sans', sans-serif;
}

/* Base paragraph styling - Added from store.css */
p.u-content-1.u-text {
  font-family: 'Poppins', 'Raleway', sans-serif;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: normal;
  text-align: justify !important;
}

/* Content alignment classes - Added from store.css */
.u-content {
  align-content: center;
  text-align: center;
}

.u-content-1 {
  align-content: left;
  text-align: left;
  margin: 0 0 0 0;
}

/* Keep paragraphs justified - Added from store.css */
.u-content-1.u-text p {
  text-align: justify !important;
}

/* Text styling - Added from store.css */
.u-text {
  word-wrap: break-word;
  position: relative;
  margin: 0 0 0 0;
}

/* Container styling for proper margins - From store.css */
.u-content.u-sheet.u-sheet-1 {
  max-width: 1140px;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 30px;
  padding-right: 30px;
}

/* Responsive adjustments with high specificity */
@media (max-width: 1400px) {
  html body .course-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    column-gap: 140px !important;
    row-gap: 30px !important; /* Adjusted row gap */
  }
  
  html body .image-wrapper {
    transform: scale(1.4) !important;
    margin-bottom: 60px !important; /* Reduced from 130px */
    transform-origin: center center !important; /* Ensure centered scaling */
  }
  
  html body .image-wrapper:hover {
    transform: scale(1.55) !important; /* Adjusted hover scale */
  }
  
  html body .image-wrapper::before {
    transform: scale(0.71) !important; /* 1/1.4 to counteract parent scaling */
    top: 30px !important; /* Consistent positioning */
  }
  
  /* Bottom button doesn't need counter-scaling */
  html body .image-wrapper::after {
    transform: scale(1) !important;
  }
}

@media (max-width: 1000px) {
  html body .course-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    width: 95% !important;
    padding: 0 30px !important;
    column-gap: 100px !important;
    row-gap: 25px !important; /* Adjusted row gap */
  }
  
  html body .image-wrapper {
    transform: scale(1.3) !important;
    margin-bottom: 55px !important; /* Reduced from 120px */
    transform-origin: center center !important; /* Ensure centered scaling */
  }
  
  html body .image-wrapper:hover {
    transform: scale(1.45) !important; /* Adjusted hover scale */
  }
  
  html body .image-wrapper::before {
    transform: scale(0.77) !important; /* 1/1.3 to counteract parent scaling */
    top: 30px !important; /* Consistent positioning */
  }
  
  /* Bottom button doesn't need counter-scaling */
  html body .image-wrapper::after {
    transform: scale(1) !important;
  }
  
  html body .page-title {
    font-size: 2.2rem !important;
  }
  
  /* Responsive paragraph styling */
  p.u-content-1.u-text {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .u-content.u-sheet.u-sheet-1 {
    width: 90%;
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 575px) {
  html body .course-grid {
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
    row-gap: 15px !important; /* Adjusted row gap */
  }
  
  html body .image-wrapper {
    transform: scale(1.1) !important;
    margin-bottom: 50px !important; /* Reduced from 90px */
    transform-origin: center center !important; /* Ensure centered scaling */
  }
  
  html body .image-wrapper:hover {
    transform: scale(1.25) !important; /* Less dramatic scale on mobile */
  }
  
  html body .image-wrapper::before {
    transform: scale(0.91) !important; /* 1/1.1 to counteract parent scaling */
    top: 30px !important; /* Consistent positioning */
  }
  
  /* Bottom button doesn't need counter-scaling */
  html body .image-wrapper::after {
    transform: scale(1) !important;
  }
  
  html body .page-title {
    font-size: 1.8rem !important;
  }
  
  /* Responsive paragraph styling */
  p.u-content-1.u-text {
    font-size: 0.95rem;
  }
}

/* GST tag styling */
html body .image-wrapper .gst-tag {
  position: absolute !important;
  top: 76px !important; /* Position it below the price tag */
  left: 0 !important;
  width: auto !important;
  min-width: 44px !important;
  height: 24px !important;
  padding: 0 10px !important;
  background-color: rgba(134, 181, 173, 0.8) !important; /* Same as price tag but slightly transparent */
  border-radius: 0 1rem 1rem 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  font-family: 'Poppins', 'Raleway', sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.7rem !important; /* Smaller font size */
  color: white !important;
  opacity: 0 !important; /* Initially hidden like the price tag */
  transition: opacity 0.8s ease-in-out !important;
  z-index: 9 !important; /* Just below the price tag */
  transform: scale(0.67) !important; /* Same as price tag */
  transform-origin: left center !important;
  pointer-events: none !important;
  letter-spacing: 0.5px !important; /* Slightly spaced letters for better legibility */
}

/* Show GST tag on hover */
html body .image-wrapper:hover .gst-tag {
  opacity: 1 !important;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  html body .image-wrapper .gst-tag {
    transform: scale(0.71) !important;
    top: 80px !important;
  }
}

@media (max-width: 1000px) {
  html body .image-wrapper .gst-tag {
    transform: scale(0.77) !important;
    top: 80px !important;
  }
}

@media (max-width: 575px) {
  html body .image-wrapper .gst-tag {
    transform: scale(0.91) !important;
    top: 80px !important;
  }
}
