/* #region Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  font-family: "Ubuntu", sans-serif;
  color: #ffffff;

  background: #090979;
  background: linear-gradient(
    90deg,
    rgb(6, 6, 78) 0%,
    rgba(2, 0, 36, 1) 50%,
    rgba(6, 6, 78) 100%
  );
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  scroll-behavior: smooth;
}
h1,
h2 {
  font-weight: 700;
}
h3 {
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
img {
  display: block;
  max-width: 100%;
}
main {
  margin-bottom: 58px;
}
.container:not(.footer-container) {
  min-width: 260px;
  max-width: 320px;
  margin: 0 auto;
  padding: 16px;
  background-color: rgba(255, 255, 255, 0.137);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}
.section {
  padding: 32px 0;
}
.positive-text {
  color: var(--positive);
}
.negative-text {
  color: var(--negative);
}
/* #endregion */

/* #region root */
:root {
  --positive: #4ade80;
  --negative: #ef5350;
  --neutral: #ffffff28;
  --sub-text: rgba(255, 255, 255, 0.603);
}
/* #endregion */

/* #region Reset */
button {
  cursor: pointer;
}
a {
  text-decoration: none;
  color: currentColor;
}
ul,
ol {
  list-style: none;
  padding-left: 0;
  margin: 0;
  padding: 0;
}
address {
  font-style: normal;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}
/* #endregion */

/* #region Common */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}
/* #endregion */

/* #region header section */
.balance-label {
  font-size: 12px;
  color: rgb(255, 255, 255);
}
.total-balance {
  color: rgb(255, 255, 255);
}
.stats-wrapper {
  gap: 12px;
  margin-top: 8px;
  display: flex;
  justify-content: center;
}
.cashflow-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background-color: rgba(105, 240, 174, 0.15);
  border-radius: 10px;
  flex-grow: 1;
}
.income-icon {
  fill: var(--positive);
}
.expenses-icon {
  fill: var(--negative);
}
.income-wrapper {
  background-color: rgba(105, 240, 174, 0.15);
}
.stat-label {
  font-size: 14px;
}
.income-value {
  font-size: 16px;
  font-weight: bold;
  /* color: black; */
  color: var(--positive);
}
.expenses-wrapper {
  background-color: rgba(255, 82, 82, 0.15);
}
.expenses-value {
  font-size: 16px;
  font-weight: bold;
  color: var(--negative);
}
/* #endregion */

/* #region Spending overview */
.spending-overview-wrapper {
  padding: 24px;
  height: 350px;
  border-radius: 14px;
  /* border: 1px solid #ff1818; */
  /* box-shadow: 0px 4px 6px rgba(255, 1, 1, 0.288); */
}
.spending-overview-title {
  margin-bottom: 16px;
}
/* #endregion */

/* #region history */
.history {
}
.section {
}
.container {
}
.history-container {
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  /* background-color: var(--neutral); */
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  /* border: 1px solid #e0e0e0; */
  border-radius: 15px;
}
.history-item-wrapper {
  flex-direction: column;
}
.history-title {
  margin-bottom: 16px;
}
.history-item-title {
}
.history-item-amount {
}
.expenses-value {
}
.history-item-description {
  padding: 5px 0 0 0;
  font-size: 12px;
  color: var(--sub-text);
}
/* #endregion */

/* #region footer */
/*
FIRST VERSION
.footer {
  background-color: rgba(48, 48, 48, 0.233);
  background: linear-gradient(to top, #0f0f1a 60%, rgba(15, 15, 26, 0) 100%);
  backdrop-filter: blur(5px);
  padding: 0 24px;
  bottom: 0;
  left: 0;
  position: fixed;
  width: 100%;
  z-index: 100;
  border: none;
} */
/* SECOND VERSION */
/* .footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;

  
  background: linear-gradient(to top, #0f0f1a 60%, rgba(15, 15, 26, 0) 100%);

  padding-top: 20px;
  padding-bottom: 10px;

  
  border: none;
} 
*/
/* ACTIVE VERSION */
.footer {
  position: fixed;
  bottom: 0;
  width: 100%;

  background-color: rgba(15, 15, 26, 0.7);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.container {
}
.footer-container {
}
.footer-nav {
}
.footer-nav-list {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.footer-nav-item {
}
.footer-nav-icon {
  fill: white;
}
.nav-link {
  display: flex;
  align-items: center;
  flex-direction: column;
  color: white;
  font-size: 12px;
  padding: 15px;

  background-color: transparent;
  border: none;
}
/* #endregion */

/* #region modal window */
.backdrop {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1;

  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;

  background-color: rgba(0, 0, 0, 0.486);
  align-items: flex-end;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* приховуємо елемент */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;

  transition:
    opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.backdrop.is-open {
  opacity: 1;
  pointer-events: initial;
  visibility: visible;
  transition-delay: 0ms;
}
.backdrop.is-open .modal {
  opacity: 1;
  transform: translateY(0);
}
.modal {
  position: absolute;

  width: 100%;
  max-height: 80vh;
  padding: 15px;
  overflow-y: auto;

  border-radius: 24px 24px 0 0;
  box-shadow:
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12),
    0 2px 1px 0 rgba(0, 0, 0, 0.2);
  background-color: rgba(79, 78, 85, 0.199);

  opacity: 0;

  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.btn-x-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  position: absolute;
  top: 24px;
  right: 24px;

  padding: 0;

  width: 24px;
  height: 24px;

  border: none;
  background-color: transparent;
}
.btn-x-icon:hover .x-icon,
.btn-x-icon:focus .x-icon {
  border: none;
  fill: var(--neutral);
}
.btn-x-icon .x-icon {
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.x-icon {
  fill: white;
}

.modal-caption {
  max-width: 360px;
  margin-bottom: 16px;
  font-weight: 500;
  text-align: center;
  justify-content: center;
  color: #2e2f42;
}
/* #endregion */

/* #region modalForm */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;

  justify-content: center;
  align-items: center;

  padding: 12px;
}
.transaction-type-selector {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 20px;

  width: 100%;
  /* max-width: 500px; */
}
.transaction-type-selector input[type="radio"] {
  display: none;
}
.input-selector-label {
  padding: 8px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  text-align: center;
  flex-grow: 1;
  cursor: pointer;
  transition: all 0.3s ease;
}
#typeIncome:checked + .input-selector-label {
  background-color: rgba(255, 67, 50, 0.116);
  color: var(--negative);
  border-color: var(--negative);
}
#typeExpense:checked + .input-selector-label {
  background-color: rgba(67, 255, 50, 0.116);
  backdrop-filter: blur(10px);
  color: var(--positive);
  border-color: var(--positive);
}
.form-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 18px;
}
.input-label {
  color: rgba(255, 255, 255, 0.596);
}
.form-input {
  width: 100%;
  padding: 20px;
  border: none;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  outline: none;
  transition: all 0.3s ease;
}
.form-input:hover,
.form-input:focus {
  border-color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.form-input option {
  background-color: #2e2f42;
  color: #ffffff;
}
.form-button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.form-button:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}
.form-button:active {
  transform: translateY(1px);
  opacity: 0.8;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* For Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}
/* #endregion */
