/* CSS específico para o componente HighlightCard (highlight-card.css) */
@import url('../fonts.css');
@import url('../colors.css');

.highlight-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden !important;
  background: var(--white-color);
  width: 100%;
  max-width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 0.75rem !important;
  min-height: 300px;
  height: 300px; /* Altura fixa para todos os cards */
}

/* Badges de admin para highlight cards */
.highlight-card .admin-badges-container {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0.5rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

.highlight-card .status-badge {
  background-color: var(--yellow-color);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--black-color);
}

/* Layout horizontal: 40% imagem / 60% conteúdo */
.highlight-card .row {
  height: 100%;
  margin: 0;
}

.highlight-card-image-col {
  padding: 0 !important;
  flex: 0 0 40% !important;
  max-width: 40% !important;
}

.highlight-card-content-col {
  padding: 0 !important;
  flex: 0 0 60% !important;
  max-width: 60% !important;
}

.highlight-card-image-container {
  position: relative;
  overflow: hidden;
  background-color: var(--gray-background-color);
  /* Garantir que sempre tenha um fundo caso a imagem não carregue */
  background-image: url('/assets/images/ad-card-default.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Regras específicas para diferentes tipos de imagem */
.highlight-card-img {
  object-fit: cover;
  object-position: center;
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  /* Permite que a imagem se ajuste mantendo proporção e centralizando */
}

/* Para imagens que devem preencher completamente o espaço */
.highlight-card-image-container.fill-space .highlight-card-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* Ajuste para imagens com proporções específicas */
.highlight-card-img[style*='aspect-ratio'] {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* Fallback para imagens que não carregaram */
.highlight-card-image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/assets/images/ad-card-default.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.5;
  z-index: -1;
}

.highlight-card-body {
  background: var(--white-color);
  padding: 1rem;
  height: 100%;
  width: 100%;
  border-top-right-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.highlight-card-type {
  font-size: 0.8rem;
  color: var(--black-color);
  font-weight: 600;
}

.highlight-card-code {
  font-size: 0.75rem;
  background-color: var(--yellow-color);
  color: var(--black-color);
  font-weight: 500;
}

.highlight-card-title {
  font-size: 1rem;
  color: var(--black-color);
  line-height: 1.3;
  font-weight: 700;
}

.highlight-card-location {
  font-size: 0.8rem;
  color: var(--black-color);
  font-weight: 500;
}

.highlight-card-location i {
  color: var(--black-color);
  font-size: 0.9rem;
}

.highlight-card-price {
  font-size: 1rem;
  color: var(--black-color);
  font-weight: 700;
}

.highlight-card-desc {
  font-size: 0.8rem;
  color: var(--black-color);
  word-break: break-word;
  display: -webkit-box;
  line-clamp: 6;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.5rem;
}

.highlight-card-infos {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
  align-items: flex-end;
  max-width: calc(100% - 2rem);
}

.bg-setting-info {
  background-color: var(--badge-bg-color);
  color: var(--black-color);
  font-weight: 600;
}

.bg-setting-info i {
  color: var(--black-color);
}

/* Responsividade - mantendo layout horizontal e altura fixa */
@media (max-width: 768px) {
  .highlight-card {
    height: 260px; /* Altura fixa menor para tablets */
  }

  .highlight-card-title {
    font-size: 0.9rem;
  }

  .highlight-card-price {
    font-size: 0.9rem;
  }

  .highlight-card-body {
    padding: 0.75rem;
  }

  .highlight-card-desc {
    font-size: 0.75rem;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: calc(1.4em * 2);
  }

  .highlight-card-infos {
    bottom: 0.75rem;
    right: 0.75rem;
    max-width: calc(100% - 1.5rem);
  }

  .highlight-card-infos .bg-setting-info {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }
}

@media (max-width: 576px) {
  .highlight-card {
    height: 220px; /* Altura fixa menor para celulares */
  }

  .highlight-card-body {
    padding: 0.5rem;
  }

  .highlight-card-title {
    font-size: 0.85rem;
  }

  .highlight-card-type,
  .highlight-card-location {
    font-size: 0.7rem;
  }

  .highlight-card-code {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }

  .highlight-card-desc {
    font-size: 0.7rem;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: calc(1.4em * 2);
  }

  .highlight-card-infos {
    bottom: 0.5rem;
    right: 0.5rem;
    gap: 0.15rem;
    max-width: calc(100% - 1rem);
  }

  .bg-setting-info {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
  }
}

@media (max-width: 480px) {
  .highlight-card {
    height: 200px; /* Altura fixa menor para telas muito pequenas */
  }

  .highlight-card-body {
    padding: 0.4rem;
  }

  .highlight-card-title {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }

  .highlight-card-location {
    margin-bottom: 0.25rem;
  }

  .highlight-card-price {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }

  .highlight-card-desc {
    font-size: 0.65rem;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: calc(1.4em * 2);
  }

  .highlight-card-infos {
    bottom: 0.4rem;
    right: 0.4rem;
    max-width: calc(100% - 0.8rem);
  }

  .highlight-card-infos .bg-setting-info {
    font-size: 0.6rem;
    padding: 0.08rem 0.25rem;
  }
}
