/**
 * Circloud GUI - Dark Theme
 * Main CSS file that imports modular components
 */

/* Modular CSS imports are linked in HTML with cache-busting query params. */

/* ============================================
   CLOUDUSER GUI SPECIFIC OVERRIDES
   ============================================ */

/* Main content area */
.main-content {
  padding: 8px 12px;
}

/* Content wrapper */
.content {
  padding: 8px 12px;
}

/* Select dropdowns */
.form-group select {
  width: 100%;
  padding: 6px 8px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #e6edf3;
  font-size: 11px;
  font-family: inherit;
  transition: border-color 0.15s ease;
  cursor: pointer;
}

.form-group select:focus {
  outline: none;
  border-color: #8b5cf6;
  background: #161b22;
}

/* Number inputs */
.form-group input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #e6edf3;
  font-size: 11px;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.form-group input[type="number"]:focus {
  outline: none;
  border-color: #8b5cf6;
  background: #161b22;
}

/* Pod port group visibility toggle */
.pod-port-group {
  transition: all 0.2s ease;
}

/* Pod image code styling */
.pod-image {
  font-size: 11px;
  word-break: break-all;
}

/* Pod IP styling */
.pod-ip code {
  font-size: 11px;
}

.pod-cpu,
.pod-memory,
.pod-network,
.pod-gpu {
  white-space: nowrap;
}

.pod-cpu code,
.pod-memory code,
.pod-network code,
.pod-gpu code {
  font-size: 11px;
}

/* Monitoring board */
.monitoring-board {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.monitoring-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.monitoring-title {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}

.monitoring-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.monitoring-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #94a3b8;
}

.monitoring-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

.monitoring-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.metric-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.85));
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.metric-card.metric-card-count .metric-bar {
  display: none;
}

.metric-card.metric-ok {
  border-color: rgba(94, 203, 255, 0.35);
}

.metric-card.metric-warn {
  border-color: rgba(245, 158, 11, 0.4);
}

.metric-card.metric-hot {
  border-color: rgba(239, 68, 68, 0.4);
}

.metric-card.metric-pulse {
  animation: metricPulse 0.6s ease;
}

@keyframes metricPulse {
  0% {
    box-shadow: 0 0 0 rgba(56, 189, 248, 0.6);
  }
  100% {
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
}

.metric-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.metric-value {
  font-size: 18px;
  font-weight: 600;
  color: #f8fafc;
}

.metric-sub {
  font-size: 11px;
  color: #94a3b8;
}

.metric-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  width: 0;
  transition: width 0.4s ease;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.9), rgba(129, 140, 248, 0.9));
}

.metric-bar-fill.metric-ok {
  background: linear-gradient(90deg, rgba(94, 203, 255, 0.9), rgba(56, 189, 248, 0.9));
}

.metric-bar-fill.metric-warn {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.9), rgba(251, 146, 60, 0.9));
}

.metric-bar-fill.metric-hot {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.9), rgba(244, 114, 182, 0.9));
}

.metric-bar-fill.metric-na {
  background: rgba(148, 163, 184, 0.35);
}

.monitoring-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: #94a3b8;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.legend-dot.metric-ok {
  background: #5ecbff;
}

.legend-dot.metric-warn {
  background: #f59e0b;
}

.legend-dot.metric-hot {
  background: #ef4444;
}

.monitoring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.monitoring-panel {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 12px;
}

.monitoring-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.monitoring-panel-header h4 {
  font-size: 13px;
  color: #e2e8f0;
}

.monitoring-panel-sub {
  font-size: 10px;
  color: #94a3b8;
}

.monitoring-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.monitoring-table th {
  text-align: left;
  padding: 6px 4px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.monitoring-table td {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  vertical-align: top;
  color: #e2e8f0;
}

.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-cell.metric-na .metric-value {
  color: #64748b;
}

.net-metrics {
  display: inline-flex;
  gap: 10px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.net-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.net-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.net-value {
  min-width: 70px;
  text-align: right;
  font-size: 11px;
  color: #e2e8f0;
}

.metric-cell.metric-ok .metric-value code {
  color: #5ecbff;
}

.metric-cell.metric-warn .metric-value code {
  color: #f59e0b;
}

.metric-cell.metric-hot .metric-value code {
  color: #ef4444;
}

.metric-subtle {
  font-size: 10px;
  color: #94a3b8;
}

/* Registry server/username code styling */
.registry-server,
.registry-username {
  font-size: 11px;
}

/* Status indicator in pods table */
.status-indicator {
  cursor: default;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Console button enhancements */
.console-btn svg,
.console-btn-disabled svg {
  display: block;
}

/* Header nav link - no underline */
.header-nav .nav-link {
  text-decoration: none !important;
}

.header-nav .nav-link:hover {
  text-decoration: none !important;
}

/* ─── Monitoring resource cards — modern redesign (2026-07) ─────────────────
   Overrides the base .metric-card styles above. Same markup (renderers.py):
   .metric-card > .metric-label(::before icon) / .metric-value / .metric-bar >
   .metric-bar-fill / .metric-sub. Glassy surface, level-tinted top accent,
   hover lift, glowing progress bar. Applies to both GUIs. */
.monitoring-cards {
  gap: 14px;
}

.metric-card {
  background:
    radial-gradient(135% 95% at 100% 0%, rgba(78, 201, 245, 0.07) 0%, transparent 55%),
    linear-gradient(158deg, rgba(22, 32, 60, var(--card-alpha, 0.72)) 0%, rgba(11, 17, 33, var(--card-alpha-strong, 0.88)) 100%);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  padding: 15px 17px 17px;
  gap: 9px;
  box-shadow:
    var(--shadow, 0 6px 22px rgba(0, 0, 0, 0.42)),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Level-tinted top accent line (cyan/indigo default). */
.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, rgba(78, 201, 245, 0.9), rgba(129, 140, 248, 0.85));
  opacity: 0.85;
  pointer-events: none;
}
.metric-card.metric-ok::after   { background: linear-gradient(90deg, rgba(94, 203, 255, 0.9), rgba(56, 189, 248, 0.85)); }
.metric-card.metric-warn::after { background: linear-gradient(90deg, rgba(245, 158, 11, 0.95), rgba(251, 146, 60, 0.85)); }
.metric-card.metric-hot::after  { background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(244, 114, 182, 0.85)); }
.metric-card.metric-na::after   { background: rgba(148, 163, 184, 0.28); }

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(78, 201, 245, 0.32);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(78, 201, 245, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.metric-label {
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--text-secondary, #9aa6c5);
  gap: 7px;
}
.metric-label::before {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  filter: drop-shadow(0 0 6px rgba(78, 201, 245, 0.4));
}

.metric-value {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: #f4f8ff;
  font-variant-numeric: tabular-nums;
}
.metric-card-count .metric-value {
  font-size: 29px;
}
/* Network card carries a longer non-numeric value (rx/tx) — keep it compact so
   it doesn't wrap at the hero size. */
.metric-card[data-monitoring-card="cluster-network"] .metric-value {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
}

.metric-sub {
  font-size: 11px;
  color: #8f9bbb;
}

.metric-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
  margin-top: 1px;
}
.metric-bar-fill {
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.95), rgba(129, 140, 248, 0.95));
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}
.metric-bar-fill.metric-ok   { background: linear-gradient(90deg, rgba(94, 203, 255, 0.95), rgba(56, 189, 248, 0.95)); box-shadow: 0 0 10px rgba(94, 203, 255, 0.45); }
.metric-bar-fill.metric-warn { background: linear-gradient(90deg, rgba(245, 158, 11, 0.95), rgba(251, 146, 60, 0.95)); box-shadow: 0 0 10px rgba(245, 158, 11, 0.45); }
.metric-bar-fill.metric-hot  { background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(244, 114, 182, 0.95)); box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
.metric-bar-fill.metric-na   { background: rgba(148, 163, 184, 0.32); box-shadow: none; }
