
.kalkylator {
  border: 1px solid #e0e0e0;
  padding: 20px;
  background: #f1f1f1;
  color: #22352d;
  font-family: sans-serif;
  border-radius: 8px;
}
.kalkylator h2 {
  display: none;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.section {
  margin-bottom: 30px;
}
label {
  display: block;
}
input, select {
  width: 100%;
  margin-top: 4px;
  padding: 6px;
  font-size: 16px;
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 4px;
}
.input-wrapper input {
  flex: 1;
  margin-top: 0;
  padding-right: 70px;
}
.input-wrapper .suffix {
  position: absolute;
  right: 8px;
  color: #666;
  font-size: 16px;
  pointer-events: none;
}
button {
  background: #56aeff;
  color: white;
  padding: 12px 24px;
  border: none;
  font-size: 18px;
  cursor: pointer;
  margin-top: 20px;
}
.navigation {
  margin-top: 30px;
}
#loan_warning_ev, #loan_warning_fossilcar {
  color: #d00;
  font-weight: bold;
  display: none;
  margin-top: 10px;
}
#result_table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
#result_table th, #result_table td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}
#result_table th {
  background: #ddd;
}

/* Responsiv design */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .kalkylator {
    padding: 15px;
  }
  button {
    width: 100%;
    font-size: 16px;
  }
}

/* Felhantering */
input.error {
  border: 2px solid #d00;
  background-color: #ffe6e6;
}

.error-message {
  color: #d00;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

/* Tooltips */
.tooltip {
  position: absolute;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 10000;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  max-width: 250px;
  white-space: normal;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
}

.help-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #56aeff;
  color: white;
  text-align: center;
  line-height: 18px;
  font-size: 12px;
  cursor: help;
  margin-left: 5px;
  vertical-align: middle;
  font-weight: bold;
}

/* Progress indicator */
.progress-container {
  width: 100%;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #56aeff;
  transition: width 0.3s ease;
  border-radius: 2px;
}

/* Resultat-highlighting */
.result-highlight {
  background: #e8f4f8;
  padding: 15px;
  border-radius: 6px;
  margin-top: 20px;
  border-left: 4px solid #56aeff;
}

.result-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}

.result-box {
  padding: 15px;
  border-radius: 6px;
  border: 2px solid #e0e0e0;
}

.result-box.winner {
  border-color: #56aeff;
  background: #e8f4f8;
}

.result-box h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.result-box .amount {
  font-size: 24px;
  font-weight: bold;
  color: #56aeff;
  margin: 10px 0;
}

.result-box .difference {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.result-box .difference.positive {
  color: #56aeff;
}

.result-box .difference.negative {
  color: #d00;
}

/* Keyboard navigation */
input:focus, select:focus, button:focus {
  outline: 2px solid #56aeff;
  outline-offset: 2px;
}

/* Loading state */
.calculating {
  opacity: 0.6;
  pointer-events: none;
}

/* Historik */
.history-panel {
  margin-top: 20px;
  padding: 15px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.history-item {
  padding: 10px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: background 0.2s;
}

.history-item:hover {
  background: #f5f5f5;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item .timestamp {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

/* Dela-knapp (döljs nu) */
.share-button {
  display: none;
}

/* Visualiseringar */
.chart-container {
  margin-top: 20px;
  padding: 15px;
  background: #fff;
  border-radius: 6px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  height: 200px;
  gap: 10px;
  margin-top: 15px;
}

.bar {
  flex: 1;
  background: #56aeff;
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 20px;
  transition: all 0.3s ease;
}

.bar:hover {
  opacity: 0.8;
}

.bar-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  white-space: nowrap;
}

.bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: bold;
}

/* Kostnadsfördelning */
.cost-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.cost-item {
  padding: 10px;
  background: #fff;
  border-radius: 4px;
  border-left: 3px solid #56aeff;
}

.cost-item-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.cost-item-value {
  font-size: 16px;
  font-weight: bold;
  color: #22352d;
}

/* Steg-indikator förbättring */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e0e0e0;
  z-index: 0;
}

.step-indicator .step-link {
  position: relative;
  z-index: 1;
  background: #f1f1f1;
  padding: 5px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid #e0e0e0;
}

.step-indicator .step-link.active {
  background: #56aeff;
  color: white;
  border-color: #56aeff;
}

.step-indicator .step-link.completed {
  background: #56aeff;
  color: white;
  border-color: #56aeff;
}

/* Affiliate-ruta */
.affiliate-box {
  background: #fff;
  border: 2px solid #56aeff;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

.affiliate-label {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 10px;
  color: #666;
  text-decoration: none;
  z-index: 10;
}

.affiliate-label:hover {
  color: #56aeff;
  text-decoration: underline;
}

.affiliate-box p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #22352d;
  padding-top: 20px;
}

.affiliate-box a {
  color: #56aeff;
  text-decoration: underline;
  font-weight: 600;
}

.affiliate-box a:hover {
  color: #145da0;
}
