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

body {
  background: linear-gradient(135deg, #2e8b57, #a8d5ba);
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 1200px;
  padding: 2rem;
  background: #fff;
  border-radius: 16px;
}

.main-title {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 35px;
}

/* Balance */

.balance-container {
  padding: 2rem;
  margin-bottom: 32px;
  text-align: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #a8d5ba, #6b8e23);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.balance-title {
  margin-bottom: 16px;
  font-weight: 500;
}

#balance-amount {
  margin-bottom: 16px;
  font-size: 3rem;
  font-weight: 600;
}

.balance-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.summary-item {
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  transition: transform 300ms ease;
  cursor: pointer;
}

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

.summary-item__title {
  font-size: 1.2rem;
  font-weight: 500;
}

.summary-item__amount {
  font-size: 2rem;
  font-weight: 600;
}

.summary-item.balance-income {
  color: #059669;
  border-color: #059669;
}

.summary-item.balance-expense {
  color: #dc2626;
  border-color: #dc2626;
}

/* Main Content */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.main-content__title {
  font-size: 1.2rem;
  font-weight: 500;
  color: #363636;
  margin-bottom: 16px;
}

/* Scroll Bar */
.transaction-list::-webkit-scrollbar {
  width: 8px;
}
.transaction-list::-webkit-scrollbar-track {
  border-radius: 4px;
  background-color: #f1f1f1;
}
.transaction-list::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: #cbd5e0;
}
.transaction-list::-webkit-scrollbar-thumb:hover {
  background-color: #a0aec0;
}

/* Transactions */

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 8px;
  max-height: 400px;
  overflow-y: auto;
  transition: all 500ms ease;
}

.transaction-item {
  list-style: none;
  padding: 1rem 1.2rem;
  /* display */
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* border */
  border: 1px solid #363636;
  border-right-width: 5px;
  border-radius: 8px;
  /* transition */
  transition: all 300ms ease;
  animation: slideIn 1s ease;
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.transaction-item:hover {
  transform: translateX(5px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.transaction-item:hover .transaction-item__delete-btn {
  opacity: 1;
}

.transaction-item__amount {
  display: flex;
  align-items: center;
  gap: 12px;
}

.transaction-item__delete-btn {
  padding: 8px;
  color: #dc2626;
  background: none;
  cursor: pointer;
  /* border */
  border: none;
  border-radius: 4px;
  /* font */
  font-weight: 700;
  /* transition */
  opacity: 0;
  transition: all 300ms ease;
}

.transaction-item__delete-btn {
  background-color: #fee2e2;
}

.transaction-item.income {
  border-color: #059669;
}

.transaction-item.expense {
  border-color: #dc2626;
}

/* Form */
.form-container {
  padding: 2rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #f6f8fb, #f1f4f8);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.form-container form {
  height: 100%;
  display: flex;
  flex-direction: column;
}

button[type="submit"] {
  display: block;
  width: 100%;
  /* color */
  background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
  color: #fff;
  /* border */
  border: none;
  border-radius: 8px;
  /* font */
  font-size: 1rem;
  font-weight: 600;
  /* margin & padding */
  padding: 14px;
  margin-top: auto;
  /* cursor */
  cursor: pointer;
  /* transition */
  transition: all 300ms ease;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

label {
  font-family: inherit;
  color: #718096;
}

input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  background-color: #fff;
  transition: all 300ms ease;
}

input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input:hover {
  border-color: #cbd5e0;
}

small {
  display: block;
  color: #718096;
  font-size: 0.875rem;
  margin-top: 4px;
}

button[type="submit"] {
  display: block;
  width: 100%;
  /* color */
  background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
  color: #fff;
  /* border */
  border: none;
  border-radius: 8px;
  /* font */
  font-size: 1rem;
  font-weight: 600;
  /* margin & padding */
  padding: 14px;
  margin-top: auto;
  /* cursor */
  cursor: pointer;
  /* transition */
  transition: all 300ms ease;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

button[type="submit"]:active {
  transform: translateY(0);
}

@media (max-width: 900px) {
  .container {
    max-width: 750px;
  }
  .main-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .container {
    max-width: 500px;
  }
  .balance-summary {
    grid-template-columns: 1fr;
  }
}
