
:root {
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --background-color: #f8f9fa;
  --card-background: #ffffff;
  --text-color: #333;
  --label-color: #555;
  --border-color: #dee2e6;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --positive-color: #28a745;
  --negative-color: #dc3545;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  --pie-color-1: #007bff;
  --pie-color-2: #28a745;
  --pie-color-3: #ffc107;
}


#calculator-form .input-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  #calculator-form .input-section {
    grid-template-columns: 1fr 1fr;
  }
}

#calculator-form fieldset {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
  margin: 0;
}

#calculator-form legend {
  font-weight: 600;
  padding: 0 10px;
  color: var(--primary-color);
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-size: 0.9em;
  color: var(--label-color);
  margin-bottom: 5px;
  font-weight: 500;
}

.input-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1em;
  box-sizing: border-box;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.tooltip-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 50%;
  background: #ccc;
  color: white;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
  position: relative;
}
.tooltip-icon:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.8em;
  white-space: nowrap;
  z-index: 10;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s;
}

.button-container {
  text-align: center;
  margin-top: 20px;
}

#calculator-form button {
  padding: 12px 30px;
  font-size: 1.1em;
  font-weight: 600;
  color: white;
  background-color: var(--primary-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#calculator-form button:hover {
  background-color: var(--primary-hover);
}

#calculator-results {
  margin-top: 30px;
  animation: fadeIn 0.5s ease-in-out;
}

#calculator-results.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#calculator-results h2, #calculator-results h3, #calculator-results h4 {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 20px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.card {
  background: var(--background-color);
  padding: 15px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.card h3 {
  font-size: 1em;
  margin: 0 0 5px 0;
  color: var(--label-color);
}

.card p {
  font-size: 1.4em;
  font-weight: 600;
  margin: 0;
}

.card .large-value {
  font-size: 1.8em;
  color: var(--primary-color);
}

.positive-value { color: var(--positive-color); }
.negative-value { color: var(--negative-color); }

.visual-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

@media (min-width: 768px) {
  .visual-section {
    grid-template-columns: 1fr 2fr;
    align-items: center;
  }
}

.chart-container h4 {
  margin: 0 0 15px 0;
  font-size: 1.1em;
  color: var(--text-color);
}

#pie-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#pie-chart {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background-image: conic-gradient(
    var(--pie-color-1) 0% 33%, 
    var(--pie-color-2) 33% 66%, 
    var(--pie-color-3) 66% 100%
  );
}

#pie-chart-legend {
  font-size: 0.9em;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.legend-item {
  display: flex;
  align-items: center;
}

.legend-color {
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 2px;
}

#bar-chart {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 200px;
  border-bottom: 2px solid var(--border-color);
  padding: 0 10px;
  position: relative;
}

.bar {
  flex: 1;
  background-color: var(--primary-color);
  margin: 0 1%;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
}

.bar:hover {
  background-color: var(--primary-hover);
}

.bar-tooltip {
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
  pointer-events: none;
}

.bar:hover .bar-tooltip {
  opacity: 1;
  visibility: visible;
}

.details-section .table-wrapper {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.details-section table {
  width: 100%;
  border-collapse: collapse;
}

.details-section th, .details-section td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
}

.details-section thead th {
  background-color: var(--background-color);
  position: sticky;
  top: 0;
  font-weight: 600;
}

.details-section tbody tr:last-child td {
  border-bottom: none;
}

.details-section tbody tr:nth-child(even) {
  background-color: var(--background-color);
}

.details-section td:first-child, .details-section th:first-child {
  text-align: left;
  font-weight: bold;
}

