* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #000000;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 20px 20px 20px;
}

.calculator-card {
  background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 500px;
  box-shadow: 
    0 0 80px rgba(59, 130, 246, 0.2),
    0 20px 100px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: cardGlow 3s ease-in-out infinite;
}

.calculator-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.6), 
    rgba(139, 92, 246, 0.4), 
    rgba(236, 72, 153, 0.4),
    rgba(59, 130, 246, 0.6));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: borderRotate 4s linear infinite;
}

@keyframes cardGlow {
  0%, 100% {
    box-shadow: 
      0 0 60px rgba(59, 130, 246, 0.2),
      0 20px 100px rgba(0, 0, 0, 0.9),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  50% {
    box-shadow: 
      0 0 100px rgba(59, 130, 246, 0.3),
      0 20px 100px rgba(0, 0, 0, 0.9),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

@keyframes borderRotate {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

h1 {
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 36px;
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(96, 165, 250, 0.3);
}

/* Style for h5 headings: white and centered */
h5 {
  color: #ffffff;
  text-align: center;
}

.amount-in-words {
  display: block;
  font-size: 18px;
  font-weight: 500;
  color: #93c5fd;
  margin-top: 8px;
  background: none;
  -webkit-text-fill-color: #93c5fd;
  text-shadow: 0 0 15px rgba(147, 197, 253, 0.4);
  font-style: italic;
  letter-spacing: 0.5px;
}

.input-group {
  margin-bottom: 20px;
  position: relative;
}

label {
  display: block;
  color: #d1d5db;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.amount-words-below {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: #60a5fa;
  font-style: italic;
  min-height: 20px;
  text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
  letter-spacing: 0.3px;
}

input {
  width: 100%;
  background: linear-gradient(to right, #0f172a, #1e293b);
  border: 2px solid #1e3a8a;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 20px;
  color: #ffffff;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 0 0 rgba(59, 130, 246, 0);
}

input:focus {
  border-color: #3b82f6;
  background: linear-gradient(to right, #1e293b, #334155);
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 0 4px rgba(59, 130, 246, 0.15),
    0 0 20px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

input::placeholder {
  color: #64748b;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

/* Inline layout for Tax Rate and Tax Amount */
.tax-inline-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.input-group.compact {
  margin-bottom: 0;
}

.compact-input {
  padding: 16px 20px;
  font-size: 20px;
}

@media (max-width: 560px) {
  .tax-inline-row {
    grid-template-columns: 1fr;
  }
}

/* Stacked result block to match input label on top */
.result-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-stack .result-label {
  margin: 0;
  color: #d1d5db;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Make result value look like the input design */
.result-stack .result-value {
  display: flex;
  align-items: center;
  background: linear-gradient(to right, #0f172a, #1e293b);
  border: 2px solid #1e3a8a;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 20px;
  color: #ffffff;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 0 0 rgba(59, 130, 246, 0);
}

/* Make all textboxes the same height */
input,
.result-stack .result-value {
  min-height: 56px;
}

.result-words-below {
  display: block;
  margin-top: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #93c5fd;
  font-style: italic;
  min-height: 20px;
  text-shadow: 0 0 10px rgba(147, 197, 253, 0.3);
  letter-spacing: 0.3px;
  text-align: left;
  padding-left: 4px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid #1e3a8a;
  border-radius: 12px;
  padding: 18px 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.result-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: linear-gradient(to bottom, #3b82f6, #8b5cf6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.result-row:hover {
  transform: translateX(4px);
  border-color: #3b82f6;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.result-row:hover::before {
  opacity: 1;
}

.result-label {
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.result-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.tax-amount {
  color: #f87171;
  text-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

.remaining-amount {
  color: #34d399;
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

.original-amount {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 2px solid rgba(59, 130, 246, 0.4);
  box-shadow: 
    0 4px 20px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.original-amount .result-label {
  color: #93c5fd;
  font-weight: 600;
}

.original-amount .result-value {
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.developer-credit {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  margin-top: 5px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

@media (max-width: 480px) {
  .calculator-card {
    padding: 32px 24px;
  }

  h1 {
    font-size: 26px;
    margin-bottom: 28px;
  }

  input {
    font-size: 18px;
    padding: 14px 16px;
  }

  .result-value {
    font-size: 18px;
  }

  .original-amount .result-value {
    font-size: 20px;
  }
}
