/*!
 * CPWL Dashboard Enhancements for Outager Application
 * Dashboard-specific styling for charts, metrics, and data visualization
 * Based on CPWL Look, Tone and Feel Guidelines V4
 */

/* ===== DASHBOARD PAGE HEADER ===== */

.dashboard-header {
  background: linear-gradient(135deg, var(--cpwl-dark-blue) 0%, var(--cpwl-mid-blue) 100%);
  color: #fff;
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
}

.dashboard-header h1 {
  color: #fff !important;
  font-family: var(--cpwl-font-family);
  font-weight: 700;
  margin-bottom: 0;
}

/* ===== DASHBOARD METRIC CARDS ENHANCEMENT ===== */

/* Enhanced metric card styling */
.dashboard-metric-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  border: 1px solid var(--cpwl-charcoal-grey-light) !important;
}

.dashboard-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 2rem 0 rgba(0, 35, 75, 0.2) !important;
}

/* Metric card icons with CPWL colors */
.dashboard-metric-card .fa-heart-broken {
  color: var(--cpwl-candy-apple) !important;
}

.dashboard-metric-card .fa-check {
  color: var(--cpwl-spring-green) !important;
}

.dashboard-metric-card .fa-stopwatch {
  color: var(--cpwl-mid-blue) !important;
}

.dashboard-metric-card .fa-calendar-check {
  color: var(--cpwl-sunflower-yellow) !important;
}

.dashboard-metric-card .fa-exclamation {
  color: var(--cpwl-candy-apple) !important;
}

.dashboard-metric-card .fa-plug {
  color: var(--cpwl-cheerful-orange) !important;
}

/* Enhanced metric values */
.dashboard-metric-value {
  font-size: 2.5rem !important;
  font-weight: 800 !important;
  color: var(--cpwl-dark-blue) !important;
  font-family: var(--cpwl-font-family);
}

.dashboard-metric-label {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  font-family: var(--cpwl-font-family);
}

/* ===== DASHBOARD SECTION HEADERS ===== */

.dashboard-section-header {
  background: linear-gradient(90deg, var(--cpwl-dark-blue) 0%, var(--cpwl-mid-blue) 100%);
  color: #fff !important;
  padding: 1rem 1.25rem;
  margin-bottom: 0;
  border-radius: 0.35rem 0.35rem 0 0;
  border: none !important;
}

.dashboard-section-header h6 {
  color: #fff !important;
  margin: 0;
  font-weight: 700;
  font-family: var(--cpwl-font-family);
}

.dashboard-section-header a {
  color: #fff !important;
  text-decoration: none;
}

.dashboard-section-header a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: underline;
}

/* ===== CHART CONTAINER STYLING ===== */

.chart-container {
  background: #fff;
  border-radius: 0.35rem;
  box-shadow: 0 0.15rem 1.75rem 0 rgba(0, 35, 75, 0.1);
  border: 1px solid var(--cpwl-charcoal-grey-light);
  overflow: hidden;
}

.chart-header {
  background: var(--cpwl-dark-blue) !important;
  color: #fff !important;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--cpwl-mid-blue);
}

.chart-header h6 {
  color: #fff !important;
  margin: 0;
  font-weight: 600;
  font-family: var(--cpwl-font-family);
  font-size: 1rem;
}

.chart-body {
  padding: 1.5rem;
  background: #fff;
}

/* ===== CHART STYLING OVERRIDES ===== */

/* Chart.js global font overrides */
.chart-pie canvas,
.chart-bar canvas {
  font-family: var(--cpwl-font-family) !important;
}

/* Chart legends */
.chart-pie .chartjs-legend,
.chart-bar .chartjs-legend {
  font-family: var(--cpwl-font-family) !important;
  color: var(--cpwl-charcoal-grey) !important;
}

/* Chart tooltips will be styled via JavaScript */

/* ===== RESPONSIVE DASHBOARD LAYOUT ===== */

@media (max-width: 768px) {
  .dashboard-metric-card {
    margin-bottom: 1rem;
  }
  
  .dashboard-metric-value {
    font-size: 2rem !important;
  }
  
  .chart-container {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 576px) {
  .dashboard-metric-value {
    font-size: 1.75rem !important;
  }
  
  .dashboard-metric-label {
    font-size: 0.7rem !important;
  }
}

/* ===== DASHBOARD GRID IMPROVEMENTS ===== */

.dashboard-metrics-row {
  margin-bottom: 2rem;
}

.dashboard-charts-row {
  margin-bottom: 2rem;
}

.dashboard-section {
  margin-bottom: 3rem;
}

/* ===== ENHANCED BORDER ACCENTS ===== */

/* Current Outages - Danger/Red */
.border-left-current-outages {
  border-left: 0.25rem solid var(--cpwl-candy-apple) !important;
}

/* Completed Outages - Success/Green */
.border-left-completed-outages {
  border-left: 0.25rem solid var(--cpwl-spring-green) !important;
}

/* Downtime Hours - Primary/Blue */
.border-left-downtime {
  border-left: 0.25rem solid var(--cpwl-mid-blue) !important;
}

/* Planned Outages - Warning/Yellow */
.border-left-planned {
  border-left: 0.25rem solid var(--cpwl-sunflower-yellow) !important;
}

/* Unplanned Outages - Danger/Red */
.border-left-unplanned {
  border-left: 0.25rem solid var(--cpwl-candy-apple) !important;
}

/* Power Outages - Orange */
.border-left-power {
  border-left: 0.25rem solid var(--cpwl-cheerful-orange) !important;
}

/* ===== DASHBOARD ANIMATIONS ===== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-metric-card {
  animation: fadeInUp 0.6s ease-out;
}

.chart-container {
  animation: fadeInUp 0.8s ease-out;
}

/* Stagger animation delays for metric cards */
.dashboard-metric-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-metric-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-metric-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-metric-card:nth-child(4) { animation-delay: 0.4s; }
.dashboard-metric-card:nth-child(5) { animation-delay: 0.5s; }
.dashboard-metric-card:nth-child(6) { animation-delay: 0.6s; }

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

.dashboard-metric-card:focus {
  outline: 2px solid var(--cpwl-mid-blue);
  outline-offset: 2px;
}

.chart-container:focus {
  outline: 2px solid var(--cpwl-mid-blue);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .dashboard-metric-card {
    border: 2px solid var(--cpwl-mid-blue) !important;
  }
  
  .chart-container {
    border: 2px solid var(--cpwl-mid-blue) !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .dashboard-metric-card,
  .chart-container {
    animation: none;
    transition: none;
  }
  
  .dashboard-metric-card:hover {
    transform: none;
  }
}

/* ===== CPWL BRAND INTEGRATION ===== */

/* Dashboard branding elements */
.cpwl-brand-accent {
  background: linear-gradient(45deg, var(--cpwl-dark-blue), var(--cpwl-mid-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.cpwl-divider {
  height: 3px;
  background: linear-gradient(90deg, var(--cpwl-dark-blue) 0%, var(--cpwl-mid-blue) 50%, var(--cpwl-dark-blue) 100%);
  border: none;
  margin: 2rem 0;
}

/* Dashboard status indicators */
.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-indicator.active {
  background-color: var(--cpwl-spring-green);
  box-shadow: 0 0 0 2px rgba(58, 163, 73, 0.3);
}

.status-indicator.inactive {
  background-color: var(--cpwl-candy-apple);
  box-shadow: 0 0 0 2px rgba(238, 36, 59, 0.3);
}

.status-indicator.warning {
  background-color: var(--cpwl-sunflower-yellow);
  box-shadow: 0 0 0 2px rgba(254, 192, 15, 0.3);
}
