/* Time-to-Goal Money Visualizer - Professional Finance UI */

/* CSS Custom Properties - Finance Grade Color System */
:root {
  --bg-primary: #0F172A;
  --surface-dark: #111827;
  --card-bg: #1F2937;
  --text-primary: #FFFFFF;
  --text-secondary: #D1D5DB;
  --text-muted: #9CA3AF;
  --accent-cyan: #22D3EE;
  --success-green: #22C55E;
  --warning-orange: #F59E0B;
  --risk-red: #EF4444;
  --border-color: #374151;
  --hover-bg: #2D3748;
  --gradient-primary: linear-gradient(135deg, #22D3EE 0%, #3B82F6 100%);
  --gradient-success: linear-gradient(135deg, #22C55E 0%, #10B981 100%);
  --gradient-warning: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
  --gradient-risk: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

/* Typography System */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.header {
  background: var(--surface-dark);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-text h1 {
  font-size: 1.5rem;
  margin: 0;
  background: none;
  -webkit-text-fill-color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Main Content Layout */
.main {
  padding: 2rem 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 2fr 3fr;
  }
}

/* Card Components */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-cyan);
}

.card-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-description {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Form Components */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Select Dropdown */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Radio Button Group */
.radio-group {
  display: grid;
  gap: 0.75rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface-dark);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.radio-option:hover {
  border-color: var(--accent-cyan);
  background: var(--hover-bg);
}

.radio-option input[type="radio"] {
  margin: 0;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent-cyan);
}

.radio-option.active {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
}

.radio-content {
  flex: 1;
}

.radio-title {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.radio-description {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--surface-dark);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--hover-bg);
  border-color: var(--accent-cyan);
}

/* Probability Display */
.probability-card {
  background: var(--gradient-primary);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.probability-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.probability-content {
  position: relative;
  z-index: 1;
}

.probability-value {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.probability-label {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.probability-band {
  display: flex;
  justify-content: space-around;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.probability-band-item {
  text-align: center;
}

.probability-band-label {
  font-size: 0.75rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.probability-band-value {
  font-weight: 600;
}

/* Chart Components */
.chart-container {
  position: relative;
  height: 300px;
  margin: 1rem 0;
}

.chart-canvas {
  width: 100%;
  height: 100%;
}

/* Scenario Band Chart */
.scenario-bands {
  position: relative;
  height: 250px;
  margin: 2rem 0;
}

.band {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 4px;
}

.band-worst {
  background: rgba(239, 68, 68, 0.2);
  bottom: 0;
  height: 30%;
}

.band-expected {
  background: rgba(34, 211, 238, 0.3);
  bottom: 20%;
  height: 40%;
}

.band-best {
  background: rgba(34, 197, 94, 0.3);
  bottom: 50%;
  height: 30%;
}

.goal-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  z-index: 10;
}

.goal-label {
  position: absolute;
  right: 0.5rem;
  top: -1.5rem;
  background: var(--card-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--surface-dark);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Insights Section */
.insights {
  background: var(--surface-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 6px;
  border-left: 4px solid var(--accent-cyan);
}

.insight-icon {
  width: 20px;
  height: 20px;
  background: var(--accent-cyan);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.insight-text {
  color: var(--text-secondary);
  margin: 0;
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-muted);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error States */
.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--risk-red);
  color: #FCA5A5;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.error-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--risk-red);
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
  font-weight: 700;
  margin-right: 0.5rem;
}

/* Footer */
.footer {
  background: var(--surface-dark);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--accent-cyan);
}

/* Disclaimer */
.disclaimer {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning-orange);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  font-size: 0.875rem;
  color: #FCD34D;
}

.disclaimer-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--warning-orange);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
  }
  
  .probability-value {
    font-size: 2.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .scenario-bands {
    height: 200px;
  }
  
  .header-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 1rem;
  }
  
  .probability-value {
    font-size: 2rem;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

.bounce-in {
  animation: bounceIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Hero Section */
.hero-section {
  padding: 2rem 0;
}

.supporting-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0;
}

/* Form Sections */
.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent-cyan);
}

/* FAQ Styles */
.faq-content {
  display: grid;
  gap: 1.5rem;
}

.faq-item {
  padding: 1.5rem;
  background: var(--surface-dark);
  border-radius: 8px;
  border-left: 4px solid var(--accent-cyan);
}

.faq-item h3 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
}

.faq-item p {
  margin: 0;
  color: var(--text-secondary);
}

/* Content Area */
.content p {
  margin-bottom: 1rem;
}

.content p:last-child {
  margin-bottom: 0;
}

/* Header Navigation */
.header-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Results Section */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Educational Content */
.educational-content {
  margin-top: 3rem;
}

/* Calculator Section */
.calculator-section {
  margin-top: 2rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.hidden { display: none; }
.visible { display: block; }
