@import url('https://fonts.googleapis.com/css?family=Lato&display=swap');

:root {
  --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --primary-color: #0366D6;
  --secondary-color: #2ecc71;
  --expense-color: #c0392b;
  --text-color: #333;
  --bg-color: #f7f7f7;
  --balance-positive: #4caf50; /* New color for positive balance */
  --balance-negative: #f44336; /* New color for negative balance */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Lato', sans-serif;
  color: var(--text-color);
  background: url(Assets/back.avif) no-repeat;
  background-size: cover;
}

nav {
  background-color: var(--secondary-color);
  color: #fff;
  text-align: center;
  height: 75px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: var(--box-shadow);
}

nav img {
  width: 70px;
  height: auto;
}

nav li {
  list-style: none;
  font-size: 25px;
  font-family: sans-serif;
}

nav li a {
  text-decoration: none;
  color: #fff;
}

.container{
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
}
.container-items-1 {
  background-color: transparent;
  box-shadow: 15px 15px 50px 3px;
  border-radius: 10px;
  padding: 20px;
  margin-top: 30px;
  width: 30%;
  margin-left: 30px;
}

.container-items-2{
  background-color: #E5F3FC;
  box-shadow: 15px 15px 50px 3px;
  border-radius: 10px;
  padding: 20px;
  margin-top: 30px;
  width: 30%;
  margin-left: 30px;
}
.container-text{
  text-align: center;
}

h1, h2, h3, h4 {
  margin-bottom: 10px;
  letter-spacing: 1px;
}

h1 {
  color: var(--primary-color);
  font-size: 36px;
}

h3 {
  font-size: 24px;
  margin-top: 30px;
  border-bottom: 2px solid #bbb;
  padding-bottom: 10px;
}

h4 {
  text-transform: uppercase;
  font-size: 18px;
}

.inc-exp-container {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
}

.inc-exp-container > div {
  flex: 1;
  text-align: center;
}

.inc-exp-container > div:first-of-type {
  border-right: 1px solid #dedede;
}

.money {
  font-size: 20px;
  letter-spacing: 1px;
  margin: 5px 0;
}

.money.plus {
  color: var(--secondary-color);
}

.money.minus {
  color: var(--expense-color);
}

label {
  display: inline-block;
  margin: 10px 0;
}

input[type='text'],
input[type='number'] {
  border: 1px solid #dedede;
  border-radius: 5px;
  display: block;
  font-size: 16px;
  padding: 10px;
  width: 100%;
  margin-bottom: 20px;
}

.btn {
  cursor: pointer;
  background-color: var(--primary-color);
  box-shadow: var(--box-shadow);
  color: #fff;
  border: 0;
  font-size: 16px;
  padding: 10px;
  width: 100%;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #63a6f4;
  color: black;
  transition: .3s ease;
}

#generate-report {
  margin-top: 10px;
}

.list {
  list-style-type: none;
  padding: 0;
  margin-bottom: 40px;
}

.list li {
  background-color: #fff;
  box-shadow: var(--box-shadow);
  color: var(--text-color);
  display: flex;
  justify-content: space-between;
  position: relative;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  transition: transform 0.2s ease;
}

.list li.plus {
  border-right: 5px solid var(--secondary-color);
}

.list li.minus {
  border-right: 5px solid var(--expense-color);
}

.list li:hover {
  transform: scale(1.02);
}

.delete-btn {
  cursor: pointer;
  background-color: var(--expense-color);
  border: 0;
  color: #fff;
  font-size: 20px;
  line-height: 20px;
  padding: 2px 5px;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-100%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.list li:hover .delete-btn {
  opacity: 1;
}

#report-container {
  margin-top: 30px;
  padding: 20px;
  background-color: #fff;
  box-shadow: var(--box-shadow);
  border-radius: 10px;
  width: 100px;
}

#report-content p {
  font-size: 14px;
  margin: 8px 0;
}

#report-container h2 {
  text-align: center;
  color: var(--primary-color);
}

/* Other styles remain the same */

#generate-report {
  margin-top: 10px;
  background-color: #0366D6;
  font-size: 16px;
}

.buttn {
  cursor: pointer;
  background-color: var(--primary-color);
  box-shadow: var(--box-shadow);
  color: #fff;
  border: 0;
  font-size: 16px;
  padding: 10px;
  width: 200px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

#generate-report:hover {
  background-color: #d35400;
}

/* Styling the date displayed in the transaction list */
.transaction-date {
  font-size: 12px;
  color: #7f8c8d;
  margin-top: 5px;
}

/* New styles for the balance display */
/* New styles for the balance display */
#balance {
  font-size: 24px;
  font-weight: bold;
  margin-top: 20px;
  transition: color 0.3s ease; /* Smooth color transition */
}

#balance.positive {
  color: var(--balance-positive); /* Green color for positive balance */
}

#balance.negative {
  color: var(--balance-negative); /* Red color for negative balance */
}


footer {
  background-color: #2ecc71;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  padding: 20px;
}
.chart-container {
  display: flex;
  flex-direction: column; /* Stack charts on small screens */
  justify-content: space-between;
  margin-top: 20px;
}
/* Responsive adjustments *//* Base Mobile Styling */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  /* Navbar adjustments */
  nav {
    height: 60px;
    font-size: 14px;
  }

  nav li {
    font-size: 18px;
  }

  .container,
  #report-container {
    width: 90%;
    padding: 15px;
    margin: 20px 0;
  }

  h1 {
    font-size: 26px;
    text-align: center;
  }

  h3, h4 {
    font-size: 18px;
  }

  /* Balance styling */
  #balance {
    font-size: 22px;
    text-align: center;
  }

  /* Income/Expense Container */
  .inc-exp-container {
    flex-direction: column;
    gap: 15px;
  }

  /* Button adjustments */
  .btn, .buttn {
    font-size: 14px;
    padding: 10px;
  }

  /* Transaction List adjustments */
  .list li {
    padding: 10px;
    font-size: 14px;
  }

  /* Footer adjustments */
  footer {
    font-size: 14px;
    padding: 15px;
  }

  /* Chart container stacking for smaller screens */
  .chart-container {
    flex-direction: column;
    align-items: center;
  }

  canvas {
    height: 250px;
  }
}

/* Enhanced Phone Styling for Smaller Screens (Under 480px) */
/* Responsive adjustments for screens under 480px */
@media (max-width: 480px) {
  /* General body adjustments for better readability */
  body {
    padding: 10px;
    margin: 0;
  }

  /* Navbar adjustments */
  nav {
    height: 55px;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
  }

  nav img {
    width: 40px;
    height: auto;
  }

  nav li {
    font-size: 14px;
  }

  nav li a {
    font-size: 12px;
  }

  /* Container adjustments for smaller width */
  .container {
    flex-direction: column;
    width: 100%;
    padding: 10px;
  }

  .container-items-1, .container-items-2 {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
    padding: 15px;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.1); /* Adjusted for better performance */
  }

  /* Balance and income/expense containers */
  #balance {
    font-size: 20px;
    text-align: center;
  }

  .inc-exp-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .inc-exp-container > div {
    border: none; /* Remove borders for cleaner look */
    width: 100%;
    text-align: center;
  }

  /* Button adjustments for easier touch */
  .btn, .buttn {
    font-size: 14px;
    padding: 8px;
    width: 100%; /* Full-width buttons */
    border-radius: 8px;
  }

  #generate-report {
    margin-top: 15px;
  }

  /* Transaction list adjustments */
  .list li {
    font-size: 14px;
    padding: 10px;
    margin: 5px 0;
  }

  .transaction-date {
    font-size: 12px;
  }

  .delete-btn {
    font-size: 16px;
    padding: 5px 10px;
  }

  /* Report container */
  #report-container {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
  }

  /* Footer adjustments */
  footer {
    font-size: 12px;
    padding: 10px;
  }

  /* Chart container */
  .chart-container {
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
  }

  canvas {
    max-width: 100%;
    height: auto; /* Ensure charts scale properly */
  }
}

/* Enhanced responsiveness for ultra-small screens under 360px */
@media (max-width: 360px) {
  h1 {
    font-size: 18px;
  }

  h3, h4 {
    font-size: 14px;
  }

  #balance {
    font-size: 18px;
  }

  .btn, .buttn {
    font-size: 12px;
    padding: 6px;
  }

  .list li {
    font-size: 12px;
    padding: 8px;
  }

  .delete-btn {
    font-size: 14px;
  }

  footer {
    font-size: 10px;
    padding: 8px;
  }
}

