/* Ensure all cards have the same height and improved styling */
.card {
  /* height: 350px; */
  display: flex;
  flex-direction: column;
  background-color: #e0e0e0;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

/* Hover effect for interactivity */
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Ensure images maintain aspect ratio and fit within the card */
.card-img-top {
  width: 100%;
  height: 250px;
  object-fit: contain;
  /* background-color: #ffffff; */
  background-color: #eeeeee;
  border-bottom: 1px solid #e0e0e0;
  position: relative;
}

/* Overlay button on hover */
.card-img-top::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.card:hover .card-img-top::after {
  background: rgba(0, 0, 0, 0.5);
}

.quick-look-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 1rem;
  padding: 10px 20px;
  border-color: #ffffff;
  color: #ffffff;
  /* background-color: rgba(44, 62, 80, 0.8); */
  background-color: rgba(44, 62, 80, 0.8);
  border-radius: 5px;
}

.card:hover .quick-look-btn {
  opacity: 1;
}

.quick-look-btn:hover,
.quick-look-btn:focus,
.quick-look-btn:active {
  background-color: #ffbb33;
  border-color: #ffffff;
  color: #ffffff;
  outline: none;
  box-shadow: none;
}

.card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10px;
  /* overflow: hidden; */
  background-color: #ffffff;
  min-height: 0;
  /* Ensure it collapses when empty */
}

/* Enhance typography and reduce padding between title and text */
.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 0.3rem;
  /* overflow: hidden; */
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-text {
  font-size: 0.9rem;
  color: #666666;
  /* overflow: hidden; */
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Modal styling */
.modal-content {
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333333;
}

.modal-dialog {
  max-width: 1000px;
}

.modal-body img {
  max-height: 600px !important;
  /* Increased to 600px with !important to override conflicts */
  height: auto;
  /* Ensure it scales naturally */
  width: 100%;
  max-height: 700px;
  /* Full width of the column */
  object-fit: contain;
  /* Maintain aspect ratio */
  border-radius: 8px;
  background-color: #ffffff;
}

.modal-body h6 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333333;
  margin-top: 10px;
  margin-bottom: 5px;
}

.modal-body p {
  font-size: 0.9rem;
  color: #666666;
  margin-bottom: 10px;
}

.modal-footer {
  border-top: 1px solid #e0e0e0;
}

/* Improve spacing and layout between cards */
.col-md-4 {
  padding: 15px;
}

/* Section heading styling */
h1.text-center {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 768px) {

  .card {
    margin-bottom: 0 !important;
  }


  .card-img-top {
    height: 200px;
  }

  .card-title {
    font-size: 1.1rem;
    white-space: normal;
    /* allow wrapping */
    overflow: visible;
    text-overflow: unset;
  }

  /* Force 2 cards per row on small screens */
  .col-md-4 {
    width: 50%;
    flex: 0 0 50%;
    max-width: 50%;
  }

  .modal-body img {
    max-height: 350px !important;
  }
}
