@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

h2 {
  letter-spacing: normal;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-glow:focus {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  height: 100vh;
  padding: 1rem;
  box-sizing: border-box;
}

.sidebar {
  grid-column: span 3;
  grid-row: span 3;
}

.nav_cta {
  background-color: #000;
  background-image: linear-gradient(135deg,
      var(--base-color-brand--brand-green),
      #16418a);
  color: var(--text-color--text-alternate);
  text-align: center;
  text-transform: uppercase;
  border-radius: 0.4rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.5s;
}

.income-card {
  grid-column: span 3;
}

.expenses-card {
  grid-column: span 6;
}

.deductions-card {
  grid-column: span 3;
}

.status-card {
  grid-column: span 3;
}

.chart-card {
  grid-column: span 6;
  min-height: 0;
  /* Add this to prevent height expansion */
}

.allocations-card {
  grid-column: span 3;
}

.scrollable {
  overflow-y: auto;
  max-height: 100%;
}

.scrollable::-webkit-scrollbar {
  width: 6px;
}

.scrollable::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.chart-container {
  position: relative;
  height: 100%;
  min-height: 300px;
  /* Set a minimum height */
  max-height: 100%;
  /* Prevent infinite growth */
}

.no-arrows {
  -moz-appearance: textfield;
  /* Firefox */
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  /* Chrome, Safari, Edge */
  margin: 0;
}

.category-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out;
}

.category-arrow {
  transition: transform 0.3s ease-in-out;
}

.input-active {
  border-color: rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.input-glow:focus {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.glass-effect {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.02);
}

.category-toggle:hover {
  background: #dfece6;
}

/* Budget Progress Bar Styles - Enhanced with Legend */
.budget-progress-container {
  width: 100%;
  margin: 1rem 0;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.progress-bar-wrapper {
  position: relative;
  width: 100%;
  padding: 0;
}

.progress-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  position: relative;
  padding: 0 0.5rem;
}

.progress-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  position: absolute;
  transform: translateX(-50%);
}

.progress-label.left {
  left: 0%;
  transform: translateX(0);
}

.progress-label.center {
  left: 70%;
}

.progress-label.right {
  left: 85%;
}

.progress-label.far-right {
  left: 100%;
  transform: translateX(-100%);
}

.budget-progress-bar {
  position: relative;
  display: block;
  height: 24px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(to right,
      #21a34f 0%,
      #21a34f 64%,
      #38b165 69%,
      #b8cf42 70%,
      #b8cf42 72%,
      #f2c94c 75%,
      #f2c94c 83%,
      #ff9f1a 88%,
      #f05a49 92%,
      #eb5757 96%,
      #eb5757 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  margin: 0.75rem 0;
}

.budget-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  border-right: none;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
  /* zones no longer block gradient visuals */
}

.budget-zone:last-child {
  border-right: none;
}

.zone-gradient {
  display: none;
}

.green-zone {
  left: 0%;
  width: 70%;
}

.green-zone .zone-gradient {
  background: linear-gradient(135deg,
      #10b981 0%,
      #059669 50%,
      #047857 100%);
}

.amber-zone {
  left: 70%;
  width: 15%;
}

.amber-zone .zone-gradient {
  background: linear-gradient(135deg,
      #f59e0b 0%,
      #d97706 50%,
      #b45309 100%);
}

.red-zone {
  left: 85%;
  width: 15%;
}

.red-zone .zone-gradient {
  background: linear-gradient(135deg,
      #ef4444 0%,
      #dc2626 50%,
      #b91c1c 100%);
}

.budget-zone:hover {
  transform: none;
}

.budget-zone:hover .zone-gradient {
  background-size: 110% 110%;
}

.progress-indicator {
  position: absolute;
  top: -10px;
  left: 0%;
  transform: translateX(-50%);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
  pointer-events: none;
}

.indicator-dot {
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #ffffff, #e5e7eb);
  border: 3px solid #1f2937;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.4),
    0 6px 16px rgba(0, 0, 0, 0.5),
    0 0 25px rgba(255, 255, 255, 0.3);
  position: relative;
  margin: 0 auto;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.4),
      0 6px 16px rgba(0, 0, 0, 0.5),
      0 0 25px rgba(255, 255, 255, 0.3);
  }

  50% {
    box-shadow:
      0 0 0 5px rgba(255, 255, 255, 0.6),
      0 6px 16px rgba(0, 0, 0, 0.5),
      0 0 30px rgba(255, 255, 255, 0.5);
  }
}

.indicator-line {
  width: 3px;
  height: 24px;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.7) 50%,
      rgba(255, 255, 255, 0.4) 100%);
  margin: 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.indicator-value {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.indicator-value::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.95);
}

.zone-labels {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
  padding: 0 0.5rem;
}

.zone-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.green-label {
  color: #10b981;
  flex: 70;
  text-align: left;
}

.amber-label {
  color: #f59e0b;
  flex: 15;
  text-align: center;
}

.red-label {
  color: #ef4444;
  flex: 15;
  text-align: right;
}

/* New Legend Styles */
.budget-legend {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 1.5rem;
}

.legend-item {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.legend-color {
  width: 20px;
  min-width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-top: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.green-legend {
  background: linear-gradient(135deg, #10b981, #047857);
}

.amber-legend {
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

.red-legend {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.legend-content {
  flex: 1;
}

.legend-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.3px;
}

.legend-description {
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* Hover interactions between progress bar and legend */
.budget-zone:hover~.budget-legend .legend-item[data-zone="healthy"],
.legend-item[data-zone="healthy"]:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.budget-zone.amber-zone:hover~.budget-legend .legend-item[data-zone="caution"],
.legend-item[data-zone="caution"]:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.budget-zone.red-zone:hover~.budget-legend .legend-item[data-zone="critical"],
.legend-item[data-zone="critical"]:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .budget-progress-container {
    padding: 1.5rem;
    margin: 0.5rem 0;
  }

  .progress-bar-wrapper {
    padding: 0;
  }

  .progress-bar-labels {
    margin-bottom: 0.75rem;
  }

  .zone-labels {
    margin: 0.75rem 0 1.5rem 0;
  }

  .indicator-dot {
    width: 12px;
    height: 12px;
  }

  .indicator-line {
    height: 20px;
  }

  .progress-label {
    font-size: 0.7rem;
  }

  .zone-name {
    font-size: 0.65rem;
  }

  .legend-item {
    padding: 1.25rem;
    gap: 0.75rem;
  }

  .legend-title {
    font-size: 0.85rem;
  }

  .legend-description {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .budget-progress-container {
    padding: 1rem;
    margin: 0.25rem 0;
  }

  .legend-item {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
  }

  .legend-color {
    width: 100%;
    height: 8px;
    margin-top: 0;
  }

  .legend-title {
    font-size: 0.8rem;
  }

  .legend-description {
    font-size: 0.7rem;
  }
}

/* Tooltip Boxes Styles */
.tooltip-boxes {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0 0 1rem;
}

.tooltip-box {
  position: relative;
  flex: 0.8;
  /* Reduced from 1 to make boxes smaller */
  display: flex;
  flex-direction: column;
  align-items: center;
  ;
  /* Reduced padding */
  border-radius: 8px;
  /* Smaller border radius */
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  /* Thinner border */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  max-width: 120px;
  /* Added max-width to constrain size */
}

.tooltip-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.healthy-box {
  border-color: rgba(22, 138, 83, 0.3);
  /* #168A53 */
  background: linear-gradient(135deg,
      rgba(22, 138, 83, 0.10),
      rgba(22, 138, 83, 0.15));
}

.healthy-box:hover {
  border-color: rgba(22, 138, 83, 0.6);
  /* #168A53 */
  background: linear-gradient(135deg,
      rgba(22, 138, 83, 0.15),
      rgba(22, 138, 83, 0.25));
}

.caution-box {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg,
      rgba(245, 158, 11, 0.1),
      rgba(245, 158, 11, 0.15));
}

.caution-box:hover {
  border-color: rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg,
      rgba(245, 158, 11, 0.15),
      rgba(245, 158, 11, 0.25));
}

.critical-box {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg,
      rgba(239, 68, 68, 0.1),
      rgba(239, 68, 68, 0.15));
}

.critical-box:hover {
  border-color: rgba(239, 68, 68, 0.6);
  background: linear-gradient(135deg,
      rgba(239, 68, 68, 0.15),
      rgba(239, 68, 68, 0.25));
}

.box-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.box-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

/* White Background Tooltip Styles */
.tooltip-box::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: #374151;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: normal;
  width: 280px;
  max-width: 90vw;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  margin-bottom: 8px;
  text-align: left;
}

.tooltip-box::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: white;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1001;
  margin-bottom: 2px;
}

.tooltip-box:hover::before,
.tooltip-box:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Responsive Design for Tooltip Boxes */
@media (max-width: 768px) {
  .tooltip-boxes {
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .tooltip-box {
    padding: 0.75rem 0.5rem;
  }

  .box-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }

  .box-label {
    font-size: 0.8rem;
  }

  .tooltip-box::before {
    width: 250px;
    font-size: 0.8rem;
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .tooltip-boxes {
    flex-direction: column;
    gap: 0.75rem;
  }

  .tooltip-box {
    flex-direction: row;
    justify-content: flex-start;
    padding: 1rem;
    text-align: left;
  }

  .box-icon {
    margin-right: 0.75rem;
    margin-bottom: 0;
  }

  .tooltip-box::before {
    width: 220px;
    left: 0;
    transform: none;
  }

  .tooltip-box::after {
    left: 20px;
    transform: none;
  }
}


.gradient-text {
  background: linear-gradient(90.35deg, #168A53 -0.01%, #16418A 99.85%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

@media (min-width: 1024px) {
  #deductions-disposable-section {
    display: block !important;
  }

  /* Hide mobile-only results */
  #annual-income-section #taxes-content,
  #living-expenses-section #expenses-content,
  #savings-investments-section #save-invest-content {
    display: none !important;
  }
}

@media (max-width: 1023px) {

  /* Hide desktop sidebar on mobile */
  #deductions-disposable-section {
    display: none !important;
  }

  /* Show mobile results */
  /* Show mobile results - Rely on JS toggling .hidden class */
  /* #annual-income-section #taxes-content,
  #living-expenses-section #expenses-content,
  #savings-investments-section #save-invest-content {
     display: block !important;
  } */
}