@use '../../../styles/mixins';

.root {
  cursor: pointer;

  @include mixins.with-vt-type('profileBusinessHours');
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon {
  align-self: flex-start;
  margin-top: 1rem;
}

.left {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.bottom {
  overflow: hidden;
  display: flex;
  flex-direction: column;

  max-height: 25rem;

  /* stylelint-disable-next-line plugin/no-low-performance-animation-properties */
  transition: max-height 0.25s ease-in-out, opacity 0.25s ease-in-out;
}

.collapsed {
  max-height: 0;
  opacity: 0;
}

.status {
  font-size: 0.875rem;
  color: var(--color-error);
}

.status-open {
  color: var(--color-active);
}

.arrow {
  margin-inline-end: 0.375rem;
  font-size: 1.25rem;
  color: var(--color-text-secondary);

  @include mixins.with-vt-type('profileBusinessHours');
}

.offset-trigger {
  z-index: 1;

  display: inline-block;
  align-self: flex-end;

  margin-bottom: 0.25rem;
  padding: 0 0.5rem;
  border-radius: 0.75rem;

  font-size: 0.875rem;
  color: var(--color-primary);

  background-color: var(--color-primary-tint);

  transition: background-color 0.2s ease-in-out;

  &:hover {
    background-color: var(--color-primary-opacity);
  }

  @include mixins.with-vt-type('profileBusinessHours');
}

.transition {
  height: 0;
  margin-bottom: 0.5rem;
}

.timetable {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;

  margin-top: 0.6875rem;
  margin-bottom: 0;
}

.schedule {
  justify-self: end;

  margin-bottom: 0;

  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: end;
}

.weekday {
  font-size: 0.875rem;
  line-height: 1.25;
  word-break: break-all;
}

.current-day {
  color: var(--color-primary);
}

@include mixins.on-active-vt('profileBusinessHours') {
  &::view-transition-image-pair(.businessHours) {
    overflow: hidden;
  }

  &::view-transition-old(.businessHours),
  &::view-transition-new(.businessHours) {
    animation-name: none;
  }
}
