/* Home Purchase Planner Styles */

/* Tool-specific color overrides (only when needed) */
:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --secondary: #3b82f6;
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
}

/* Muted text elements use theme text color with reduced opacity for light/dark mode compatibility */
.hero-subtitle,
.card-subtitle,
.profile-name,
.profile-desc,
.profile-location,
.help-text,
.summary-label,
.summary-subtitle,
.section-description,
.cost-row,
.help-item p {
  color: var(--text-color);
  opacity: 0.7;
}

.comparison-note p {
  color: var(--text-color);
  opacity: 0.7;
}

/* Hero Section - uses theme colors for light/dark mode compatibility */
.home-hero {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-color) 100%);
  padding: 3rem 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
}

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

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

/* Calculator Cards */
.calculator-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Profile Cards */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.profile-card {
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.profile-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.profile-emoji {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.profile-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* color set by muted text rule above */
}

.profile-desc {
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* color set by muted text rule above */
}

.profile-location {
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  /* color set by muted text rule above */
}

.profile-price {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

.loading-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Calculator Layout */
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input:read-only {
  background: var(--bg-color);
  opacity: 0.7;
  cursor: not-allowed;
}

.help-text {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Tier Buttons */
.tier-buttons,
.config-buttons {
  display: flex;
  gap: 0.75rem;
}

.tier-btn,
.config-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.tier-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.tier-btn i {
  font-size: 1.5rem;
}

.tier-btn:hover,
.config-btn:hover {
  border-color: var(--primary);
}

.tier-btn.active,
.config-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Property Type Buttons */
.property-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.property-type-btn {
  padding: 1rem;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.property-type-btn i {
  font-size: 1.75rem;
}

.property-type-btn:hover {
  border-color: var(--primary);
}

.property-type-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Summary Card */
.calculator-summary {
  position: relative;
}

.summary-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.summary-card.sticky {
  position: sticky;
  top: 20px;
}

.summary-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-section {
  margin-bottom: 1rem;
}

.summary-subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.summary-label {
  color: var(--text-muted);
}

.summary-value {
  color: var(--text-color);
  font-weight: 600;
}

.summary-row.total {
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
}

.summary-row.highlight {
  background: rgba(16, 185, 129, 0.1);
  padding: 0.75rem;
  border-radius: 6px;
  margin: 0.5rem 0;
}

.summary-row.highlight .summary-value {
  color: var(--primary);
}

.summary-divider {
  height: 1px;
  background: var(--border-color);
  margin: 1rem 0;
}

/* Use in Plan Button */
.use-in-plan-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.use-in-plan-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Rent vs Buy Section */
.rent-vs-buy-section {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.toggle-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  border-color: var(--primary);
}

.section-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.comparison-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  border-color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.comparison-summary {
  background: var(--bg-color);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.comparison-summary.buying-wins {
  border: 2px solid var(--success);
}

.comparison-summary.renting-wins {
  border: 2px solid var(--secondary);
}

.winner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.savings-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

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

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.comparison-column {
  background: var(--bg-color);
  border-radius: 10px;
  padding: 1.25rem;
}

.comparison-column h4 {
  color: var(--text-color);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.cost-row.total {
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
  color: var(--text-color);
}

.cost-row.asset {
  color: var(--success);
}

.cost-row.net {
  background: rgba(59, 130, 246, 0.1);
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.cost-row.net.winner {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.comparison-note {
  background: rgba(59, 130, 246, 0.1);
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.comparison-note i {
  color: var(--secondary);
  margin-top: 0.25rem;
}

.comparison-note p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Help Section */
.help-section {
  margin-top: 2rem;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.help-item h4 {
  color: var(--text-color);
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-item p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.5;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card-bg);
  color: var(--text-color);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .profiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .property-type-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tier-buttons,
  .config-buttons {
    flex-wrap: wrap;
  }

  .summary-card.sticky {
    position: static;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .profiles-grid {
    grid-template-columns: 1fr 1fr;
  }

  .property-type-grid {
    grid-template-columns: 1fr;
  }

  .comparison-tabs {
    flex-direction: column;
  }
}
