/* General Styles */
body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(to right, #f9e4e5, #c3d9f1);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-size: 300% 300%;
  align-items: flex-start; /* Align content to the top */
  animation: gradientAnimation 5s ease infinite;
  overflow: auto;
}

@keyframes gradientAnimation {
  0% {
    background-position: 100% 0;
  }
  50% {
    background-position: 0 100%;
  }
  100% {
    background-position: 100% 0;
  }
}

/* Container */
.container {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  text-align: center;
  width: 100%; /* Makes sure container is responsive */
  max-width: 420px; /* Ensures the max width is not exceeded */
  color: black;
  transition: transform 0.3s ease;
  box-sizing: border-box; /* Ensures padding doesn't push the container outside */
  margin: 20px;
}

.container:hover {
  transform: scale(1.02);
}

canvas {
  width: 100%;
  height: 300px; /* Set a fixed height for the chart */
  margin-top: 20px;
}

/* Headings */
h1,
h3 {
  margin-bottom: 20px;
  font-weight: 600;
}

h1 {
  background: linear-gradient(135deg, #ff8c00, #d9534f);
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

h3 {
  color: #8a2be2;
}

/* Input Fields */
.input-group {
  margin-bottom: 20px;
  text-align: left;
}

label {
  color: #666;
  font-size: 16px;
}

input {
  width: 100%;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s;
  box-sizing: border-box; /* Prevents input from overflowing */
}

input:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

/* Calculate Tax Button */
button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 14px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box; /* Prevents button from overflowing */
}

button:hover {
  background-color: #0056b3;
  transform: scale(1.05);
}

#shareButton {
  margin-top: 20px;
  padding: 10px;
  background-color: #e018c8;
}

/* Results Box */
.result-box {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: black;
  margin-top: 20px;
  overflow-y: auto; /* Allows vertical scrolling */
  max-height: 500px; /* Set a maximum height for the result box */
}

/* Savings Info */
.savings-info {
  margin-top: 15px;
  font-weight: bold;
  color: #28a745;
  font-size: 18px;
}

/* Hidden Elements */
.hidden {
  display: none;
}

.error {
  color: #dc3545;
  font-size: 14px;
}

.error.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 600px) {
  .container {
    width: 90%;
    padding: 20px;
    box-sizing: border-box; /* Ensures padding is contained within the container */
    max-width: 90%; /* Ensures container scales with smaller screens */
  }

  h1 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1rem;
  }

  input {
    padding: 16px;
    font-size: 18px;
    border-radius: 10px;
  }

  button {
    width: 100%;
    padding: 16px;
  }

  .result-box {
    padding: 25px;
    margin-top: 20px;
    max-height: 400px; /* Adjust height for smaller screens */
  }

  .savings-info {
    font-size: 1.1rem;
  }
}
