:not(:defined) {
  visibility: hidden;
}

body {
  font-family: var(--wa-font-sans);
  margin: 0;
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 1rem;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 100;
}

.htmx-progress-bar {
  position: fixed;
  opacity: 0;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, #b5c3ef, #c38bca, #b5c3ef);
  background-size: 200% 100%;
  animation: shimmer 2.5s linear infinite;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.1s;

  &.htmx-request {
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

#bills-page {
  .header {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .month-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  @media (max-width: 799px) {
    .header {
      justify-content: center;
    }

    .dropdown {
      position: fixed;
      right: 1rem;
      top: 8px;
      z-index: 200;
    }
  }
}

.bill-list-item {
  display: grid;
  align-items: center;
  gap: 1rem;
  grid-template-columns: 3fr 1fr 100px 80px;
  border-bottom: 1px solid #eee;
  margin: 0;
  padding: 5px 0;
  animation: fadeIn 0.4s ease-in-out forwards;

  a {
    text-decoration: none;
    color: inherit;

    &:hover {
      text-decoration: underline;
    }
  }

  wa-button::part(base) {
    height: 30px;
  }

  @media (max-width: 799px) {
    padding: 15px 0 10px;
    display: grid;
    grid-template-areas:
      "name amount"
      "paid actions";
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0.5rem;

    > :nth-child(1) {
      /* Bill Name */
      grid-area: name;
      justify-self: start;
      font-size: 1.2rem;
    }

    > :nth-child(2) {
      /* Bill Amount */
      grid-area: amount;
      align-self: flex-start;
      justify-self: end;
      text-align: right;
      font-size: 1.2rem;
    }

    > :nth-child(3) {
      /* Paid Checkbox */
      grid-area: paid;
      justify-self: start;
    }

    > :nth-child(4) {
      /* Actions/Buttons */
      grid-area: actions;
      justify-self: end;
    }
  }
}
