/* Scoped styles for the Recent Bills section on the homepage */

#recentBillsSection {
  margin-top: 3rem;
}

/* When authenticated, hide howItWorks safely via CSS as a fallback */
body[data-auth-logged-in="true"] #howItWorks { display: none !important; }

#recentBillsSection .recent-group {
  /* No panel background here so title + icon sit OUTSIDE the bill cards */
  padding: 0rem;
  margin-bottom: 1.3rem;
}

/* Hide external title rows; we'll render titles inside card headers */
#recentBillsSection .recent-title-row { display: none; }

#recentBillsSection .recent-title {
  font-size: 1.3rem;
  font-weight: 700;
}

#recentBillsSection .recent-title.owed { color: #fff; }
#recentBillsSection .recent-title.paid { color: #fff; }

#recentBillsSection .recent-title-icon {
  width: 15px;
  height: 15px;
}

/* Reuse my-bills card look, scoped so it does not affect other lists */
#recentBillsSection .bills-list {
  margin-top: 0.25rem;
  max-height: none;
  overflow-y: visible;
}

#recentBillsSection .bill-item {
  display: flex;
  flex-direction: column;
  padding: 0 1rem;
  margin-bottom: 1rem;
  background: #252538;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#recentBillsSection .bill-item:hover { background: #2a2a3e; }

#recentBillsSection .bill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 50px;
  width: 100%;
  border-bottom: 1px solid #302F41;
  margin-bottom: 1rem;
  padding: 0;
  margin-top: 0.25rem;
}

#recentBillsSection .bill-date {
  font-size: 0.9rem;
  color: #7C7C88;
  font-weight: 400;
  text-align: left;
}

/* Inline title block inside header */
#recentBillsSection .recent-title-block { display: flex; flex-direction: column; }
#recentBillsSection .recent-title-inline { display: flex; align-items: center; gap: 8px; margin-top: 0.75rem; }
#recentBillsSection .recent-title-text { font-size: 1.3rem; font-weight: 700; }
#recentBillsSection .recent-title-text.owed { color: #fff; }
#recentBillsSection .recent-title-text.paid { color: #fff; }
#recentBillsSection .recent-title-inline .recent-title-icon { width: 16px; height: 16px; margin-top: -0.15rem }
#recentBillsSection .recent-date-small { font-size: 0.9rem; color: #7C7C88; margin-top: 0.5rem; margin-bottom: 0.5rem; }

#recentBillsSection .complete-button {
  width: 90px;
  height: 25px;
  background-color: #3B3A4B;
  border-radius: 6px;
  color: #7C7C88;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 6px;
  gap: 4px;
  font-family: 'Heebo', sans-serif;
  box-sizing: border-box;
  overflow: hidden;
  margin-top: -1rem;
}

#recentBillsSection .complete-button.active { color: #16C887; }

#recentBillsSection .complete-button .checkbox-icon {
  width: 10px;
  height: 10px;
  background-image: url('../img/my_bills_checkbox.png');
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
  margin-top: -0.15rem;
}

#recentBillsSection .complete-button.active .checkbox-icon {
  background-image: url('../img/my_bills_checkbox_filled.png');
}

#recentBillsSection .bill-names {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  align-items: flex-start;
  padding: 0.5rem 0 1.5rem 0;
  text-align: left;
}

#recentBillsSection .bill-name {
  font-weight: 400;
  font-size: 1rem;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: left;
}

#recentBillsSection .bill-name:hover { color: #16C887; }

#recentBillsSection .view-all-bills-btn {
  display: block;
  width: 100%;
  height: 60px;
  background-color: #252538;
  color: #8D87FF;
  font-size: 16px;
  font-weight: 400;
  border: none;
  border-radius: 15px;
  margin-top: 0.25rem;
}


/* ================= Skeleton Loader (Recent Bills only) ================= */
#recentBillsSection .skeleton-card {
  background: #252538;
  border-radius: 15px;
  padding: 0 1rem; /* keep existing horizontal padding */
  margin-bottom: 1rem;
  height: 130px; /* requested cell height */
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center the bars within the card */
}

#recentBillsSection .skeleton-line {
  height: 20px;              /* requested bar height */
  border-radius: 7px;        /* requested bar radius */
  background: #303042;
  animation: recent-pulse 1.2s ease-in-out infinite;
}

/* width helpers for the three bars */
#recentBillsSection .skeleton-w50 { width: 50%; }
#recentBillsSection .skeleton-w75 { width: 75%; }
#recentBillsSection .skeleton-w100 { width: 100%; }

@keyframes recent-pulse {
  0% { opacity: 0.55; }
  50% { opacity: 1; background: #464656; }
  100% { opacity: 0.55; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #recentBillsSection .skeleton-line { animation: none; }
}
