@media (max-width: 1024px) {
  .first-section {
    grid-template-columns: 1fr;
    height: auto;
  }

  .second-section {
    flex-direction: column;
  }

  .left-part {
    width: 100%;
    position: static;
  }

  .right-part {
    width: 100%;
  }

  .pie-wrapper {
    width: 100%;
    height: auto;
  }

  .pie-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
  }

  #expensePieChart {
    max-width: 250px;
    max-height: 250px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 58%;
  }

  .navbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    height: auto;
  }

  .navleft-part {
    display: flex;
    flex-direction: column;
  }
  main {
    padding: 13rem 1rem 2rem 1rem;
  }

  .buttons {
    flex-direction: column;
  }

  #income-btn,
  #expense-btn {
    width: 100%;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .transaction-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .transaction-item .right {
    width: 100%;
    justify-content: space-between;
  }

  .pie-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    margin-top: 2rem;
  }

  #expensePieChart {
    max-width: 250px;
    max-height: 250px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 55%;
  }

  .navbar {
    padding: 1rem;
  }

  #expense-tracker {
    font-size: 2.2rem;
  }

  #manage-finance {
    font-size: 1.2rem;
  }

  main {
    padding: 10rem 1rem 2rem 1rem;
  }

  .first-section {
    gap: 1.5rem;
  }

  .total-balance,
  .total-income,
  .total-expense {
    padding: 1.6rem;
  }

  #balance-amount,
  #income-amount,
  #expense-amount {
    font-size: 2.2rem;
  }

  .left-part {
    padding: 1.6rem;
  }

  .right-part {
    gap: 2rem;
  }

  .barchart h2,
  .expense-breakdown h2,
  .filter-section h2 {
    font-size: 1.8rem;
  }

  .add-btn button {
    font-size: 1.4rem;
  }

  .transaction-item {
    padding: 10px;
  }

  .transaction-item .icon {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .action-icons i {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .pie-wrapper {
    width: 100%;
    height: 200px;
  }

  .pie-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
  }

  #expensePieChart {
    max-width: 250px;
    max-height: 250px;
  }
}

@media (max-width: 480px) {
  .footer {
    font-size: 1.2rem;
    padding: 1rem;
  }
}

@media (max-width: 360px) {
  html {
    font-size: 50%;
  }

  .add-btn button {
    padding: 8px;
  }

  .transaction-item .info h4 {
    font-size: 1.2rem;
  }
  .first-right-pie {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
  }

  .pie-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
  }

  #expensePieChart {
    max-width: 250px;
    max-height: 250px;
  }
}
