/* dashboard.css - Dashboard-specific styles */

/* The legend for the removed Balancing Mechanism Units chart - keeping for reference */
.legend {
  display: none;
}

/* Add standardized container styles for all tiles */
.chart-container {
  width: 100%;
  min-height: 400px;
  height: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.fuel-mix-container {
  min-height: 400px;
  height: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.6s ease forwards;
  animation-delay: 0.25s;
}

/* Chart Container Styles */
.radar-chart-container,
.treemap-chart-container {
  min-height: 800px;
  height: auto;
  width: 100%;
  margin: 20px 0;
  animation: fade-in 0.6s ease forwards;
  animation-delay: 0.25s;
}

/* Charts are hidden by default and shown via JavaScript */
.radar-chart-container,
.treemap-chart-container {
  display: none;
}

/* Show charts when they have the chart-visible class */
.radar-chart-container.chart-visible,
.treemap-chart-container.chart-visible {
  display: block;
}

/* Hide charts when they have the chart-hidden class */
.chart-hidden {
  display: none !important;
}

/* Chart type toggle button */
#chart-type-toggle {
  margin-left: 10px;
}

/* Radar Chart Styles */
.radar-chart-container {
  width: 100%;
  margin: 20px 0;
  animation: fade-in 0.6s ease forwards;
  animation-delay: 0.25s;
  border-radius: 12px;
  overflow: hidden;
}

#radar-chart {
  width: 100%;
  height: 700px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
}

.chart-description {
  padding: 10px 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 10px;
}

#fuelMixChartDiv {
  width: 100%;
  flex: 1;
  min-height: 350px;
  padding: 10px;
  position: relative;
}

.fuel-legend {
  display: none; /* Hide the fuel legend */
}

.fuel-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 6px 12px;
  border-radius: 20px;
  color: white;
  font-size: 13px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fuel-legend-item:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.fuel-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 6px;
}

/* No data message */
.no-data-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 20px;
}

.no-data-icon {
  margin-bottom: 15px;
  opacity: 0.7;
}

/* Summary styles for components that might be missing */
.summary-header {
  margin-bottom: 15px;
}

.component-stats {
  margin-top: 15px;
}

.component-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.component-row:last-child {
  border-bottom: none;
}

.component-label {
  font-weight: 500;
}

.component-value {
  font-weight: 600;
}

/* Add fab button style */
.fab-button {
  position: fixed;
  right: 30px;
  bottom: 100px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: var(--transition-normal);
  z-index: 1000;
  border: none;
  animation: slide-in-right 0.5s ease forwards;
  animation-delay: 0.8s;
}

.fab-button:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Apply animations to main elements */
.controls, .chart-container, .data-summary, .bmu-info, .radar-chart-container {
  animation: fade-in 0.6s ease forwards;
}

.controls {
  animation-delay: 0.1s;
}

.chart-container {
  animation-delay: 0.2s;
}

.radar-chart-container {
  animation-delay: 0.25s;
}

.data-summary {
  animation-delay: 0.3s;
}

.bmu-info {
  animation-delay: 0.4s;
}


/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .fuel-mix-container, .chart-container, .radar-chart-container {
    min-height: 350px;
    width: 100%;
  }
  
  #fuelMixChartDiv {
    min-height: 300px;
  }
  
  #radar-chart {
    height: 500px;
  }
  
  .fab-button {
    right: 20px;
    bottom: 90px;
    width: 50px;
    height: 50px;
  }
}

/* Chart controls */
.chart-controls {
  display: flex;
  justify-content: center;
  padding: 10px 15px;
  gap: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.realtime-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4CAF50;
  margin-left: auto;
  padding: 4px 8px;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 4px;
}

.realtime-indicator i {
  width: 14px;
  height: 14px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.realtime-indicator.hidden {
  display: none;
}

/* Unplanned Maintenance Styles */
.maintenance-content {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 15px;
}

.maintenance-tile {
  flex: 1 1 300px;
  max-width: calc(33.333% - 15px);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  padding: 15px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.maintenance-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
}

.maintenance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.maintenance-header .unit-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.maintenance-header .fuel-type {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.capacity-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.capacity-meter {
  height: 8px;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.capacity-meter::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--reduction, 0%);
  background-color: var(--color, #f44336);
  border-radius: 4px;
}

.capacity-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.capacity-value {
  font-weight: 600;
  color: var(--color, #f44336);
}

.capacity-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.capacity-details .asset-id {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 5px;
}

.capacity-details .capacity-unavailable {
}

.maintenance-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
}

.maintenance-footer .cause {
  font-weight: 500;
  font-size: 0.9rem;
}

.maintenance-footer .time-period {
  font-size: 0.8rem;
  opacity: 0.7;
}

.no-data-message {
  width: 100%;
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

/* Media Queries for Responsive Layout */
@media (max-width: 1200px) {
  .maintenance-tile {
    max-width: calc(50% - 15px);
  }
}

@media (max-width: 768px) {
  .maintenance-tile {
    max-width: 100%;
  }
}

/* Summary tile for total unavailable production */
.summary-tile {
  background-color: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
}

.summary-tile .total-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 15px 0;
}

.summary-tile .total-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(255, 87, 34, 0.9);
  margin-bottom: 5px;
}

.summary-tile .total-subtitle {
  font-size: 1rem;
  opacity: 0.7;
  margin-bottom: 10px;
}

.summary-tile .total-count {
  font-size: 0.9rem;
  background-color: rgba(255, 87, 34, 0.2);
  padding: 5px 15px;
  border-radius: 15px;
  font-weight: 500;
}

/* Media query adjustments for summary tile */
@media (max-width: 768px) {
  .summary-tile .total-value {
    font-size: 2rem;
  }
}

/* Info section styling */
.info-content {
  padding: 15px 20px;
}

.info-content p {
  margin-bottom: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.info-content p:last-child {
  margin-bottom: 0;
}

/* Additional Control Panel Styling to match interconnectors */
.controls-flex-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 15px;
  min-width: 0; /* Allows the container to shrink below its content size */
}

.compact-controls {
  padding-bottom: 15px;
}

.compact-header {
  padding: 10px 15px;
  margin-bottom: 0;
}

.compact-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-group label {
  margin-bottom: 0;
  min-width: 50px;
}

.period-control {
  flex: 1;
  min-width: 200px;
}

.compact-slider {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Button group for side-by-side buttons */
.button-group {
  display: flex;
  gap: 10px;
  margin-left: auto; /* Push to the right side */
  margin-right: 0;
}

.compact-button {
  padding: 8px 15px;
  white-space: nowrap;
  flex-shrink: 0; /* Prevent buttons from shrinking */
}

@media (max-width: 768px) {
  .controls-flex-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .compact-group {
    width: 100%;
  }
  
  .button-group {
    width: 100%;
    justify-content: space-between;
  }
}
