/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
  font-family: 'Poppins', sans-serif;
  margin: 0; padding: 30px;
  background: #e9ecef;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  color: #333;
}

.container {
  background: #ffffff;
  max-width: 480px;
  width: 100%;
  border-radius: 12px;
  padding: 30px 40px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  font-weight: 600;
  color: #2c3e50;
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 20px;
  margin-bottom: 30px;
}

form input[type="text"],
form input[type="number"],
form input[type="date"],
form select {
  padding: 12px 15px;
  border: 1.5px solid #ced4da;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

form input[type="text"]:focus,
form input[type="number"]:focus,
form input[type="date"]:focus,
form select:focus {
  outline: none;
  border-color: #4dabf7;
  box-shadow: 0 0 5px #4dabf7aa;
}

form button {
  grid-column: 1 / -1;
  padding: 14px;
  background-color: #4dabf7;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

form button:hover {
  background-color: #339af0;
}

.balance {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #222f3e;
}

.income-expense {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 30px;
}

.income, .expense {
  flex: 1;
  background: #f1f3f5;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: inset 0 0 5px #dee2e6;
  text-align: center;
}

.income {
  color: #2f9e44;
  font-weight: 600;
  border-left: 5px solid #2f9e44;
}

.expense {
  color: #c92a2a;
  font-weight: 600;
  border-left: 5px solid #c92a2a;
}

.income span, .expense span {
  display: block;
  font-size: 1.25rem;
  margin-top: 6px;
  font-weight: 700;
}

ul.transactions {
  max-height: 320px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  list-style: none;
  border-top: 1px solid #dee2e6;
}

ul.transactions li {
  background: #f8f9fa;
  margin-top: 12px;
  padding: 15px 20px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px #ced4daaa;
  border-left: 5px solid transparent;
  transition: transform 0.15s ease;
}

ul.transactions li.income {
  border-left-color: #2f9e44;
}

ul.transactions li.expense {
  border-left-color: #c92a2a;
}

ul.transactions li:hover {
  transform: translateX(6px);
}

.transactions span {
  font-weight: 600;
  color: #495057;
  min-width: 150px;
  text-align: right;
  font-family: monospace;
}

.delete-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: #868e96;
  cursor: pointer;
  margin-left: 15px;
  transition: color 0.3s ease;
}

.delete-btn:hover {
  color: #c92a2a;
}

/* Scrollbar styling */
ul.transactions::-webkit-scrollbar {
  width: 8px;
}

ul.transactions::-webkit-scrollbar-thumb {
  background-color: #adb5bd;
  border-radius: 6px;
}

@media (max-width: 540px) {
  form {
    grid-template-columns: 1fr;
  }
  
  .income-expense {
    flex-direction: column;
  }

  .income, .expense {
    margin-bottom: 15px;
  }
}
