/**
 * PM2 Dashboard Monitor - Main Stylesheet
 * 
 * Contains styling for the dashboard layout, process cards, 
 * tables, logs viewer, charts, and status indicators
 */

/* --------------------
   Global Styles
   -------------------- */
body {
  background-color: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Set chart containers to fixed heights for better display */
.chart-container {
  position: relative;
  height: 250px;
  margin-bottom: 1rem;
}

/* --------------------
   Summary Cards
   -------------------- */
.summary-card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.summary-card:hover {
  transform: translateY(-5px);
}

.summary-icon {
  font-size: 2.5rem;
  width: 60px;
  text-align: center;
}

/* Gradient backgrounds for cards */
.bg-gradient-primary {
  background: linear-gradient(45deg, #4e73df 0%, #224abe 100%);
}

.bg-gradient-success {
  background: linear-gradient(45deg, #1cc88a 0%, #13855c 100%);
}

.bg-gradient-danger {
  background: linear-gradient(45deg, #e74a3b 0%, #be2617 100%);
}

.bg-gradient-info {
  background: linear-gradient(45deg, #36b9cc 0%, #258391 100%);
}

.bg-gradient-warning {
  background: linear-gradient(45deg, #f6c23e 0%, #dda20a 100%);
}

/* --------------------
   Status Badges
   -------------------- */
.status-badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
  color: #fff;
}

.status-online {
  background-color: #28a745;
}

.status-stopped {
  background-color: #ffc107;
  color: #212529;
}

.status-errored {
  background-color: #dc3545;
}

.status-launching {
  background-color: #17a2b8;
}

.status-unknown {
  background-color: #6c757d;
}

/* --------------------
   Log Viewer
   -------------------- */
.log-content {
  padding: 15px;
  max-height: 500px;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  background-color: #212529;
  color: #f8f9fa;
  border-radius: 0 0 4px 4px;
  white-space: pre-wrap;
}

/* Highlight important patterns in logs */
.log-content:empty::before {
  content: "No logs available";
  color: #6c757d;
  font-style: italic;
}

/* Log entry types with color highlighting */
.log-content .http-request {
  color: #61affe; /* Blue for HTTP requests */
  font-weight: bold;
}

.log-content .http-success {
  color: #49cc90; /* Green for successful responses */
  font-weight: bold;
}

.log-content .http-error {
  color: #f93e3e; /* Red for error responses */
  font-weight: bold;
}

/* --------------------
   Action Buttons
   -------------------- */
.btn-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* --------------------
   Tables
   -------------------- */
.table th {
  font-weight: 600;
  vertical-align: middle;
}

.table td {
  vertical-align: middle;
}

/* Sticky table header */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Success/Error progress bars */
.endpoint-stats-bar {
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background-color: #e9ecef;
}

.endpoint-stats-success {
  height: 100%;
  background-color: #1cc88a;
  float: left;
}

.endpoint-stats-error {
  height: 100%;
  background-color: #e74a3b;
  float: left;
}

/* --------------------
   Responsive Adjustments
   -------------------- */
@media (max-width: 767.98px) {
  .log-content {
    max-height: 300px;
  }
  
  .chart-container {
    height: 200px;
  }
  
  .summary-card {
    margin-bottom: 15px;
  }
}

/* --------------------
   Toast Notifications
   -------------------- */
.toast {
  min-width: 250px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.endpoint-method {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8rem;
  font-family: monospace;
}

/* Method-specific colors */
.method-get {
  background-color: #61affe;
  color: white;
}

.method-post {
  background-color: #49cc90;
  color: white;
}

.method-put {
  background-color: #fca130;
  color: white;
}

.method-delete {
  background-color: #f93e3e;
  color: white;
}

.method-patch {
  background-color: #50e3c2;
  color: white;
}

/* Endpoint list hover effect */
#endpoints-list tr {
  cursor: pointer;
  transition: background-color 0.2s;
}

#endpoints-list tr:hover {
  background-color: rgba(0, 123, 255, 0.1);
}

/* Card shadow effect */
.shadow-sm {
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

@media (max-width: 768px) {
  .chart-container {
    height: 200px;
  }
} 