@import "../variables";

.course-card {
  max-width: 50rem;
  width: 100%;
  border-radius: 0.5rem;
  background: var(--colour-neutral-1100) 100%;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-content: center;
  text-decoration: none;

  &.is-link {
    transition: transform 0.15s, opacity 0.15s;

    &:hover {
      opacity: 0.8;
      transform: translateY(-0.1rem);
    }

    &:active {
      transform: scale(0.99);
    }
  }

  .course-title {
    margin-bottom: 0.5rem;
    font-weight: bold;
  }

  .course-terms {
    margin-top: 0.5rem;
  }

  .course-description {
    margin-top: 0.5rem;
    color: var(--colour-neutral-500);
  }

  &__content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  &__row {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
    gap: 0.5rem;
  }

  &.instructor-card {
    .course-title {
      margin-bottom: 1rem;
    }
  }
}

// Course details component (always inline, not fixed positioned)
.course-details-inline {
  background: var(--colour-neutral-1100) 100%;
  margin-top: 0.5rem;
  padding: 0.5rem 0.5rem 1rem 0.5rem;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  line-height: 1.25em;
  margin-bottom: 1rem;

  .back-arrow {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;

    svg {
      width: 1.25rem;
      height: 1.25rem;
      color: var(--colour-neutral-300);
      transition: color 0.2s ease;
    }

    .back-arrow-icon {
      font-size: 1.5rem;
    }

    &:hover {
      background-color: var(--colour-neutral-1000);

      svg {
        color: var(--colour-neutral-100);
      }
    }
  }

  .course-info-header {
    padding: 0.5rem 0 0 0.5rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    font-size: 1.5rem;
    color: var(--colour-sosy-green-500);
  }

  .course-info {
    padding: 0.5rem 0 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .reddit-section {
    padding-left: 0.5rem;
    border-top: 1px solid var(--colour-neutral-1000);
    margin-top: 1rem;
  }
}
