/* ===   Global   === */

:root {
  --dark-blue: #361a5f;
  --modal: #110b21s;
  --blue: #49aa21;
  --light-blue: #1cd705;
  --red: #e92921;
  --white: #ffa;
  --gray: #f0a1f5;
  --table: #919cb3;
  --header: #1d4385;
  --squares: #f0f2f533;
}

.dark-mode:root {
  --dark-blue: #121933;
  --blue: #49aa26;
  --light-blue: #1f7400;
  --red: #f00000;
  --white: #c2c1c2;
  --gray: #6b6169;
  --table: #919cb3;
  --header: #0a2103;
  --modal: #e5e5e5;
  --squares: #6e196933;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

html {
  font-size: 93.75%; /* 15px */
}

body {
  background: var(--blue);
  font-family: "Roboto", sans-serif;
  position: relative;
  background-image: url(./img/s2.jpg);
  background-size: 80%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.container {
  width: min(90vw, 800px);
  margin: auto;
}

/* ===   Titles   === */

h2 {
  margin-top: 3.2rem;
  margin-bottom: 0.8rem;
  color: white;
  font-style: bold;
  font-weight: normal;
}

/* ===   Links and buttons   === */
a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--light-blue);
}

button {
  width: 100%;
  height: 50px;

  border: none;

  color: var(--white);
  background: var(--blue);

  padding: 0;

  cursor: pointer;

  transition: 420ms ease-in-out;

  box-shadow: 10px 10px 10px 10px rgba(255, 90, 0, 0.5);
  border-radius: 25px;
  

}

button:hover {
  background: var(--light-blue);
}

.button.new {
  display: inline-block;
  margin-bottom: 0.8rem;
  position: relative;
  z-index: 99;
  color: white;
  font-family: Roboto;
  font-size: 20px;
  
  border-radius: 6px;
  border-color: #ffffff;
  border-style: solid;
  background-color: white;
  
  box-shadow: 0px 18px 20px 17px rgba(255, 90, 0, 0.6);

}

.button.cancel {
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 0.25rem;

  height: 50px;

  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0.6;
  transition: 420ms ease-in-out;
}

.button.cancel:hover {
  opacity: 1;
}

.button.open-modal-download {
  position: absolute;
  max-width: 200px;
  max-height: 200px;
  padding: 10px;
  margin: 10px;
  left: 3%;
  cursor: pointer;
  z-index: 999;
  box-shadow: 10px 10px 10px 10px rgba(255, 90, 0, 0.5);
}

/* ===   Loading animation   === */
.bg-loader {
  overflow: hidden;

  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;

  z-index: 9999;

  display: flex;
  justify-content: center;
  align-items: center;

  background: var(--header);
}

.logo-loader {
  animation: logoLoader 12s ease infinite alternate;
}

@keyframes logoLoader {
  0% {
    stroke-width: 0;
    stroke-dasharray: 1 100;
  }
  25% {
    stroke-width: 1;
    stroke-dasharray: 100 0;
  }
  60%,
  100% {
    stroke-width: 0.3;
    fill: var(--blue);
  }
}

/* ===   Header   === */

header {
  background: var(--header);
  padding: 2rem 0 10rem;
  text-align: center;
}

#logo {
  color: var(--white);
  font-weight: 100;
}

/* ===   Balance   === */
#balance {
  margin-top: -8rem;
  position: relative;
  z-index: 99;
}

#balance h2 {
  margin-top: 0;
  color: var(--white);
}

/* ===   Cards   === */
.card {
  background: var(--white);
  padding: 1.5rem 2rem;
  border-radius: 15px;

  margin-bottom: 2rem;

  color: var(--dark-blue);
  z-index: 99;
}

.card h3 {
  font-weight: normal;
  font-size: 1rem;

  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 15px;

}

.card p {
  font-size: 2rem;
  line-height: 3rem;

  margin-top: 1rem;
  border-radius: 15px;

}

.card.total {
  background: var(--blue);
  color: var(--white);
  
  color: white;
  border-color: #49aa26;
  border-radius: 15px;
  box-shadow: 10px 10px 10px 10px rgba(255, 90, 0, 0.5);
  
}

/* === Dark mode Button === */

.toggle {
  margin: 1.4rem;
  display: flex;
  justify-content: center;

}

.toggle p {
  color: var(--white);
  margin-right: 0.4rem;
}

input[type="checkbox"] {
  height: 0;
  width: 0;
  visibility: hidden;
}

label.checkbox {
  cursor: pointer;
  text-indent: -9999px;
  width: 52px;
  height: 27px;
  background: grey;
  float: right;
  border-radius: 100px;
  position: relative;
}

label.checkbox::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 90px;
  transition: 0.3s;
}

input:checked + label.checkbox {
  background-color: #0077ff;
}

input:checked + label.checkbox::after {
  left: calc(100% - 5px);
  transform: translateX(-100%);
}

label.checkbox:active:after {
  width: 45px;
}

/* ===   Transactions   === */
#transaction {
  display: block;
  width: 100%;
  overflow-x: hidden;
}

#data-table {
  width: 100%;

  border-spacing: 0 0.5rem;
  color: var(--table);

  position: relative;
  z-index: 999;
}

table thead tr th:first-child,
table tbody tr td:first-child {
  border-radius: 0.25rem 0 0 0.25rem;
  z-index: 99;
}

table thead tr th:last-child,
table tbody tr td:last-child {
  border-radius: 0 0.25rem 0.25rem 0;
  z-index: 99;
}

table thead th {
  background: var(--white);

  font-weight: normal;
  padding: 1rem 2rem;

  z-index: 99;
  text-align: left;
}

table tbody tr {
  z-index: 99;
  opacity: 0.7;
}

table tbody tr:hover {
  opacity: 1;
}

table tbody td {
  background: var(--white);
  z-index: 99;
  padding: 1rem 2rem;
}

td.description {
  color: var(--dark-blue);
}

td.income {
  color: #200ea1;
}

td.expense {
  color: #940c7f;
}

.remove_transaction {
  cursor: pointer;
}

/* ===   Modal   === */
.modal-overlay {
  width: 100%;
  height: 100%;

  background-color: rgba(255, 90, 0, 0.7);

  position: fixed;
  top: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  visibility: hidden;

  z-index: 9999;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--gold);
  padding: 2.4rem;
}

.modal-overlay.download pre {
  margin: 10px;
}

/* ===   Form   === */
#form {
  max-width: 500px;
}

#form h2 {
  margin-top: 0;
  color: var(--modal);
}

.input-group {
  margin-top: 0.8rem;
}

.input-group input {
  border: 0;
  border-radius: 7rem;

  padding: 0.8rem;

  width: 100%;
}

.input-group .help {
  color: var(--modal);
  
}

.input-group.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-group.actions a.button,
.input-group.actions button {
  width: 48%;
}

.error-line {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--red);
  opacity: 0.6;
  width: 0%;
  height: 10px;
}

.input-group.error p {
  text-align: center;
  font-size: 15px;
  font-style: bold;
  color: var(--red);
}

/* ===   Squares animation   === */

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-900px) rotate(960deg);
  }
}

.squares li {
  width: 40px;
  height: 40px;

  opacity: 0.1;
  background-color: rgba(255, 90, 0, 0.5) /* var(--squares); */;

  display: block;
  position: absolute;
  bottom: -40px;
  animation: up 2s infinite alternate;
}

/* ===   Footer   === */
footer {
  text-align: center;
  padding: 4rem 0 2rem;
  color: black;
  font-style: bold;
  font-size: 16px;
  opacity: 0.5;
  background-color: lightgray;
  width: 120px;
  height: 120px;
  position: fixed;
  align-content: center;
  align-items: center;
  margin: 90px;
  
  border-style: solid;
  border-color: darkgreen;
  border-radius: 5px;
  border-size: 10px;

}

/* ===   Responsive   === */
@media (min-width: 800px) {
  html {
    font-size: 87.5%; /* 14px */
  }

  #balance {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}