@import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap");

:root {
  --color-red: rgb(223, 42, 42);
  --color-green: rgb(40, 193, 40);
  --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Lato", sans-serif;
  font-size: 16px;
}
h2 {
  margin-bottom: 0.8rem;
}
h3 {
  font-size: 1.3rem;
}
li,
a {
  list-style: none;
  text-decoration: none;
}
.hidden {
  display: none;
}
section {
  width: 100%;
}
section h3 {
  text-align: center;
}
button {
  height: 2.5rem;
  width: 10rem;
  font-size: 1rem;
  background-color: #000000;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid black;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}
button:hover {
  transform: scale(1.05);
}
.secondary-button {
  background-color: transparent;
  color: #000000;
  border: none;
  box-shadow: none;
}

/* Logo */
.logo {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  gap: 0.3rem;
  margin: 1.5rem 0 3rem 0;
}
.logo img {
  width: 25px;
  height: 25px;
}

/* Main */
main {
  width: 100%;
  min-height: 70svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 0 16px;
}
.balance-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}
.total-balance {
  font-size: 3rem;
  font-weight: bold;
}
.balance-content {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
}
.expenses-category,
.income-category {
  color: #999;
}
.income-content,
.expenses-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* Movimenti */
.transactions-wrapper {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Form */
#transactions {
  position: relative;
}
.form-title {
  margin-bottom: 2rem;
}
form {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 1rem;
}
/* Tutti i campi del form */
.form input,
.form select,
.form textarea {
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: "Lato", sans-serif;
  font-size: 1rem;
  text-align: start !important;
  transition: all 0.3s ease;
  background-color: #fff;
  color: #000000 !important;
  appearance: none;
}
.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: #909090;
  box-shadow: var(--shadow);
  outline: none;
}
.form input::placeholder,
.form textarea::placeholder {
  color: #999;
  font-style: italic;
}
.form select {
  background-color: none;
  cursor: pointer;
}
label span {
  font-size: 1.1rem;
  line-height: 2rem;
  margin-left: 0.5rem;
}
.alert-error {
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 2rem;
  background-color: #eeeeee;
  border-radius: 8px;
  position: absolute;
  z-index: 10;
  bottom: 60%;
  left: 50%;
  transform: translate(-50%);
  box-shadow: var(--shadow);
}

/* Transazioni */
#icon-toggle {
  transition: transform 0.3s ease;
}
.expenses-wrapper {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;

  text-align: center;

  margin-bottom: 2rem;
}
.transactions-content {
  display: flex;
  justify-content: center;
  align-items: center;

  margin-bottom: 1rem;

  cursor: pointer;
}
.expenses-list {
  width: 100%;
  max-width: 600px;
  border-collapse: collapse;
  margin-top: 1rem;
  position: relative;
  margin-bottom: 5rem;
}
.expenses-list th,
.expenses-list td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid #ccc;
}
.expenses-list th {
  background-color: #f0f0f0;
  font-weight: bold;
}
.expenses-list td.positive,
.income.highlight {
  color: var(--color-green);
}
.expenses-list td.negative,
.expenses.highlight {
  color: var(--color-red);
}
.expenses-list th,
.expenses-list td {
  text-align: center;
}
.action-delete {
  cursor: pointer;
}
.remove-transaction-alert {
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 2rem 1rem;
  background-color: #eeeeee;
  border-radius: 8px;
  position: absolute;
  z-index: 10;
  left: 50%;
  transform: translate(-50%);
  box-shadow: var(--shadow);
}
.buttons-wrapper {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Footer */
footer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
/* Languages */
.lang-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}
.lang-flag {
  width: 30px;
  height: 30px;
  transition: transform 0.3s ease;

  cursor: pointer;
}
.lang-flag:hover {
  transform: scale(1.05);
}
@media (max-width: 350px) {
  button {
    width: 100%;
    font-size: 0.8rem;
  }
}
@media (max-width: 768px) {
  .alert-error {
    width: 100%;
  }
  .expenses-list th,
  .expenses-list td {
    font-size: 0.8rem;
  }
  #add-income,
  #add-expenses {
    width: 100%;
    margin: 1rem 0 3rem 0;
  }
  .buttons-wrapper {
    gap: 0;
  }
}
@media (max-width: 1400px) {
  .logo {
    font-size: 0.6rem;
  }
  .logo img {
    width: 16px;
    height: 16px;
  }
  form {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
  }
  form label {
    width: 100%;
  }
  .expenses-list th,
  .expenses-list td {
    padding: 0.8rem 0.2rem;
  }
  footer {
    margin-top: 4rem;
  }
}
