html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* FIRE Calculator Custom Styles */
.fire-calculator {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.card {
  border: none;
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card-header {
  border-radius: 15px 15px 0 0 !important;
  border: none;
}

.progress {
  border-radius: 10px;
  background-color: #e9ecef;
}

.progress-bar {
  border-radius: 10px;
  transition: width 0.6s ease;
}

.form-control {
  border-radius: 10px;
  border: 2px solid #e9ecef;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-primary {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.list-group-item {
  border: none;
  border-bottom: 1px solid #f8f9fa;
  padding: 12px 0;
}

.list-group-item:last-child {
  border-bottom: none;
}

.bg-light {
  background-color: #f8f9fa !important;
}

.text-primary {
  color: #667eea !important;
}

.text-success {
  color: #28a745 !important;
}

/* Range Input Styles */
.form-range {
  height: 6px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
  outline: none;
  transition: all 0.3s ease;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.form-range::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.form-range::-moz-range-track {
  height: 6px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
  border: none;
}

/* Range input container styling */
.range-input-container {
  position: relative;
  margin-bottom: 1rem;
}

.range-input-container .form-range {
  margin-bottom: 0.5rem;
}

.range-input-container .form-control {
  margin-top: 0.25rem;
}

/* Value display for range inputs */
.range-value-display {
  position: absolute;
  top: -8px;
  right: 0;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 40px;
  text-align: center;
}

/* Enhanced form styling */
.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

.form-control {
  font-weight: 500;
}

.form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Card body scroll styling */
.card-body {
  scrollbar-width: thin;
  scrollbar-color: #667eea #f8f9fa;
}

.card-body::-webkit-scrollbar {
  width: 8px;
}

.card-body::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #5a6fd8, #6a4190);
}

/* Animation for form elements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#results {
  animation: fadeInUp 0.6s ease-out;
}

@media (max-width: 768px) {
  .container-fluid {
    padding: 0 15px;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #5a6fd8, #6a4190);
}

.ai-extracted {
  border-color: #28a745 !important;
  background-color: rgba(40, 167, 69, 0.05) !important;
}

.ai-extracted::after {
  content: "🤖";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

.ai-default {
  border-color: #ffc107 !important;
  background-color: rgba(255, 193, 7, 0.05) !important;
}

.ai-default::after {
  content: "⚡";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

.ai-extracted:hover {
  border-color: #20c997 !important;
  background-color: rgba(40, 167, 69, 0.1) !important;
}

.ai-default:hover {
  border-color: #fd7e14 !important;
  background-color: rgba(255, 193, 7, 0.1) !important;
}

.ai-legend {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  font-size: 0.875rem;
}

.ai-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-legend-ai {
  color: #28a745;
  font-weight: 600;
}

.ai-legend-default {
  color: #ffc107;
  font-weight: 600;
}

.btn-group .btn {
  border-radius: 8px !important;
  margin: 0 2px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-group .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-group .btn-check:checked + .btn-outline-primary {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-color: #667eea;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-group .btn-check:checked + .btn-outline-success {
  background: linear-gradient(45deg, #28a745, #20c997);
  border-color: #28a745;
  color: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-group .btn-check:checked + .btn-outline-warning {
  background: linear-gradient(45deg, #ffc107, #fd7e14);
  border-color: #ffc107;
  color: white;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

#retirementAgeGroup {
  transition: all 0.3s ease;
}

#retirementAgeGroup.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.calculation-mode-active .form-label {
  color: #495057;
  font-weight: 600;
}

.calculation-mode-active .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.mode-standard .card-header {
  background: linear-gradient(45deg, #667eea, #764ba2) !important;
}

.mode-when-can-retire .card-header {
  background: linear-gradient(45deg, #28a745, #20c997) !important;
}

.mode-retire-now-budget .card-header {
  background: linear-gradient(45deg, #ffc107, #fd7e14) !important;
}

@media (max-width: 768px) {
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    margin: 2px 0;
    width: 100%;
  }
}

.budget-card {
  transition: all 0.3s ease;
  border-radius: 12px;
}

.budget-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.budget-card .card-body {
  padding: 1rem;
}

.budget-category-icon {
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

.budget-amount {
  font-size: 1.1rem;
  font-weight: 700;
}

.budget-progress {
  height: 6px;
  border-radius: 3px;
}

.budget-progress .progress-bar {
  border-radius: 3px;
  transition: width 0.6s ease;
}

.budget-housing { color: #e74c3c; }
.budget-transportation { color: #3498db; }
.budget-food { color: #f39c12; }
.budget-healthcare { color: #e67e22; }
.budget-utilities { color: #f1c40f; }
.budget-entertainment { color: #9b59b6; }
.budget-shopping { color: #1abc9c; }
.budget-insurance { color: #34495e; }
.budget-personal-care { color: #e91e63; }
.budget-miscellaneous { color: #95a5a6; }

.budget-summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.budget-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

@media (max-width: 768px) {
  .budget-category-card {
    margin-bottom: 1rem;
  }
  
  .budget-amount {
    font-size: 1rem;
  }
}