/**
 * command-center-v6.css
 * v6-specific style overrides and additions
 * Base styles are inline in command-center-v6.html
 * This file is for v6-specific modifications only
 */

/* ========================================================================
   Phase R2: Warming state styles for warm indicators and badges
   ======================================================================== */

/* Warming indicator - amber pulsing animation */
.warm-indicator.warming {
  background: var(--accent-warning, #f59e0b);
  animation: warmPulse 1.5s ease-in-out infinite;
}

/* Status badge warming state */
.status-badge.warming {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning, #f59e0b);
}

/* Pulse animation for warming state */
@keyframes warmPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* ========================================================================
   Phase R3: Tab panel visibility - MOVED TO INLINE STYLES in HTML
   (External CSS wasn't loading reliably; rules now in inline <style> block)
   ======================================================================== */

/* ========================================================================
   Phase R3: Live notice styling for ccAppendNotice()
   ======================================================================== */
#cc-notices-live-list > div {
  padding: 4px 8px;
  font-size: 12px;
  background: var(--bg-tertiary, #1a1a24);
  border-radius: 4px;
  margin-right: 8px;
}

#cc-notices-live-list > div[data-level="error"] {
  color: var(--status-error, #ef4444);
}

#cc-notices-live-list > div[data-level="warn"] {
  color: var(--status-warming, #fbbf24);
}

#cc-notices-live-list > div[data-level="info"] {
  color: var(--accent-primary, #38bdf8);
}

/* ========================================================================
   Phase R-Models: Role Cards vs Catalog separation
   ======================================================================== */

/* Role assignment section */
#cc-role-cards {
  padding-bottom: var(--space-md, 16px);
  margin-bottom: var(--space-md, 16px);
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

/* Dynamic catalog section */
#cc-models-catalog {
  padding-top: var(--space-sm, 8px);
}

#cc-models-catalog:empty::before {
  content: 'Loading models catalog...';
  color: var(--text-muted, #606070);
  font-size: 12px;
  display: block;
  text-align: center;
  padding: var(--space-md, 16px);
}

/* ========================================================================
   Settings Panel CSS (ported from v4/v5)
   ======================================================================== */

#cc-settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1000;
  display: none;
}

#cc-settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 95vw);
  height: 100vh;
  background: var(--cc-card-bg, #1a1a24);
  color: inherit;
  box-shadow: -2px 0 12px rgba(0,0,0,.25);
  z-index: 1001;
  overflow: auto;
  padding: 12px 16px;
  display: none;
}

#cc-settings-overlay:not([hidden]) {
  display: block;
}

#cc-settings-panel:not([hidden]) {
  display: block;
}

#cc-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

#cc-settings-title {
  margin: 0;
  font-size: 16px;
}

#cc-settings-close-btn {
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-subtle, #333);
  color: inherit;
  padding: 4px 10px;
  border-radius: 4px;
}

#cc-settings-close-btn:hover {
  background: var(--bg-hover, rgba(255,255,255,0.05));
}

/* Login form styling */
.cc-field {
  margin: 8px 0;
}

.cc-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-secondary, #a0a0b0);
}

.cc-field input,
.cc-field select,
.cc-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: var(--bg-input, #0d0d12);
  border: 1px solid var(--border-subtle, #333);
  border-radius: 4px;
  color: inherit;
  font-size: 14px;
}

.cc-field input:focus,
.cc-field select:focus,
.cc-field textarea:focus {
  outline: none;
  border-color: var(--accent-primary, #4a9eff);
}

/* Ensure text selection is visible in textareas */
.cc-field textarea::selection {
  background: var(--accent-primary, #4a9eff);
  color: #fff;
}

.cc-field textarea::-moz-selection {
  background: var(--accent-primary, #4a9eff);
  color: #fff;
}

#cc-settings-login-btn {
  margin-top: 12px;
  padding: 8px 16px;
  background: var(--accent-primary, #4a9eff);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#cc-settings-login-btn:hover {
  background: var(--accent-primary-hover, #3a8eef);
}

.cc-error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 8px;
}

/* Authed view styling */
#cc-settings-userbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle, #333);
}

#cc-settings-user-label {
  font-size: 13px;
  color: var(--text-secondary, #a0a0b0);
}

#cc-settings-logout-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-subtle, #333);
  color: inherit;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

#cc-settings-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

/* Settings tabs */
#cc-settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle, #333);
  padding-bottom: 8px;
}

#cc-settings-tabs button {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary, #a0a0b0);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

#cc-settings-tabs button:hover {
  background: var(--bg-hover, rgba(255,255,255,0.05));
}

#cc-settings-tabs button[aria-selected="true"] {
  background: var(--bg-active, rgba(74,158,255,0.1));
  border-color: var(--accent-primary, #4a9eff);
  color: var(--accent-primary, #4a9eff);
}

/* Tab panels */
#cc-settings-panel-workspace,
#cc-settings-panel-user,
#cc-settings-panel-technical {
  padding: 8px 0;
}

#cc-workspace-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

#cc-settings-success-message {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 12px;
}

/* ========================================================================
   Login Gate (ported from v5)
   ======================================================================== */

#cc-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#cc-gate-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 18px 20px;
  max-width: 420px;
  width: 92%;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  text-align: center;
}

#cc-gate-card h2 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--text-secondary, #a0a0b0);
}

#cc-gate-card p {
  margin: 0 0 14px 0;
  font-size: 12px;
  color: var(--text-muted, #606070);
}

#cc-gate-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #2a6;
  cursor: pointer;
  background: #173;
  color: #fff;
  font-size: 14px;
}

#cc-gate-login-btn:hover {
  background: #1a4;
}

/* ========================================================================
   LIVE STATS PANEL (Stats/Diagnostics Tab)
   ======================================================================== */

.live-stats-panel {
  background: var(--bg-secondary, #1e1e1e);
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.live-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color, #3a3a3a);
}

.live-stats-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
}

.live-stats-refresh {
  font-size: 10px;
  color: var(--text-muted, #888);
}

.live-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Stat Rows */
.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.stat-row-split {
  justify-content: flex-start;
  gap: 24px;
}

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

.stat-label {
  color: var(--text-muted, #888);
  min-width: 80px;
  flex-shrink: 0;
}

.stat-value {
  color: var(--text-primary, #e0e0e0);
  font-weight: 500;
}

.stat-baseline {
  color: var(--text-muted, #888);
  font-size: 11px;
}

/* RAM Progress Bar */
.stat-bar-container {
  flex: 1;
  max-width: 120px;
  height: 8px;
  background: var(--bg-tertiary, #2a2a2a);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  background: var(--accent, #4a9eff);
  border-radius: 4px;
  transition: width 0.3s ease, background 0.3s ease;
}

.stat-bar.warning {
  background: var(--warning, #ff9800);
}

.stat-bar.critical {
  background: var(--error, #f44336);
}

/* Status Badge */
.stat-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.stat-badge.safe {
  background: rgba(76, 175, 80, 0.2);
  color: var(--success, #4caf50);
}

.stat-badge.warning {
  background: rgba(255, 152, 0, 0.2);
  color: var(--warning, #ff9800);
}

.stat-badge.critical {
  background: rgba(244, 67, 54, 0.2);
  color: var(--error, #f44336);
}

/* Service Indicators */
.stat-services {
  display: flex;
  gap: 12px;
}

.service-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-primary, #e0e0e0);
}

.svc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted, #888);
}

.service-indicator.online .svc-dot {
  background: var(--success, #4caf50);
}

.service-indicator.offline .svc-dot {
  background: var(--error, #f44336);
}

.service-indicator.degraded .svc-dot {
  background: var(--warning, #ff9800);
}

/* ========== END LIVE STATS PANEL ========== */
