* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;

  background: linear-gradient(135deg, #e0f2fe, #fef3c7, #fbcfe8);
  background-size: 200% 200%;
  animation: bgMove 12s ease infinite;

  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 15px;
  color: #1e293b;

  overflow-x: hidden;
}

@keyframes bgMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#money-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.money {
  position: absolute;
  font-size: 22px;
  animation: fall 2s linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(350px);
    opacity: 0;
  }
}

.container{
  width: 100%;
  padding: 2rem;
}

.app {
  width: 80%;
  padding: 25px;
  margin: 0 auto;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(15px);

  border-radius: 25px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

#type {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;

  background: linear-gradient(135deg, #e0f2fe, #fef3c7);
  color: #1e293b;
  font-weight: 600;
  font-size: 14px;

  outline: none;
  cursor: pointer;

  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: 0.25s;
  margin-bottom: 1rem;
}

#type:hover {
  transform: scale(1.02);
}

#type:focus {
  box-shadow: 0 0 0 2px #3b82f6;
}

.heading {
  text-align: center;
  margin-bottom: 25px;
  font-size: 28px;
  font-weight: 600;
}

.summary {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.card {
  flex: 1;
  padding: 18px;
  border-radius: 16px;
  text-align: center;

  background: white;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);

  transition: 0.25s;
}

.card:hover {
  transform: translateY(-5px);
}

#form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

input, select, button {
  padding: 12px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
}

input, select {
  background: #f1f5f9;
}

button {
  background: linear-gradient(135deg, #34d399, #3b82f6);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  transform: scale(1.03);
}

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

#search, #filter {
  flex: 1;
}

.transactions {
  max-height: 350px;
  overflow-y: auto;
  padding-right: 5px;
}


.transactions::-webkit-scrollbar {
  width: 6px;
}

.transactions::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 10px;
}

.transactions ul {
  list-style: none;
}

.transactions li {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: white;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 14px;

  box-shadow: 0 4px 12px rgba(0,0,0,0.06);

  transition: 0.2s;
}

.transactions li:hover {
  transform: scale(1.02);
}

.left strong {
  font-size: 15px;
}

.left small {
  font-size: 12px;
  color: gray;
}

.right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
  color: white;
}

.badge.income {
  background: #16a34a;
}

.badge.expense {
  background: #dc2626;
}

.amount {
  font-weight: bold;
}

.delete-btn {
  background: #fee2e2;         
  color: #dc2626;              

  border: none;
  border-radius: 8px;

  height: 28px;
  width: 28px;

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;

  transition: all 0.25s ease;  
}

.delete-btn:hover {
  background: #dc2626;
  color: white;
  transform: scale(1.15);
}

.delete-btn:active {
  transform: scale(0.9);
}

@media (max-width: 900px) {
  .app {
    width: 85%;
  }

  .summary {
    flex-wrap: wrap;
  }

  .card {
    flex: 1 1 45%;
  }
}

@media (max-width: 600px) {

  .container{
    padding: 0.5rem;
  }

  .app {
    padding: 15px;
    width: 95%;
  }

  .summary {
    flex-direction: column;
  }

  .controls {
    flex-direction: column;
  }

  .transactions {
    max-height: 350px;
  }

  .transactions li {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .right {
    width: 100%;
    justify-content: space-between;
  }
}