/* Apply base styles to body for layout and typography */
body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  overflow-x: hidden;
}

/* Create an animated gradient background using pseudo-element */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #5e60ce, #48bfe3);
  z-index: -1;
  animation: wave 15s infinite linear;
  opacity: 0.8;
}

/* Define animation for background gradient movement */
@keyframes wave {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Style the marquee container for scrolling text */
.marquee {
  width: 100%;
  max-width: 1200px;
  background: rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 10px;
  padding: 12px 0;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(94, 96, 206, 0.1);
  border: 1.5px solid rgba(94, 96, 206, 0.22);
  z-index: 1;
  transition: background 0.3s, box-shadow 0.3s;

}
/* Add hover effects to marquee for interactivity */
.marquee:hover {
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 6px 20px rgba(94, 96, 206, 0.15);
}
/* Style the scrolling text inside marquee */
.marquee span {
  display: inline-block;
  color: #2d3436;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  animation: marquee 20s linear infinite;
  padding-left: 100%;
}

/* Define animation for marquee text scrolling */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Style main container for calculator and results layout */
.container {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  width: 100%;
  flex-wrap: wrap;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  z-index: 1;
  justify-content: center;
}

/* Style calculator card with padding and shadow */
.calculator {
  background: rgba(255, 255, 255, 0.97);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 500px;
  min-width: 300px;
  animation: fadeIn 0.7s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-sizing: border-box;
 
}

/* Style results container for output display */
.results-container {
  background: rgba(255, 255, 255, 0.98);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  width: calc(50% - 20px);
  min-width: 300px;
  animation: fadeIn 0.7s ease;
  border: 2px solid rgba(94, 96, 206, 0.3);
  box-sizing: border-box;
  
}

/* Define fade-in animation for calculator and results containers */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Style heading for calculator title */
h2 {
  text-align: center;
  margin: 0 0 16px;
  color: #1e1f7a;
  font-weight: 700;
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(94, 96, 206, 0.5);
  animation: scaleIn 1s ease-in-out;
}

/* Define scale-in animation for heading */
@keyframes scaleIn {
  0% {
    transform: scale(0.9);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Style form labels */
label {
  display: block;
  font-weight: 600;
  color: #2d3436;
  margin: 10px 0 6px;
  font-size: 14px;
}

/* Style number input fields */
input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #b2bec3;
  font-size: 15px;
  background-color: #f8f9fa;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}
/* Add focus styles for number inputs */
input[type="number"]:focus {
  border-color: #5e60ce;
  box-shadow: 0 0 5px rgba(94, 96, 206, 0.3);
  outline: none;
}

/* Style row layout for input fields */
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
/* Style column for input fields */
.col {
  flex: 1;
  min-width: 120px;
}

/* Style options section for checkboxes and radio buttons */
.options {
  margin: 12px 0;
}
/* Style labels for options */
.options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
  color: #2d3436;
  transition: color 0.3s ease;
}
/* Add hover effect for option labels */
.options label:hover {
  color: #5e60ce;
}

/* Style button row layout */
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
/* Style buttons */
button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 80px;
}
/* Add hover effect for buttons */
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
/* Style calculate button with gradient */
#calcBtn {
  background: linear-gradient(135deg, #5e60ce, #48bfe3);
}
/* Style disabled state for calculate button */
#calcBtn:disabled {
  background: linear-gradient(135deg, #a0a3e0, #a0c9d9);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* Style info button with gradient */
#infoBtn {
  background: linear-gradient(135deg, #2ecc71, #1abc9c);
}
/* Style clear button with gradient */
#clearBtn {
  background: linear-gradient(135deg, #ff9f43, #ee5253);
}

/* Style result container for calculation output */
.result {
  background: #e6fcf5;
  border: 1px solid #c3e6cb;
  padding: 20px;
  border-radius: 10px;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.05);
}
/* Style individual result lines */
.result .line {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin: 8px 0;
  font-size: 14px;
  color: #2d3436;
  font-weight: 500;
}
/* Style strong text in result lines */
.result .line strong {
  font-weight: 700;
}
/* Style muted text for notes */
.muted {
  color: #636e72;
  font-size: 12px;
  margin: 8px 0;
}
/* Style horizontal rule in result container */
.result hr {
  border: 0;
  border-top: 1px solid #c3e6cb;
  margin: 12px 0;
}

/* Style footer with attribution */
.footer {
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
}
/* Style links in footer and modal */
.footer a,
.modal-content a {
  color: #5e60ce;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
/* Add hover effects for links */
.footer a:hover,
.modal-content a:hover {
  color: #48bfe3;
  text-shadow: 0 0 5px rgba(72, 191, 227, 0.5);
}

/* Style modal for info display */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  padding: 20px;
  box-sizing: border-box;
}

/* Style modal content container */
.modal-content {
  background: linear-gradient(135deg, #ffffff, #f1f2f6);
  padding: 25px;
  border-radius: 14px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.5s ease forwards;
  text-align: left;
  border: 1px solid rgba(94, 96, 206, 0.2);
  box-sizing: border-box;
}

/* Style modal heading */
.modal-content h3 {
  margin: 0 0 16px;
  color: #1e1f7a;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Style modal list for tax rates */
.modal-content ul {
  margin: 0 0 20px;
  padding-left: 20px;
  font-size: 13px;
  color: #2d3436;
  line-height: 1.6;
}

/* Style nested lists in modal */
.modal-content ul ul {
  padding-left: 16px;
}

/* Style modal paragraphs */
.modal-content p {
  margin: 0 0 16px;
  color: #6c757d;
  font-size: 12px;
  font-style: italic;
  line-height: 1.5;
}

/* Style modal close button */
.modal-content button {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  padding: 10px 25px;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Add hover effect for modal close button */
.modal-content button:hover {
  background: linear-gradient(135deg, #ff6b81, #ff4757);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(255, 71, 87, 0.3);
}

/* Define slide-in animation for modal */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive styles for tablets and smaller screens */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    align-items: center;
  }
  .calculator,
  .results-container {
    width: 100%;
    max-width: 500px;
  }
  .results-container {
    margin-top: 15px;
  }
  .marquee span {
    font-size: 13px;
  }
}

/* Responsive styles for mobile devices */
@media (max-width: 500px) {
  .row,
  .button-row {
    flex-direction: column;
  }
  .calculator,
  .results-container {
    padding: 20px;
    min-width: unset;
  }
  h2 {
    font-size: 22px;
  }
  .modal-content {
    padding: 20px;
    max-width: 90%;
  }
  .modal-content h3 {
    font-size: 16px;
  }
  .modal-content ul,
  .modal-content p {
    font-size: 12px;
  }
  button {
    font-size: 13px;
    padding: 10px;
  }
  input[type="number"] {
    font-size: 14px;
  }
  .result .line {
    font-size: 13px;
  }
  .marquee span {
    font-size: 12px;
  }
}