@import url(https://fonts.googleapis.com/css?family=Carrois+Gothic:regular);

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

body {
  /* background: linear-gradient(135deg, #5e37a3, #cacef2);*/
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #2d3436;
  /* Layer 1: Checkerboard pattern (semi-transparent) */
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.15) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.15) 75%),
    /* Layer 2: Existing gradient background */
    linear-gradient(135deg, #5e37a3, #cacef2);

  /* Size of checkerboard squares */
  background-size: 40px 40px;

  /* Positioning for the checkerboard layers */
  background-position:
    0 0,
    0 20px,
    20px -20px,
    -20px 0,
    /* checkerboard offsets */ 0 0; /* gradient layer */
}

.container {
  width: 100%;
  max-width: 1200px;
  background-color: #fff;
  padding: 2rem;
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.8);
}

h1 {
  text-align: center;
  color: 1a202c;
  margin-bottom: 35px;
  font-size: 4.2rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.title {
  text-align: center;
  color: 1a202c;
  margin-bottom: 35px;
  font-size: 4.2rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  font-family: "Carrois Gothic", sans-serif;
  border-bottom: 4px solid #1c1e19;
}

h2 {
  color: 2d3748;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.balance-container {
  text-align: center;
  margin-bottom: 35px;
  padding: 24px;
  background: linear-gradient(135deg, #a6d7ba, #648720);
  border-radius: 1rem;
  box-shadow: 0 6px 13px rgba(0, 0, 0, 0.6);
}

#balance {
  font-size: 3rem;
  margin: 15px 0;
  font-family: "poppins", sans-serif;
}

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.income,
.expenses {
  background-color: #fff;
  padding: 24px;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease;
}

.income:hover,
.expenses:hover {
  transform: translateY(-5px);
}

.income h3 {
  color: #059669;
  font-size: 1.1rem;
  font-weight: 500;
}

.expenses h3 {
  color: #dc2626;
  font-size: 1.1rem;
  font-weight: 500;
}

.income p,
.expenses p {
  margin-top: 8px;
  font-size: 1.75rem;
  font-weight: 600;
}

.income p {
  color: #059669;
}

.expenses p {
  color: #dc2626;
}

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

#transaction-list {
  list-style: none;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
  flex-grow: 1;
}

/*scrollbar*/
#Transaction-list::-webkit-scrollbar {
  width: 8px;
}

#Transaction-list::-webkit-scrollbar-track {
  /*track is the scrollbar background*/
  background-color: #f1f1f1;
  border-radius: 4px;
}

#Transaction-list::-webkit-scrollbar-thumb {
  /*thumb is the scrollbars dragable part*/
  background-color: #cbd5e0;
  border-radius: 4px;
}

#Transaction-list::-webkit-scrollbar-thumb:hover {
  background-color: #a0aec0;
}

/*transaction entry tiles*/
.transaction {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  margin-bottom: 12px;
  border-radius: 12px;
  background-color: #f5f4f4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  border-right: 5px solid;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.transaction:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

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

.transaction .delete-btn {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 1.4rem;
  opacity: 0;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: 12px;
}

.transaction:hover .delete-btn {
  opacity: 1;
}

.transaction .delete-btn:hover {
  background-color: #fee2e2;
  transform: scale(1.1);
}

.form-container {
  background: linear-gradient(135deg, #d7e4e8, #e9edef);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #4a5568;
  font-weight: 500;
}

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

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

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

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

button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2e9159 0%, #45c980 100%);
  color: #ffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2); /* maybe consider changing this */
  margin-top: auto;
}

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

button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/*responsive design*/

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

  #transaction-list {
    max-height: 300px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 24px;
  }

  .summary {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .balance-container h1 {
    font-size: 2rem;
  }

  .income p,
  .expenses p {
    font-size: 1.5rem;
  }

  .transaction {
    padding: 14px 16px;
  }

  h1 {
    font-size: 1.8rem;
  }
}
