body {
  background-color: #F0F0F0;
  color: #19183B;
    font-family: "Nunito", sans-serif;
}

* {
    box-sizing: border-box;
}

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

  width: 90%;
  max-width: 1000px;
  margin: 0 auto;

  padding: 20px 0;
}

.navbar-logo img {
  width: 200px;
  margin-left: 20px;
   margin-top: 10px;
}

.navbar-links {
  display: flex;
  gap: 0px;
  border: 1px solid #BEBEBE;
  border-radius: 25px;
}


.navbar-links a {
  text-decoration: none;
  padding: 10px 20px;
  color: black;
  border-radius: 25px;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}


.navbar-links a:hover {
  background-color: #E7E7E7;
}

.navbar-links a:first-child {
  border-radius: 25px 0 0 25px;
}

.navbar-links a:not(:first-child):not(:last-child) {
  border-radius: 0;
}

.navbar-links a:last-child {
  border-radius: 0 25px 25px 0;
}

.container {
  max-width: 1000px;
  width: 90%;
  margin: 0 auto;
}

.dashboard {
  display: grid;
  grid-template-columns: 50% 50%;
  gap: 20px;
  align-items: stretch;
  margin-top: 20px;
}


.transactions-section {
  grid-column: 1 / 3;
}

.card {
    padding-top: 25px;
    padding-bottom: 15px;
    border-radius: 25px;
    background-color: white;
    padding-left: 30px;
    padding-right: 30px;
}



#form-title {
  margin: 1px 0 -8px;
  font-weight: 500;
}

#form-title + .form-group {
  margin-top: 10px;
}


h2 {
  font-weight: 500;
  margin-top: 10px;
}

form {
    display: flex;
    flex-direction: column; 
    gap: 20px;
}


.section-icon {
  font-size: 1.4rem;
  color: #7E86D9;
  margin-right: 7px;
  background-color: #E7EAFF;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


.form-group {
  display:flex;
  flex-direction: column;
  gap: 10px;
}

input, select {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-family: "Nunito", sans-serif;
  border-radius: 10px;
   border: 1px solid #BEBEBE;
   box-sizing: border-box;
}

 #category {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

#add-transaction{
  align-self: center;
  width: 150px;
  height: 48px;
  padding: 15px;
  border: 0px;
  border-radius: 10px;
  margin-top: 15px;
  margin-bottom: 15px;
  background-color: #7E86D9;
  color: white;
  cursor: pointer;
  font-weight: 500;
}

#add-transaction:hover {
  background: #747bc9;
}


#cancel-edit {
  display: none;
  width: 100px;
  height: 48px;
  padding: 15px;
  border: 0px;
  border-radius: 10px;
  margin-top: 15px;
  cursor: pointer;
  background: #EAEAEA;
  color: #333;
}

#cancel-edit:hover {
  background: #E4E4E4;
}

.form-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}


.dashboard-summary {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

#balance-date {
  font-size: 1rem;
  color: #222;
}

.balance-card {
 flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.balance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}


.balance-card h2 {
margin: 0;
}

#current-balance {
  font-size: 3rem;
  margin-top: 5px;
  margin-bottom: 0;
}

.summary-income-expenses {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  flex: 1;
}

.summary-item:first-child {
  padding-top: 0px;
}

.summary-item {
  display: flex;
  align-items: flex-start;
}

.summary-icon {
  margin-right: 20px;
  font-size: 1.8rem;
  color: black;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-item + .summary-item {
  margin-top: 30px;
}

.summary-item:first-child .summary-icon {
  background: #E6F4EA;
  color: #4C8461;
}

.summary-item:last-child .summary-icon {
  background: #FFF0E1;
    color: #B85C00;
}

#total-income {
  font-size: 2rem;
}

#total-expenses {
  font-size: 2rem;
}

.summary-change {
  margin-left: auto;
}

.summary-info p {
  margin-top: 0px;
}

.summary-item:first-child {
  border-bottom: 1px solid #e6eaf3;
}

.income-change {
  color: #4C8461;
}

.expense-change {
  color: #B85C00;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box,
#category-filter,
#sort-filter {
    padding: 10px 14px 10px 14px;
    border-radius: 10px;
    background-color: #F6F6F6;
     appearance: none;
}


.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.search-box input {
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
}

#category-filter,
#sort-filter {
    width: 200px;
    cursor: pointer; 
    border: none;
    outline: none;
    color: #535353;
    appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 45px;
}

#transactions {
  padding-left: 0;
}

#transactions li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 6px;
  transition: transform 0.2s ease;
  padding: 18px 0;
}

#transactions li:hover {
    transform: translateY(-2px);
}

#transactions li:not(:last-child) {
    border-bottom: 1px solid #e6eaf3;
    
}

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

.transaction-description {
    font-weight: 600;
    text-transform: capitalize;
}

.transaction-amount {
    font-weight: 600;
}

.edit-button {
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  background-color: white;
  font-size: 1.2rem;
}

.delete-button {
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  background-color: white;
  font-size: 1.2rem;
}

.edit-button:hover {
  opacity: 0.9;
}

.delete-button:hover {
  opacity: 0.9;
}

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

.transaction-info {
    display: flex;
    flex-direction: column;
}

.transaction-date {
    font-size: 0.85rem;
}

.icon-span {
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.income-icon {
  color: #4C8461;
  background-color:  #E6F4EA;
  width: 38px;
  height: 38px;
  border-radius: 10px;

}

.expense-icon {
  color: #B85C00;
 background-color: #FFF0E1;
   width: 38px;
  height: 38px;
  border-radius: 10px;

}

.income-amount {
  color: #4C8461;
}

.expense-amount {
  color: #B85C00;
}


.delete-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.delete-modal.show {
  display: flex;
}

.delete-modal-content {
  background: white;
  padding: 25px;
  border-radius: 18px;
  width: 400px;
}

.delete-modal-content h3 {
  margin-bottom: 10px;
}

.delete-modal-content p {
  margin-bottom: 25px;
}

.delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.delete-modal-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.delete-modal-actions button:first-child {
  background: #EAEAEA;
  color: #333;
}

.delete-modal-actions button:last-child {
  background: #7E86D9;
  color: white;
}
.delete-modal-actions button:first-child:hover {
  background: #E4E4E4;
}

.delete-modal-actions button:last-child:hover {
  background: #7279C6;
}

.delete-modal-actions button {
  transition: background 0.2s ease;
}

.delete-modal-content h3 i {
  margin-right: 8px;
}

.reports-section {
  width: 100%;
  grid-column: 1 / 3;
}

.reports-chart {
  width: 100%;
  padding: 20px;
}

#spending-chart {
  width: 100%;
  margin-top: 30px;
}

.reports-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.reports-header strong {
  font-size: 1.2rem;
  font-weight: 600;
}

.reports-header button {
  margin-top: 10px;
  margin-right: 15px;
}

#export-csv {
  width: 130px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background-color: #E7EAFF;
  cursor: pointer;
  color: #7E86D9;
  font-weight: 500;
}

#export-csv:hover {
  background: #dfe2fa;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 400px;
}

@media (max-width: 768px) {

    .navbar {
    flex-direction: column;
    gap: 10px;
    padding: 10px 20px;
  }

  .navbar-logo img {
    width: 175px;
    margin: 0;
  }

  .navbar-links a {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .transactions-section,
  .dashboard-summary,
  .reports-section {
    grid-column: 1;
    min-width: 0;
  }

  .card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

   .filter-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .search-box {
    grid-column: 1 / 3;
    width: 100%;
    box-sizing: border-box;
  }

  #category-filter,
  #sort-filter {
    width: 100%;
    box-sizing: border-box;
  }

  .transaction-right {
  gap: 8px;
  }

   .transaction-right button {
    width: 35px;
  }

    .transaction-left {
    min-width: 0;
    flex: 1;
  }

  .transaction-info {
    min-width: 0;
  }

  .reports-header {
    flex-direction: row;
    align-items: flex-start;
  }

  #export-csv {
    width: 40px;
    height: 40px;
    padding: 0;
    flex-shrink: 0;
    color: #454A9E;
  }

  #export-csv span {
    display: none;
  }

    .chart-container {
    height: 450px;
  }
}


@media (max-width: 1000px) and (min-width: 769px) {

    .balance-header h2{
    font-size: 1.3rem;
  }

  #balance-date {
    font-size: 0.8rem;
  }

  #form-title {
  font-size: 1.3rem;
}

  .summary-info span {
    font-size: 1rem;
  }

  .summary-change {
    font-size: 0.8rem;
    white-space: nowrap;

  }

    .summary-icon {
    width: 55px;
    height: 55px;
  }

  .summary-icon i {
    font-size: 1.6rem;
  }

  #total-income,
  #total-expenses {
    font-size: 1.7rem;
  }

.summary-item {
  padding: 7px 0;
}
}

