@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
  --primary-color: #000080;
  --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  font-size: 62.5%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  font-size: 1.6rem;
}

::-webkit-scrollbar-track {
  background-color: #FFF;
}
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
}

body {
  background-color: #f7f7f7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* Menu de navegação */
header {
  padding: 24px 0;
  background-color: var(--primary-color);
  width: 100%;
}

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

.navMenu {
  list-style: none;
  padding-left: 40px;
  display: flex;
  justify-content: space-evenly;
  gap: 60px;
}

nav a {
  position: relative;
  text-decoration: none;
  color: #FFF;
  font-size: 1.36rem;
  font-weight: 400;
}

nav li a::after {
  content: '';
  border-bottom: 2px solid #FFF;
  position: absolute;
  top: 1px;
  left: 0;
  transition: 0.3s ease-in-out;
  opacity: 0;
  height: 100%;
}

nav li a:hover::after {
  animation: hoverEffect 0.5s forwards;
  opacity: 1;
}

@keyframes hoverEffect {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.hamburger {
  display: none;
  cursor: pointer;
  margin-left: 10%;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  border-radius: 5px;
  margin: 5px auto;
  -webkit-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
  background-color: #fff;
}

.loginBtn {
  margin-right: 3%;
  padding: 5px 35px;
  border-radius: 5px;
  border: 1px solid #fff;
  position: relative;
  z-index: 1;
  display: inline-block;
  overflow: hidden;
  transition: color 1s;
}

.hoverBtn:hover {
  color: var(--primary-color);
}

.hoverBtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50px;
  z-index: -1;
  width: 0;
  height: 100%;
  background-color: #fff;
  transform: skewX(35deg);
  transition: width 1s;
}

.hoverBtn:hover::before {
  width: 160%;
}

/* Conteúdo principal | Controle de despesas */
main {
  width: 100%;
}

.container {
  margin: 30px auto;
  max-width: 560px;
  width: 80%;
}

h2 {
  font-size: 2.6rem;
  text-align: center;
}

.balance {
  letter-spacing: 1px;
  color: #2e75cc;
  font-size: 3.2rem;
  text-align: start;
}

h3 {
  font-size: 2.2rem;
  border-bottom: 1px solid #bbb;
  padding-bottom: 10px;
  margin: 40px 0 10px;
}

h4 {
  font-size: 2rem;
}

.incExpContainer {
  background-color: #fff;
  box-shadow: var(--box-shadow);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
}

.incExpContainer > div {
  flex: 1;
  text-align: center;
}

.incExpContainer > div:first-of-type {
  border-right: 1px solid #dedede;
}

.money {
  font-size: 2rem;
  letter-spacing: 1px;
  margin: 5px 0;
}

.money.plus {
  color: #2ecc71;
}

.money.minus {
  color: #c0392b;
}

label {
  display: inline-block;
  margin: 10px 0;
}

input[type='text'],
input[type='number'] {
  border: 1px solid #dedede;
  border-radius: 2px;
  display: block;
  font-size: 1.6rem;
  padding: 10px;
  width: 100%;
}

form small {
  color: #505050;
  font-size: 1.4rem;
  display: block;
}

.btn {
  width: 100%;
  background-color: #0303fc;
  box-shadow: var(--box-shadow);
  border: none;
  color: #fff;
  font-weight: 700;
  display: block;
  font-size: 1.6rem;
  margin: 10px 0 30px;
  padding: 10px;
  cursor: pointer;
  transition: 0.3s ease-in-out;
}

.btn:hover {
  background-color: var(--primary-color);
}

.btn:focus,
.delete-btn:focus {
  outline: 0;
}

.transactions {
  list-style-type: none;
  padding: 0;
  margin-bottom: 40px;
}

.transactions li {
  background-color: #fff;
  box-shadow: var(--box-shadow);
  color: #333;
  display: flex;
  justify-content: space-between;
  position: relative;
  padding: 10px;
  margin: 10px 0;
}

.transactions li.plus {
  border-right: 5px solid #2ecc71;
}

.transactions li.minus {
  border-right: 5px solid #c0392b;
}

.deleteBtn {
  background-color: #e74c3c;
  border: none;
  border-radius: 50%;
  padding: 4px 9px;
  color: #fff;
  font-size: 1.6rem;
  line-height: 20px;
  position: absolute;
  top: 50%;
  left: -5px;
  opacity: 0;
  transform: translate(-100%, -50%);
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.transactions li:hover .deleteBtn {
  opacity: 1;
}

.error {
  color: #f25252;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  padding: 5px;
  display: none;
}

.error i {
  font-size: 1.4rem;
}

/* Rodapé */
footer {
  width: 100%;
  height: 60px;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

footer ul {
  list-style: none;
  color: #FFF;
  font-size: 0.89rem;
  display: flex;
  gap: 15px;
}

footer ul a {
  color: #FFF;
  text-decoration: none;
}

/* Media queries */
@media (max-width: 860px) {
  .hamburger {
    display: block;
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .navMenu {
    position: absolute;
    left: -100%;
    top: 50px;
    gap: 0;
    flex-direction: column;
    background-color: var(--primary-color);
    width: 100%;
    text-align: center;
    transition: 0.3s;
  }

  .navItem {
    margin: 16px 0;
  }

  .navMenu.active {
    left: 0;
  }

  .loginBtn {
    margin-right: 10%;
  }
}