/* ========== PMU SIGNAL ========== */

/* ================== VARIABLES ================== */
/* ========== BODY & OVERALL LAYOUT ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
  color: #e0e0e0;
  font-family: "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

/* HEADER */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 2px solid #00e5ff;
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
  width: 100%;
  margin: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  font-size: 32px;
}

.top-bar h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #e0e0e0;
  margin: 0;
}

.status-inline {
  display: flex;
  gap: 25px;
}

.status-item {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-item.normal {
  color: #00ff88;
}

.status-item.suspicious {
  color: #ffcc00;
}

.status-item.anomaly {
  color: #ff3b3b;
}

/* NAVIGATION MENU */
.nav-menu {
  display: flex;
  gap: 30px;
}

.nav-item {
  color: #00e5ff;
  text-decoration: none;
  font-size: 14px;
  padding-bottom: 5px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
  border-bottom-color: #00e5ff;
}

/* ========== PMU MONITORING PAGE - FULL WIDTH ========== */

.pmu-monitoring-container {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: calc(100vh - 100px);
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
  width: 100%;
  margin: 0;
}

.pmu-monitoring-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 25px 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #00e5ff;
  width: 100%;
  margin: 0;
}

.pmu-monitoring-header h2 {
  color: #e0e0e0;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.subtitle {
  color: #a0a0a0;
  font-size: 13px;
  margin: 0;
}

.pmu-status-badges {
  display: flex;
  gap: 12px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.sync {
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  border: 1px solid #00ff88;
}

/* METRICS ROW */
.pmu-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  width: 100%;
  padding: 25px 30px;
  margin: 0;
}

.metric-card {
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid #00e5ff;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
  transition: all 0.3s ease;
}

.metric-card:hover {
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.45);
  transform: translateY(-2px);
}

.metric-card h3 {
  color: #00e5ff;
  font-size: 11px;
  text-transform: uppercase;
  margin: 0 0 10px 0;
  letter-spacing: 0.5px;
}

.metric-value {
  color: #00e5ff;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  font-family: 'Monaco', 'Courier New', monospace;
}

.metric-unit {
  color: #a0a0a0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* CHARTS GRID - STACKED VERTICALLY WITH LARGER HEIGHT */
.pmu-charts-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding: 0 30px;
  margin: 0;
}

.pmu-chart-card {
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid #00e5ff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  width: 100%;
  margin: 0;
}

.pmu-chart-card:hover {
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.45);
  transform: translateY(-2px);
}

.pmu-chart-card h3 {
  color: #00e5ff;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 15px 0;
}

/* INCREASED CHART HEIGHT FOR BETTER VISIBILITY */
.pmu-chart-card canvas {
  width: 100% !important;
  height: 350px !important;
  max-height: 350px !important;
  margin: 0 !important;
}

/* SIDEBAR - BELOW CHARTS */
.pmu-sidebar-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  width: 100%;
  padding: 0 30px 30px 30px;
  margin: 0;
}

.pmu-sidebar-card {
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid #00e5ff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
  transition: all 0.3s ease;
  margin: 0;
}

.pmu-sidebar-card:hover {
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.45);
  transform: translateY(-2px);
}

.pmu-sidebar-card h3 {
  color: #00e5ff;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 15px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* HEALTH METRICS */
.health-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.health-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
  font-size: 12px;
}

.health-row:last-child {
  border-bottom: none;
}

.health-label {
  color: #a0a0a0;
}

.health-value {
  font-weight: 600;
  font-size: 14px;
  font-family: 'Monaco', 'Courier New', monospace;
}

.health-value.green {
  color: #00ff88;
}

.health-value.yellow {
  color: #ffcc00;
}

.health-value.red {
  color: #ff3b3b;
}

/* FACTOR LIST */
.factor-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.factor-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.factor-label {
  color: #e0e0e0;
  font-size: 12px;
  font-weight: 500;
}

.factor-bar-wrapper {
  width: 100%;
  height: 6px;
  background: rgba(0, 229, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.factor-bar {
  height: 100%;
  border-radius: 3px;
}

/* ========== SETTINGS PAGE STYLES ========== */

.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 25px 30px;
  min-height: calc(100vh - 100px);
}

/* ========== CHART CONTAINERS ========== */
.chart-container {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.1);
}

.chart-title {
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
}

.chart-container canvas {
  width: 100%;
  height: 150px;
  background: rgba(15, 25, 45, 0.5);
  border-radius: 6px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
}

.chart-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 229, 255, 0.1);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #a0a0a0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

/* ========== SETTINGS GRID ========== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

/* ========== SETTINGS PANEL ========== */
.settings-panel {
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid #00e5ff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25), 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(0, 229, 255, 0.1);
  transition: all 0.3s ease;
}

.settings-panel:hover {
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.4), 0 8px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(0, 229, 255, 0.15);
}

.settings-panel h2 {
  color: #00e5ff;
  font-size: 16px;
  margin-bottom: 15px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* ========== CONFIGURATION TABLES ========== */
.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.config-table th {
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff;
  padding: 12px 10px;
  text-align: left;
  border-bottom: 2px solid #00e5ff;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.config-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
  color: #e0e0e0;
}

.config-table tbody tr:hover {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.1);
}

/* ========== STATUS INDICATORS ========== */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
}

.status-indicator.active {
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

.status-indicator.offline {
  color: #ff3b3b;
  text-shadow: 0 0 8px rgba(255, 59, 59, 0.4);
}

/* ========== BUTTON STYLES ========== */
.btn {
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  margin-right: 5px;
}

.btn-primary {
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
  border: 1px solid #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
  background: rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(255, 59, 59, 0.2);
  color: #ff3b3b;
  border: 1px solid #ff3b3b;
  box-shadow: 0 0 8px rgba(255, 59, 59, 0.3);
}

.btn-danger:hover {
  background: rgba(255, 59, 59, 0.3);
  box-shadow: 0 0 15px rgba(255, 59, 59, 0.5);
  transform: translateY(-1px);
}

/* ========== STATISTICS PANEL ========== */
.stats-panel {
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid #00e5ff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25), 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(0, 229, 255, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-item {
  text-align: center;
  padding: 20px;
  background: rgba(0, 229, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.1);
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.3), inset 0 0 10px rgba(0, 229, 255, 0.1);
}

.stat-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.4));
}

.stat-item h3 {
  color: #e0e0e0;
  font-size: 14px;
  margin: 10px 0;
  font-weight: 600;
}

.stat-number {
  color: #00e5ff;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

/* ================== RESPONSIVE ================== */

/* Medium screens: tablets / small desktops */
@media (max-width: 1200px) {
  .pmu-metrics-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }

  .pmu-sidebar-section {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .pmu-chart-card canvas {
    height: 300px !important;
  }
}

/* Small screens: phones in landscape / tablets */
@media (max-width: 768px) {
  /* Top bar */
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 20px;
    gap: 12px;
  }

  .top-bar h1 {
    font-size: 18px;
  }

  .status-inline {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Navigation menu */
  .nav-menu {
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
  }

  /* Monitoring header */
  .pmu-monitoring-header {
    flex-direction: column;
    gap: 12px;
    padding: 15px 20px;
  }

  /* Metrics row */
  .pmu-metrics-row {
    grid-template-columns: 1fr;
    padding: 15px 20px;
    gap: 12px;
  }

  /* Charts grid */
  .pmu-charts-grid {
    flex-direction: column;
    padding: 0 20px;
    gap: 15px;
  }

  /* Sidebar section */
  .pmu-sidebar-section {
    grid-template-columns: 1fr;
    padding: 0 20px 20px 20px;
    gap: 15px;
  }

  /* Cards */
  .metric-card,
  .pmu-chart-card,
  .pmu-sidebar-card {
    padding: 12px;
  }

  .pmu-chart-card canvas {
    height: 280px !important;
  }

  .settings-layout {
    padding: 15px;
    gap: 15px;
  }

  .settings-panel {
    padding: 15px;
  }

  .panel-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .config-table {
    font-size: 12px;
  }

  .config-table th,
  .config-table td {
    padding: 8px 5px;
  }

  .chart-container {
    padding: 15px;
  }

  .chart-container canvas {
    height: 100px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Extra small screens: phones in portrait */
@media (max-width: 480px) {
  .top-bar {
    padding: 8px 12px;
    gap: 8px;
  }

  .top-bar h1 {
    font-size: 16px;
  }

  .nav-menu {
    font-size: 10px;
    gap: 8px;
  }

  .pmu-monitoring-header {
    padding: 10px 12px;
  }

  .pmu-metrics-row,
  .pmu-charts-grid,
  .pmu-sidebar-section {
    padding: 10px 12px;
    gap: 10px;
  }

  .metric-card,
  .pmu-chart-card,
  .pmu-sidebar-card {
    padding: 10px;
  }

  .pmu-chart-card canvas {
    height: 220px !important;
  }

  .metric-value {
    font-size: 24px;
  }

  .metric-card h3 {
    font-size: 10px;
  }

  .pmu-chart-card h3 {
    font-size: 12px;
  }

  .settings-layout {
    padding: 10px;
    gap: 10px;
  }

  .panel-header {
    flex-direction: column;
  }

  .status-badge {
    flex-direction: column;
    align-items: flex-start;
  }

  .config-table {
    font-size: 11px;
  }

  .btn-small {
    padding: 5px 10px;
    font-size: 11px;
    margin-right: 3px;
  }
}
canvas {
  width: 100% !important;
  height: 250px !important; /* REQUIRED */
}
.chart-container {
  width: 100%;
  min-height: 250px; /* prevents flex collapse */
}

/* Optional: ensure body height is flexible */
html, body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
}