@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700;800&display=swap');

/* Colors & Styling System */
:root {
  --bg-gradient-start: #060814;
  --bg-gradient-end: #0e122b;
  --panel-bg: rgba(15, 23, 42, 0.45);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-glow: rgba(99, 102, 241, 0.05);
  
  --color-primary: #f59e0b; /* Amber/Sun Gold */
  --color-primary-hover: #fbbf24;
  --color-secondary: #38bdf8; /* Sky Blue */
  --color-accent: #8b5cf6; /* Sunset Violet */
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --chart-pos: #fbbf24; /* Warm sun gold for daylight gain */
  --chart-neg: #f43f5e; /* Rose/crimson for daylight loss */
}

/* Base Styles */
html,
body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, var(--bg-gradient-start) 70%), var(--bg-gradient-start);
  background-attachment: fixed;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  text-shadow: none;
  box-shadow: none;
}

h1, h2, h3, h4, h5, h6, .cover-heading, .masthead-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--color-secondary);
  transition: all 0.2s ease-in-out;
}

a:hover, a:focus {
  color: var(--color-primary-hover);
  text-decoration: none;
}

/* Header & Nav */
.cover-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.masthead {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 3rem;
  backdrop-filter: blur(8px);
}

.masthead-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #fff 60%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.masthead-brand img {
  height: 32px;
  width: 32px;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.4));
}

.nav-masthead .nav-link {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-masthead .nav-link:hover,
.nav-masthead .nav-link:focus {
  color: var(--text-main);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.nav-masthead .active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Welcome Cover Section */
.inner.cover {
  max-width: 600px;
  margin: auto;
  padding: 3rem 1.5rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  margin-top: 10vh;
  margin-bottom: 10vh;
}

.cover-heading {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #ffffff, #d8b4fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.7;
  color: #cbd5e1;
}

/* Premium Buttons */
.btn-secondary {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: #0f172a !important;
  background: linear-gradient(135deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
  border: none;
  border-radius: 12px;
  padding: 0.75rem 2rem;
  box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
}

.btn-secondary:hover,
.btn-secondary:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #fcd34d 0%, var(--color-primary-hover) 100%);
}

/* Glassmorphic Grid & Widgets */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding: 0 1rem;
}

.glass-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  padding: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 0%, var(--panel-glow), transparent 60%);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.glass-card h4, .glass-card p.chart-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid var(--color-primary);
  padding-left: 0.75rem;
}

/* Column Span Classes */
.col-lg-8 { grid-column: span 8; }
.col-lg-4 { grid-column: span 4; }
.col-lg-6 { grid-column: span 6; }
.col-lg-12 { grid-column: span 12; }

@media (max-width: 992px) {
  .col-lg-8, .col-lg-4, .col-lg-6 {
    grid-column: span 12;
  }
}

/* DC.js / D3 Custom Overrides */
.chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
}

.chart .reset {
  position: absolute;
  top: 0;
  right: 10px;
  z-index: 10;
}

.dc-chart {
  float: none;
}

.dc-chart rect.bar {
  stroke: none;
  cursor: pointer;
  rx: 3px; /* Rounded corners for bars */
  ry: 3px;
  transition: fill-opacity 0.2s ease;
}

.dc-chart rect.bar:hover {
  fill-opacity: 0.85;
}

/* X & Y Axis styles */
.dc-chart g.axis path,
.dc-chart g.axis line {
  stroke: rgba(255, 255, 255, 0.15);
}

.dc-chart g.axis text {
  fill: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
}

.dc-chart g.grid-line line {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-dasharray: 2, 2;
}

/* Pie Chart overrides */
.dc-chart .pie-slice {
  fill-opacity: 0.9;
  stroke: var(--bg-gradient-start);
  stroke-width: 2px;
}

.dc-chart .pie-slice:hover {
  fill-opacity: 1;
}

.dc-chart text.pie-slice,
.dc-chart text.pie-slice-label,
.dc-chart .pie-slice-group text,
.dc-chart .pie-label-group text,
.dc-chart .dc-legend-item text {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  fill: #fff !important;
  stroke: none !important;
}

/* Heatmap Chart overrides */
.dc-chart .heatmap-box-wrapper {
  stroke: var(--bg-gradient-start);
  stroke-width: 1px;
}

.dc-chart .heatmap-box-wrapper:hover {
  stroke: #fff;
  stroke-width: 1.5px;
}

/* Legend overrides */
.dc-chart .dc-legend {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  fill: var(--text-main);
}

/* Reset / Clear Buttons */
.reset {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-secondary) !important;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  text-transform: lowercase;
}

.reset:hover {
  color: var(--color-primary-hover) !important;
  background: rgba(245, 158, 11, 0.15);
}

/* Footer styling */
.mastfoot {
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.85rem;
  background: rgba(6, 8, 20, 0.8);
  backdrop-filter: blur(8px);
}

/* KPI Cards */
.kpi-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  min-height: 120px;
}

.kpi-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 50%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Responsive dividers for combined layouts */
@media (min-width: 768px) {
  .border-md-left {
    border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
  }
}
@media (max-width: 767.98px) {
  .border-sm-top {
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
  }
}
@media (min-width: 992px) {
  .border-lg-left {
    border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
  }
}
@media (max-width: 991.98px) {
  .border-lg-top {
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
  }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .border-tb-top {
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
  }
  .border-tb-left-none {
    border-left: none !important;
  }
}
