/* 🌈 HabitGullak Universal Styles — Responsive and Adaptive */

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(180deg, #ffb6c1 0%, #40e0d0 50%, #87cefa 100%);
  margin: 0;
  color: #333;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === HEADER === */
header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(30, 30, 30, 0.45);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 35px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 999;
}

header h1 {
  flex: 1;
  text-align: center;
  font-size: 1.6em;
  margin: 0;
  letter-spacing: 0.5px;
}

header button,
.back-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

header button:hover,
.back-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

/* === PIGGY BANKS === */
.piggy-box {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 35px;
  margin: 25px auto;
}

.piggy {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 95px;
  height: 95px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1em;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease;
}

.piggy:hover {
  transform: scale(1.08);
}

/* === MAIN CONTAINER === */
.container {
  width: 95%;
  max-width: 1300px;
  margin: 80px auto 120px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 35px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

/* === TABLES === */
table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}

th {
  background: linear-gradient(90deg, #ffb6c1, #40e0d0, #87cefa);
  color: #fff;
  padding: 12px;
  font-size: 1em;
}

td {
  text-align: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
  color: #333;
}

/* History scrollable container for mobile/tablet */
.table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.table-scroll::-webkit-scrollbar {
  height: 6px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(7, 1, 60, 0.52);
  border-radius: 4px;
}

/* === FOOTER === */

 footer {
  position: fixed;
  bottom: 0;
  left: 0;                /* ✅ Ensure it starts from left edge */
  width: 100%;            /* ✅ Full width across screen */
  background: rgba(30, 30, 30, 0.65);
  color: #f5f5f5;
  text-align: center;
  padding: 12px 10px;
  font-size: 0.9em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;          /* ✅ Keeps it above all elements */
}

/* Optional: Add bottom padding to main content so it doesn’t hide behind footer */
body {
  margin: 0;
  padding-bottom: 60px;   /* 👈 Prevents overlap with fixed footer */
  font-family: "Poppins", sans-serif;
}

/* === RESPONSIVE ADJUSTMENTS === */

/* Tablet (≤ 992px) */
@media (max-width: 992px) {
  header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  header h1 {
    font-size: 1.3em;
  }

  .container {
    width: 94%;
    padding: 25px;
  }

  th, td {
    font-size: 0.9em;
    padding: 8px;
  }

  .piggy {
    width: 80px;
    height: 80px;
    font-size: 0.9em;
  }

  /* Scrollable history */
  .table-scroll {
    display: block;
    overflow-x: auto;
  }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.1em;
  }

  .container {
    width: 96%;
    padding: 20px;
  }

  th, td {
    font-size: 0.85em;
    padding: 6px;
  }

  .piggy {
    width: 70px;
    height: 70px;
    font-size: 0.85em;
  }

  .piggy-box {
    gap: 20px;
  }

  /* Keep horizontal scroll for large tables */
  .table-scroll {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  button, .back-btn {
    padding: 6px 14px;
    font-size: 0.85em;
  }
}
