.contest-card {
  position: relative;
  height: 500px;
  background-size: cover;
  background-position: center;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: transform 0.3s;
}

.cfe-name {
  font-size: 1.35rem;
  display: block;
}

.co-name {
  font-size: 1rem;
  font-weight: 500;
  display: block;
}

.contest-overlay {
  position: absolute;
  top: 0;
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 1.35rem;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 3;
  text-align: center;
  padding: 0 10px;
}

/* Hover overlay */
.contest-hover {
  position: absolute;
  top: 80px;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0,0,0,0.8);
  color: white;
  transform: translateY(-100%);
  transition: transform 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0 20px 20px 10px;
  z-index: 2;
}

.contest-card:hover .contest-hover {
  transform: translateY(0);
}

.hover-text {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.contest-text-container {
  position: relative;
  transition: all 0.3s ease;
  margin-bottom: 0;
}

.contest-text {
  height: 158px;
  overflow: hidden;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 6; /* adjust based on your font size/line height */
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  transition: height 0.3s ease;
}

.contest-text-container.expanded .contest-text {
  max-height: 380px; /* or whatever max you want */
  height: auto;
  overflow-y: scroll;
  -webkit-line-clamp: unset;
  display: block;
  padding-right: 10px; /* to prevent scrollbar from covering text */
}
.contest-text::-webkit-scrollbar {
  width: 8px;
}
.contest-text::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
}


/* Button wrapper */
.read-more-wrapper {
  text-align: right;
  margin-top: 5px;
}

.read-more-btn {
  font-size: 0.85rem;
  color: #fff;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  outline: none;
}

.read-more-btn:hover {
  color: #ccc;
  text-decoration: none;
}

.read-more-btn:focus {
  outline: none;
}

.discount-text {
  font-size: 0.9rem;
  margin-bottom: 0;
  height: 75px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.date-boxes {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.date-box {
  width: 48%;
  background: transparent;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.2;
}

.btn-primary {
  font-size: 1.5rem;
  align-self: center;
  font-weight: 500;
  padding: 0 65px;
}



/* Responsive height for mobile */
@media (max-width: 576px) {
  .contest-card {
    height: 500px;
  }

  .contest-overlay {
    font-size: 1.5rem;
  }

  .contest-text {
    display: block;
  }

  .hover-text {
    padding: 10px;
  }

  .contest-text,
  .discount-text,
  .date-box {
    font-size: 0.8rem;
  }

  .date-box {
    width: 100%;
  }

  .btn-primary {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}