.job-card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    align-items: start;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.title-text {
  display: flex;
  flex-direction: column;
  margin-right: 100px; /* Needed space for the buttons */
}

.job-card-logo-title h4 {
    font-size: 1.2em;
    color: #004aad;
    margin: 0;
}

.company-line {
    margin: 4px 0 0 0;
    font-size: 0.95rem;
    color: #444;
}

.job-card h5 {
    grid-column: span;
    /* Title takes full width */
    font-size: 1.2em;
    color: #6366f1;
    /* Updated title color */
    margin-bottom: 10px;
}


.job-card p {
    margin: 5px 0;
    color: #555;
}

.apply-button {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  background-color: #6366f1;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s;
  grid-column: auto;
  justify-self: start;
}
.apply-button:hover {
    background-color: #3e41ee;
}


.action-buttons {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.job-card:hover .action-buttons {
  opacity: 1;
  pointer-events: auto;
}

.share-btn {
  border: 1px solid #ccc;
  padding: 10px;
  background-color: #6366f1;
  color: white;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.save-job-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background-color: #6366f1;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.save-icon {
  color: white;
  font-size: 18px;
  transition: opacity 0.2s ease;
}

.share-icon {
  width: 18px;
  height: 18px;
}

/* Hover states */
.share-btn:hover,
.save-job-button:hover {
  background-color: #3e41ee;
}

.job-requirements ul {
  columns: 2;              
  -webkit-columns: 2;
  -moz-columns: 2;
  column-gap: 2rem;        
  padding-left: 1.2rem;    
}


.job-requirements li {
  margin-bottom: 0.5rem;
}

.job-requirements {
  grid-column: span 3;
}

.job-badge-columns > div {
  margin-right: 3rem;
}

@media only screen and (max-width: 767px) {
  .job-card {
    grid-template-columns: 1fr; /* Stack vertically */
  }

  .job-card > * {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    grid-column: span 1 !important; 
  }

  .job-requirements {
    columns: 1;
  }

  .job-requirements ul {
    columns: 1;
    -webkit-columns: 1;
    -moz-columns: 1;
  }

  .job-badge-columns {
    flex-direction: column !important;
  }

  .job-card-logo-title {
    flex-direction: row;
    align-items: center;
  }

  .title-text {
    margin-right: 0;
    margin-bottom: 0;
    flex: 1;
  }

  .job-card-logo-title img {
    object-fit: contain;
  }

  .job-card-logo-title h4 {
    line-height: 1.3;
  }
}

.ai-star-wrapper {
  position: relative;
  display: inline-block;
}

.ai-star {
  width: 25px;
  height: 25px;
  color:#3e41ee;
  cursor: pointer;
  transform: translateY(-2px);
}

.ai-popup {
  position: absolute; /* will be overridden by JS */
  background-color: #efefef;
  color: #444;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-in-out;
  pointer-events: auto; /* so it can receive clicks */
  max-width: 250px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ai-star-wrapper:hover .ai-popup,
.ai-star-wrapper:focus-within .ai-popup,
.ai-star-wrapper:focus .ai-popup {
  opacity: 1;
  visibility: visible;
}

.ai-popup-container {
  position: relative;
  width: max-content;
  height: auto;
  overflow: visible;
  z-index: 1;
}