/* GLOBAL PROPERTIES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
  }
@font-face {
  font-family: "INTER";
  src: url("/Personal_Budget_Manager/assets/fonts/Inter/Inter-VariableFont_opsz,wght.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "INTER";
  src: url("/Personal_Budget_Manager/assets/fonts/Inter/Inter-Italic-VariableFont_opsz\,wght.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* CUSTOM PROPERTIES */ 
:root {
/* backgrounds */
  --bg-primary: linear-gradient(135deg, #E4F2FF 0%, #D8F8F2 50%, #DFFFE8 100%);
  --bg-header: #ececec;
  --bg-sidemenu: #ffffff;
  --bg-light: #fafafa;
  --bg-footer: #e5e5e5;

  --h1-hero-color: #0D3B66;
  --white-title-color: #ffffff;

  /* TABLES - category outline */
  --blue-outline: #0d6efd;
  /* navmenu */
  --menu-text-color: #333333;
  --menu-hover-bg-color: #dcdcdc;
  --menu-item-underline: 0.125rem solid #000000;

  /* dashboard-primary-color */
  --income-primary-color: 76 175 80; /*green*/
  --expense-primary-color: 244 67 54; /*red*/
  --balance-primary-color: 0 0 0; /*black*/
  
  /* dashboard items size */
  --dashboard-item-size: 150px;
  --dashboard-quick-item-size: 100px;

  /* font-color */
  --black-font: #000000;

  /* dividers */
  --color-divider-green: #198754;
  --color-divider-gray: #66677A;

  /* progress ring width */
  --ring-width: 5%;

  /* error note color */
  --error-note: #ff0000;
}

/* sections styles */
#main {
  display: flex;
  flex: 1;
  position: relative; /* for main::before*/
  overflow: hidden;
}

#main::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-primary);
  background-repeat: no-repeat;
  background-size: 400% 400%;
  z-index: -1;
  will-change: background-position;
  animation: gradientDiagonal 5s ease infinite;
}

/* main background style */
@keyframes gradientDiagonal {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  #main::before {
    animation: none;
  }
}

#header {
  padding: 1rem 0;
  background-color: var(--bg-header);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#header:has(nav) {
  padding-bottom: 0;
}

#signin-form, #signup-form {
  background-color: var(--bg-light);
  width: min(100%, max(21.875rem, 35%));
  padding-left: min(calc(8.5vw - 0.5rem), 3rem);
  padding-right: min(calc(8.5vw - 0.5rem), 3rem);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

#signup-form {
  width: min(100%, max(27.5rem, 40%));
}

.error-note {
  color: var(--error-note);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

#footer {
  background-color: var(--bg-footer);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
/* -------------------------------------------------------------- */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#hero-title,
#financial-summary-heading {
  color: var(--h1-hero-color);
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.75);
}

.button-content-center {
  display: flex;
  justify-content: center;
}

.signup-note {
  font-size: 0.85em;
}

.signup-link {
  text-decoration: none;
  font-weight: bolder;
}

.article-divider {
  width: 50%;
  height: 0.2rem;
  margin: 2rem auto;
  background-color: var(--color-divider-green);
  border: none;
  box-shadow: 0 0.5rem 0.75rem var(--color-divider-green);
}

/* ------------------------ signup.html STYLES ------------------------------------------*/
.signup-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.required-note {
  margin: 0;
  font-size: 0.85em;
  text-align: end;
}

.terms-note {
  margin-bottom: 1.5rem;
  font-size: 0.85em;
}

.terms-link, .signin-link {
  font-weight: bolder;
}

.signin-note {
  margin: 1.5rem 0;
  font-size: 0.85em;
  text-align: center;
}

.required-sign::after {
  content: " *";
  color: red;
}

.required-sign-nowrap {
  display: inline-block;
  text-decoration: none;
  color: red;
}
/* ------------------------ dashboard.html STYLES ------------------------------------------*/
/* HEADER STYLES */
#header-auth-content {
display: flex;
flex-direction: column;
gap: 1rem;
align-items: center;
}

#header-auth-logo {
  /* height = item height - no padding bottom */
  height: clamp(2.5rem, 1.75rem + 2.75vw, 3.5rem);
}

#header-auth-btn {
  display: flex;
  align-items: center;
}

#header-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  /* height = item height + padding bottom */
  height: clamp(3rem, 2.25rem + 2.75vw, 4rem);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* header-main items height */
#header-main a,
#header-main div {
  height: 100%;
}

#user-avatar .avatar-logo {
  padding: clamp(0.1rem, 0.05rem + 0.2vw, 0.175rem);
  min-height: 0;
  width: auto;
  object-fit: contain;
}

#user-avatar .avatar-name {
  color: var(--menu-text-color);
  font-size: clamp(0.85rem, 0.75rem + 0.375vw, 1rem);
  line-height: 1.1;
}

.logo-size {
  height: 100%;
}

/* MENU BASE STYLES */
nav ul {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  place-content: flex-end;
  gap: 2.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

nav li {
  min-height: 3rem;
}

nav a {
  height: 100%;
  text-decoration: none;
  display: flex;
  align-items: center;
  color: var(--menu-text-color);
}

nav a.active {
  font-weight: bolder;
  border-bottom: var(--menu-item-underline);
}

nav a:hover:not(.sidebar-menu-icon) {
  font-weight: bolder;
  background-color: var(--menu-hover-bg-color);
  border-bottom: var(--menu-item-underline);
}

/* SIDEMENU STYLES */
.sidebar-nav-menu {
  display: none;
}

.sidebar-nav-menu.active {
  display: flex;  
  flex-direction: column;
  flex-wrap: nowrap;
}

.sidebar-nav-menu {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;

  overflow-x: hidden;
  overflow-y: auto;

  padding: 2.5rem;
  height: 100vh;
  width: max(min(85%, 25rem), 15rem);
  padding: 2.5rem;
  justify-content: flex-start;
  gap: 1rem;

  background-color: var(--bg-sidemenu);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

.sidebar-menu-icon img {
  height: 2.5rem;
  width: auto;
}

.sidebar-menu-icon img:hover {
  opacity: 0.5;
}

.sidebar-nav-menu li {
  width: 100%;
}

.sidebar-nav-menu li:first-child {
  display: flex;
  justify-content: flex-end;
}

.sidebar-nav-menu a {
  display: flex;
  gap: 0.5rem;
}

/* DESKTOP MENU STYLES*/
.desktop-nav-menu li {
  display: none;
}

.desktop-nav-menu li:last-child {
  display: list-item;
}

@media (min-width: 768px) {
  nav ul {
    place-content: center;
  }

  .desktop-nav-menu li {
    display: list-item;
  }

  .desktop-nav-menu li:last-child {
    display: none;
  }
}

/*  DASHBOARD */
.dashboard-section {
  background-color: var(--bg-light);
  border-radius: 2rem;
  padding: 2.5rem clamp(2.5rem, 5vw, 5rem);
}

/* DASHBOARD - MONTHLY SUMMARY */
#monthly-overview-title {
  text-align: center;
  font-weight: bolder;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.monthly-summary-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;

  padding: 2.5rem 0;
  justify-items: center;
}

@media (min-width: 576px) {
  .monthly-summary-items {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 0;
  }
  .balance-item {
    grid-column: span 2;
  }
}

@media (min-width: 992px) {
  .monthly-summary-items {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
  }
  .balance-item {
    grid-column: auto;
  }
}

.item-label {
  --item-color: 0 0 0; /* default value */

  width: var(--dashboard-item-size);
  aspect-ratio: 1;
  border-radius: 50%;
  
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  
  padding-top: 2rem;
  justify-content: center;
  align-items: center;

  border: 2px solid rgb(var(--item-color));
  background-color: rgb(var(--item-color) / 0.1);
  box-shadow: 0 0 20px rgb(var(--item-color) / 0.6);
}

.item-label span {
  font-weight: bolder;
}

.item-label span:first-child {
  color: rgb(var(--item-color));
  max-width: 90%;
  font-size: 1.25em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.income-item {
  --item-color: var(--income-primary-color);
}

.expense-item {
  --item-color: var(--expense-primary-color);
}

.balance-item {
  --item-color: var(--balance-primary-color);
}

.details-link {
  text-decoration: none;
  font-size: 0.9rem;
  
  align-self: flex-end;
}

/* DASHBOARD - DIVIDER */
.divider-wrapper {  /* to center and set vertical divider height */
  display: flex;
  align-items: center;
}

hr.summary-divider {
  background-color: var(--color-divider-gray);
  border: none;
  margin: 3rem auto;

  width: 85%;
  height: 0.175rem;
}

@media (min-width: 768px) {
  hr.summary-divider {
    width: 0.175rem;
    height: 85%;
    margin: auto 3rem;
  }
}

/* DASHBOARD - QUICK ACTION */
.quick-actions-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3rem;

  justify-content: center;
  align-items: center;
}

@media (min-width: 576px) and (max-width: 768px) {
  .quick-actions-wrapper {
    flex-direction: row;
  }  
}

.quick-action-label {
  --action-color: 0 0 0;  /* default value */

  padding: 1rem;
  width: var(--dashboard-quick-item-size);
  aspect-ratio: 1;
  border-radius: 1rem;

  display: inline-flex;
  align-items: center;

  background-color: rgb(var(--action-color) / 0.2);
  border: 2px solid rgb(var(--action-color) / 0.2);
  box-shadow: 0 0 20px rgb(var(--action-color) / 0.6);
 
  transition: all 0.2s ease;
}

.quick-action-label:hover {
  transform: scale(1.1);

  background-color: rgb(var(--action-color) / 0.4);
  border: 2px solid rgb(var(--action-color) / 0.4);
  box-shadow: 0 0 20px rgb(var(--action-color) / 0.8);
}

.income-action {
  --action-color: var(--income-primary-color);
}

.expense-action {
  --action-color: var(--expense-primary-color);
}

.action-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;

  width: 100%;
  height: 100%;
  
  text-decoration: none;
}

.action-content img {
  width: 50%;
}

.action-content span {
  font-size: 0.75rem;
  font-weight: bold;

  white-space: nowrap;
}

.action-content-income {
  color: rgb(var(--income-action-color));
}

.action-content-expense {
  color: var(--expense-action-color);
}

.transaction-section {
  background-color: var(--bg-light);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border-radius: 2rem;
  width: clamp(18rem, 100%, 40rem);
}

.transaction-title {
  color: var(--white-title-color);
  text-align: center;
  margin: 0;
}

#comment-field {
  height: 5rem;
}

/*  overwiev.html */
#select-date-section {
  width: min(100%, 20rem);
}

#select-custom-dates {
  background-color: var(--bg-light);
  padding: 0.75rem;
  border-radius: 0.25rem;

  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#overview-section {
  min-width: 15rem;
}

#financial-summary-heading {
  text-align: center;
  font-size: clamp(1.5rem, calc(0.5rem + 5vw), 3.5rem);
}

.summary-title h2 { /* tables heading */
  color: var(--white-title-color);
  margin: 0;
}

#financial-summary {
  width: 100%;
}

#tables-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  
  margin-top: 3rem;
  row-gap: 5rem;
  column-gap: 1rem;
}

#income-summary,
#expense-summary {
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
  flex: 1 1 auto;
  overflow-x: auto;
  border-radius: 1.5rem;
}

/* table styles for modal triggers*/
.btn-link-table {
  background: none;
  border: none;
  color: var(--black-font);
  text-align: left;
  width: 100%;
}

.btn-link-table:hover {
  font-weight: bolder;
}

.btn-link-table:focus-visible {
  outline: 2px solid var(--blue-outline);
  outline-offset: 2px;
}

/* Progress ring style */
.semi-ring-wrapper {
  position: relative; /* related with .ring-score */
  background-color: transparent;
  border: none;
  width: clamp(15rem, 100%, 37.5rem);   /* 240 - 600 px */

  aspect-ratio: 2 / 1;  /* show only upper half of circles */
  overflow: hidden;
}

.ring {
  fill: none;
  stroke-width: var(--ring-width);
}

.ring.bg {
  stroke: rgb(var(--balance-primary-color));
  opacity: 0.25;
  stroke-dasharray: var(--total-path-length) 0;  /* full stroke, no gap */
}

.ring.green {
  --glow-color: var(--income-primary-color);
  
  stroke: rgb(var(--income-primary-color));
  stroke-dasharray: 0 var(--total-path-length); /* initial state – ring not filled */
  transform: scaleX(-1); /* counter-clockwise direction */
  transform-origin: center;
  stroke-dashoffset: -50; /* move stroke start position at 3 o'clock */

  animation: fillAnimation 2s ease-out forwards;
}

.ring.red {
  --glow-color: var(--expense-primary-color);

  stroke: rgb(var(--expense-primary-color));
  stroke-dasharray: 0 var(--total-path-length); /* initial state – ring not filled */
  stroke-dashoffset: -50;   /* move stroke start position at 9 o'clock */

  animation: fillAnimation 2s ease-out forwards;
}

@keyframes fillAnimation {
  to {
    stroke-dasharray: var(--progress-value) var(--gap-value);
    filter: drop-shadow(0 0 7.5px rgb(var(--glow-color)));
  }
}

.ring-score {
  position: absolute; /* related with .semi-ring-wrapper */
  display: inline-flex; /* score in one line */
  column-gap: 0.2em;
  top: 80%;
  left: 50%;
  transform: translate(-50%, -50%);

  font-size: clamp(1.5rem, 7.5vw, 3.5rem);
  font-weight: bolder;
}

.ring-score .expense {
  color: rgb(var(--expense-primary-color));
}

.ring-score .income {
  color: rgb(var(--income-primary-color));
}

.ring-score .expense::after,
.ring-score .income::after {
  content: "%"
}

.ring-score.divider {
  opacity: 0.6;
}

.financial-feedback {
  text-align: center;
  font-weight: bolder;
  padding: 0.5rem max(7.5vw, 1.5rem)
}

.positive span {
  color: rgb(var(--income-primary-color));
}

.negative span {
  color: rgb(var(--expense-primary-color));
}
