/*
 * Hydrogen Build Metrics Browser - Base CSS
 * Core styles, variables, and layout foundation
 */

:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --text-secondary: #666666;
  --accent-color: #0066cc;
  --accent-secondary: #339933;
  --chart-bg: #f8f9fa;
  --panel-bg: #ffffff;
  --border-color: #dee2e6;
  --hover-color: rgba(0, 102, 204, 0.1);
  --active-color: rgba(0, 102, 204, 0.2);
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  --font-family: 'Vanadium Sans Semi-Extended', Tahoma, Geneva, Verdana, sans-serif;
  --transition-speed: 0.3s;
  --slow-transition-speed: 0.8s;
  --panel-transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Main Layout Container */
#main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* Main Chart Container */
#chart-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background-color: var(--chart-bg);
  overflow: hidden;
}

/* SVG Chart */
#metrics-chart {
  width: 100%;
  height: 100%;
  display: block;
}

/* Ensure SVG fills container properly */
#metrics-chart {
  width: 100%;
  height: 100%;
  display: block;
  background-color: var(--chart-bg);
  min-height: 500px;
  transition: width var(--panel-transition-speed) ease;
}

/* Ensure chart axes are visible */
.x-axis line, .y-axis line {
  stroke: var(--border-color);
  stroke-width: 1;
}

.x-axis path, .y-axis path {
  display: none;
}

/* Grid lines styling - 25% darker than border-color */
.horizontal-grid-line,
.month-grid-line,
.year-grid-line {
  stroke: #a7aaad;
  stroke-width: 1;
  stroke-dasharray: 2,2;
}

.x-axis text, .y-axis text {
  fill: var(--text-secondary);
  font-size: 0.8rem;
  font-family: var(--font-family);
  font-weight: 400;
}

/* Y-axis labels centered, x-axis handled by D3 for rotation */
.y-axis text {
  text-anchor: end;
}

/* Chart lines styling */
.metric-line {
  stroke-width: 2;
  fill: none;
  transition: stroke-width 0.2s ease;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-line:hover {
  stroke-width: 3;
}

/* Legend styling */
.legend-title {
  font-family: var(--font-family);
  font-weight: 600;
  fill: var(--text-color);
  font-size: 0.9rem;
}

.legend-label {
  font-family: var(--font-family);
  fill: var(--text-color);
  font-size: 0.8rem;
}

/* Add transition to main layout when panel toggles */
#main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* SVG Chart Title Styling */
.chart-title {
  font-family: var(--font-family);
  font-weight: 600;
  text-shadow: none;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  fill: var(--text-color) !important;
  font-size: 1.2rem;
}

.chart-title:hover {
  text-shadow: none;
  fill: var(--accent-color) !important;
}

/* SVG Overlay - Transparent when panel is visible, visible when collapsed */
.svg-overlay {
  fill: transparent !important;
  cursor: pointer !important;
  opacity: 0 !important;
  transition: opacity var(--panel-transition-speed) ease;
}

/* When panel is collapsed, make overlay visible */
.control-panel.collapsed ~ #chart-container .svg-overlay {
  fill: rgba(0, 0, 0, 0.1) !important;
  opacity: 1 !important;
}

/* Debug borders - commented out for production */
/*
#metrics-chart {
  border: 2px solid rgba(255, 0, 0, 0.8) !important;
}

#chart-container {
  border: 2px solid rgba(0, 0, 0, 0.8) !important;
}

#main-layout {
  border: 2px solid rgba(0, 255, 0, 0.8) !important;
}
*/

/* Tooltip styling for metric paths */
.metric-label-selected {
  position: relative;
}

.metric-label-selected:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--accent-color);
}

/* Copy notification styling */
.copy-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--panel-bg);
  color: var(--text-color);
  padding: 12px 18px;
  border-radius: 6px;
  border: 1px solid var(--accent-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  z-index: 10000;
  animation: slideIn 0.3s ease-out;
  max-width: 400px;
  word-break: break-all;
}

@keyframes slideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}