/* FIRE Calculator Styles */

#fire-calculator {
  margin: 2rem 0;
}

/* Sections */
.calc-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}

.calc-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--text, #1c1c1c);
}

.calc-section h4 {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--secondary, #525252);
}

.section-note {
  font-size: 0.875rem;
  color: var(--secondary, #525252);
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(74, 124, 89, 0.08);
  border-radius: 4px;
}

.input-helper {
  font-size: 0.8125rem;
  color: var(--meddarkgray, #707070);
  margin: 0.25rem 0 0.75rem 0;
  font-style: italic;
}

/* Radio Groups */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.country-selector {
  gap: 0.5rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
}

.radio-label input[type="radio"] {
  margin: 0;
  accent-color: var(--accent, #4a7c59);
}

.radio-label input[type="radio"]:checked + .radio-custom {
  background: var(--accent, #4a7c59);
}

input[type="radio"]:checked ~ * {
  color: var(--accent, #4a7c59);
}

/* Input Grid */
.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.input-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.input-group label {
  font-size: 0.875rem;
  color: var(--secondary, #525252);
  font-weight: 500;
}

.input-group input[type="number"] {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border, #e4e7e2);
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
  transition: border-color 0.2s ease;
}

.input-group input[type="number"]:focus {
  outline: none;
  border-color: var(--accent, #4a7c59);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.input-with-prefix {
  display: flex;
  align-items: stretch;
}

.currency-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--lightgray, #f5f5f5);
  border: 1px solid var(--border, #e4e7e2);
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-size: 0.9375rem;
  color: var(--secondary, #525252);
}

.input-with-prefix input[type="number"] {
  border-radius: 0 6px 6px 0;
  flex: 1;
}

/* Account Groups */
.account-group {
  background: rgba(0, 0, 0, 0.02);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.account-group:last-child {
  margin-bottom: 0;
}

.account-group h4 {
  margin-top: 0;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: var(--accent, #4a7c59);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary:hover {
  background: #3d6549;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-small {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--border, #e4e7e2);
  border-radius: 4px;
  cursor: pointer;
  margin-left: 0.5rem;
}

.btn-small:hover {
  border-color: var(--accent, #4a7c59);
  color: var(--accent, #4a7c59);
}

/* Exchange Rate Info */
.exchange-rate-info {
  font-size: 0.875rem;
  color: var(--secondary, #525252);
  margin-top: 0.5rem;
}

/* Results Section */
.results-section {
  background: rgba(74, 124, 89, 0.03);
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 1rem;
}

.result-card {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.result-card p {
  margin: 0;
}

.status-success {
  background: rgba(74, 124, 89, 0.15);
  border-left: 4px solid var(--accent, #4a7c59);
}

.status-warning {
  background: rgba(255, 159, 64, 0.15);
  border-left: 4px solid #ff9f40;
}

.status-caution {
  background: rgba(255, 193, 7, 0.15);
  border-left: 4px solid #ffc107;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.result-item {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.result-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--secondary, #525252);
  margin-bottom: 0.375rem;
}

.result-value {
  display: block;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text, #1c1c1c);
}

.result-note {
  display: block;
  font-size: 0.75rem;
  color: var(--meddarkgray, #707070);
  margin-top: 0.25rem;
}

/* Chart Container */
.chart-container {
  height: 350px;
  margin: 2rem 0;
  background: white;
  padding: 1rem;
  border-radius: 8px;
}

/* Liquidity Analysis */
.liquidity-analysis {
  margin-top: 1.5rem;
}

.liquidity-analysis h4 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text, #1c1c1c);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border, #e4e7e2);
}

.timeline-item {
  position: relative;
  padding: 0.75rem 0 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 1rem;
  width: 12px;
  height: 12px;
  background: white;
  border: 2px solid var(--accent, #4a7c59);
  border-radius: 50%;
  transform: translateX(-50%);
}

.timeline-item.fire-marker::before {
  background: var(--accent, #4a7c59);
  width: 14px;
  height: 14px;
}

.timeline-item.warning-marker::before {
  background: #c62828;
  border-color: #c62828;
  width: 14px;
  height: 14px;
}

.timeline-item.warning-marker .timeline-age,
.timeline-item.warning-marker .timeline-event {
  color: #c62828;
}

.timeline-item.warning-marker .timeline-strategy {
  color: #c62828;
  font-style: normal;
  font-weight: 500;
}

.timeline-age {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text, #1c1c1c);
}

.timeline-event {
  font-size: 0.875rem;
  color: var(--secondary, #525252);
}

.timeline-balance {
  font-size: 0.8125rem;
  color: var(--meddarkgray, #707070);
  margin-top: 0.25rem;
}

/* Timeline Strategy (combined) */
.timeline-strategy {
  font-size: 0.875rem;
  color: var(--accent, #4a7c59);
  font-style: italic;
  margin-top: 0.25rem;
}

/* Breakdown Table */
.breakdown-table-container {
  margin-top: 2rem;
}

.breakdown-table-container h4 {
  margin-bottom: 0.5rem;
}

.table-note {
  font-size: 0.8125rem;
  color: var(--meddarkgray, #707070);
  margin-bottom: 1rem;
  font-style: italic;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 -0.5rem;
  padding: 0 0.5rem;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.breakdown-table th,
.breakdown-table td {
  padding: 0.625rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border, #e4e7e2);
}

.breakdown-table th {
  background: var(--lightgray, #f5f5f5);
  font-weight: 600;
  color: var(--secondary, #525252);
  text-align: right;
  font-size: 0.8125rem;
}

.breakdown-table th:first-child,
.breakdown-table td:first-child {
  text-align: center;
  font-weight: 600;
}

.breakdown-table td.notes-cell {
  text-align: left;
  font-size: 0.75rem;
  color: var(--meddarkgray, #707070);
  max-width: 150px;
}

.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table tr.fire-row {
  background: rgba(74, 124, 89, 0.1);
}

.breakdown-table tr.fire-row td {
  font-weight: 600;
}

.breakdown-table .positive {
  color: #2e7d32;
}

.breakdown-table .negative {
  color: #c62828;
}

/* Warning value in results */
.warning-value {
  color: #e65100 !important;
}

/* Disclaimer */
.disclaimer {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--secondary, #525252);
}

.disclaimer p {
  margin: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .input-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .radio-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .radio-label {
    width: 100%;
  }
  
  .input-grid {
    grid-template-columns: 1fr;
  }
  
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .result-value {
    font-size: 1.125rem;
  }
  
  .chart-container {
    height: 280px;
    padding: 0.5rem;
  }
}
