/* General Styling */
body {
  font-family: "Poppins", Arial, sans-serif;
}

.courses-container {
  text-align: center;
  padding: 20px;
  margin: 20px;
}

.courses-container h1 {
  font-size: 44px;
  margin-bottom: 20px;
  color: #846baa;
}

/* Paragraph styling */
p {
  margin-top: 20px;
  margin-bottom: 40px;
  font-size: 1em;
  color: #555;
  line-height: 1.6;
}

/* Grid Layout for Courses */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Keep 4 columns */
  gap: 30px; /* Reduced gap for a tighter layout */
  max-width: 1200px;
  margin: 0 auto;
}

/* Course Item Styling */
.course-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 200px; /* Reduced height */
}

.course-item:hover {
  transform: scale(1.05);
}

.course-item img {
  width: 100%;
  height: 100%; /* Make image height fit new cell height */
  object-fit: cover; /* Ensures image remains proportional within the cell */
  border-radius: 8px;
}

/* Course Name Overlay */
.course-name {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 20px;
  padding: 10px;
  text-align: center;
  border-radius: 0 0 8px 8px;
  box-sizing: border-box;
  transition: transform 0.3s ease;
}


/* Popup Modal Styling */
.popup-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  overflow: auto;
}

.popup-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width:900px;
  display: flex;
  flex-direction: column;
  align-items: left;
  gap: 15px;
}

/* Popup content styling */
#popupImage {
  width: 100%;
  max-width: 200px; /* Adjusted to reduce the image size */
  height: auto;
  border-radius: 8px;
}


.popup-description {
  font-size: 16px;
  color: #333;
  text-align: justify;
  padding: 10px;
}

.close-btn {
  color: #FF9900;
  font-size: 30px;
  position: absolute;
  top: 10px;
  right: 25px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover {
  color: #bbb;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .courses-grid {
    grid-template-columns: 1fr;
  }
}
