: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-progress-bar.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;
}

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

.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;
}

.bill-list-item a {
  text-decoration: none;
  color: inherit;
}

.bill-list-item a:hover {
  text-decoration: underline;
}

.bill-list-item wa-icon-button.delete::part(base) {
  color: red;
}

@media (max-width: 799px) {
  #bills-page .header {
    justify-content: center;
  }
  #bills-page .dropdown {
    position: fixed;
    right: 1rem;
    top: 8px;
    z-index: 200;
  }
  .bill-list-item {
    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;
  }
  .bill-list-item > :nth-child(1) {
    /* Bill Name */
    grid-area: name;
    justify-self: start;
    font-size: 1.2rem;
  }
  .bill-list-item > :nth-child(2) {
    /* Bill Amount */
    grid-area: amount;
    align-self: flex-start;
    justify-self: end;
    text-align: right;
    font-size: 1.2rem;
  }
  .bill-list-item > :nth-child(3) {
    /* Paid Checkbox */
    grid-area: paid;
    justify-self: start;
  }
  .bill-list-item > :nth-child(4) {
    /* Actions/Buttons */
    grid-area: actions;
    justify-self: end;
  }
}
