/* Consumption Chart Styles */
.consumption-chart {
  padding: 25px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.consumption-chart-title {
  color: #2c3e50;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 20px 0;
  text-align: center;
}

.consumption-chart-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.consumption-chart-legend {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

.legend-color.current-year {
  background-color: #549EBA;
}

.legend-color.last-year {
  background-color: #A8E2E4;
}

.chart-wrapper {
  position: relative;
  background: #ffffff;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 20px;
}

.chart-bars-container {
  display: flex;
  justify-content: space-between;
  align-items: end;
  height: 200px;
  margin-bottom: 15px;
  padding: 0 10px;
  border-bottom: 2px solid #dee2e6;
  position: relative;
}

.chart-period {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 4px;
  max-width: calc(100% / 6);
  min-width: 60px;
  height: 100%;
}

.bar-group {
  display: flex;
  gap: clamp(2px, 0.5vw, 8px);
  align-items: end;
  height: 100%;
  width: 100%;
  max-width: clamp(25px, 8vw, 80px);
  justify-content: center;
}

.consumption-bar {
  width: clamp(12px, 3vw, 35px);
  min-height: 4px;
  border-radius: 2px 2px 0 0;
  transition: opacity 0.3s ease;
  position: relative;
}

.consumption-bar.current-year {
  background-color: #549EBA;
}

.consumption-bar.last-year {
  background-color: #A8E2E4;
}

.consumption-bar:hover {
  opacity: 0.8;
}

.consumption-bar::after {
  content: attr(data-value);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.consumption-bar:hover::after {
  opacity: 1;
}

.period-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  margin-top: 10px;
}

.period-label {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
  max-width: calc(100% / 6);
  word-wrap: break-word;
  line-height: 1.2;
}

.chart-axis-label {
  text-align: center;
  margin-top: 15px;
  font-size: 0.85rem;
  color: #495057;
  font-style: italic;
}

.no-consumption-data {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
  font-style: italic;
}

/* Y-axis grid lines for better readability */
.chart-bars-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 100%;
  background-image: 
    linear-gradient(to top, transparent 0%, transparent 24%, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.05) 25%, transparent 26%),
    linear-gradient(to top, transparent 49%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.05) 50%, transparent 51%),
    linear-gradient(to top, transparent 74%, rgba(0,0,0,0.05) 75%, rgba(0,0,0,0.05) 75%, transparent 76%);
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .consumption-chart {
    padding: 15px;
  }
  
  .consumption-chart-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }
  
  .consumption-chart-legend {
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.8rem;
  }
  
  .chart-bars-container {
    height: 150px;
    padding: 0 5px;
  }
  
  .chart-period {
    min-width: 45px;
  }
  
  .bar-group {
    max-width: 30px !important;
    gap: 1px !important;
  }
  
  .consumption-bar {
    width: 14px !important;
  }
  
  .period-labels {
    padding: 0 5px;
  }
  
  .period-label {
    font-size: 0.65rem;
  }
  
  .chart-axis-label {
    font-size: 0.75rem;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .consumption-chart-legend {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .chart-bars-container {
    height: 120px;
  }
  
  .chart-period {
    min-width: 35px;
  }
  
  .bar-group {
    max-width: 25px !important;
  }
  
  .consumption-bar {
    width: 12px !important;
  }
  
  .period-label {
    font-size: 0.6rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .consumption-bar.current-year {
    background-color: #003d5c;
    border: 1px solid #000;
  }
  
  .consumption-bar.last-year {
    background-color: #7bb3b5;
    border: 1px solid #000;
  }
  
  .chart-wrapper {
    border-width: 2px;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .consumption-bar {
    transition: none;
  }
  
  .consumption-bar::after {
    transition: none;
  }
}
