/* ============================================================
   HR Brain — Command Center (full-page view)
   Dark theme, always on. Delhivery red accent.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============ FULL-SCREEN TAKEOVER ============ */
#brain-cc {
  position: fixed;
  inset: 0;
  background: #06070A;
  color: #E8EAF0;
  font-family: 'Outfit', sans-serif;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#brain-cc *,
#brain-cc *::before,
#brain-cc *::after {
  box-sizing: border-box;
}

/* ============ STATUS BAR ============ */
#brain-cc .cc-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 24px;
  background: #0A0C10;
  border-bottom: 1px solid #1A1D28;
  font-size: 11px;
  color: #5C6380;
  flex-shrink: 0;
}
#brain-cc .cc-status-left {
  display: flex;
  gap: 20px;
  align-items: center;
}
#brain-cc .cc-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}
#brain-cc .cc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
#brain-cc .cc-dot-green { background: #22C55E; box-shadow: 0 0 8px #22C55E55; }
#brain-cc .cc-dot-amber { background: #F59E0B; box-shadow: 0 0 8px #F59E0B55; }
#brain-cc .cc-dot-red   { background: #EF4444; box-shadow: 0 0 8px #EF444455; }
#brain-cc .cc-val {
  font-family: 'JetBrains Mono', monospace;
  color: #8B92A8;
  font-weight: 600;
}
#brain-cc .cc-status-right {
  font-family: 'JetBrains Mono', monospace;
  color: #5C6380;
}

/* ============ HEADER ============ */
#brain-cc .cc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(8, 9, 12, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #E4252920;
  flex-shrink: 0;
}
#brain-cc .cc-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
#brain-cc .cc-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #E42529, #A01318);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(228, 37, 41, 0.3);
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  letter-spacing: -0.02em;
}
#brain-cc .cc-header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #F0F2F8;
  margin: 0;
}
#brain-cc .cc-subtitle {
  font-size: 11px;
  color: #5C6380;
  margin-top: 1px;
  letter-spacing: 0.02em;
}

/* ============ MAIN LAYOUT ============ */
#brain-cc .cc-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ============ CHAT PANEL ============ */
#brain-cc .cc-chat {
  width: 55%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #151820;
  min-height: 0;
}
#brain-cc .cc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  min-height: 0;
}
#brain-cc .cc-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  animation: ccFadeUp 0.3s ease;
}
#brain-cc .cc-msg-user { justify-content: flex-end; }
#brain-cc .cc-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #E42529, #A01318);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
#brain-cc .cc-bubble {
  max-width: 75%;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.7;
  word-wrap: break-word;
}
#brain-cc .cc-msg-bot .cc-bubble {
  background: #0E1117;
  border: 1px solid #1A1D28;
  border-radius: 4px 16px 16px 16px;
  color: #C8CCD8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
#brain-cc .cc-msg-user .cc-bubble {
  background: #E42529;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
}
#brain-cc .cc-bubble h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #E42529;
  margin: 0 0 6px;
}
#brain-cc .cc-bubble h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #F0F2F8;
  margin: 8px 0 4px;
}
#brain-cc .cc-bubble strong { color: #F0F2F8; }
#brain-cc .cc-bubble code {
  background: #1A1D28;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: #E42529;
}
#brain-cc .cc-bubble ul {
  margin: 6px 0 8px;
  padding-left: 18px;
}
#brain-cc .cc-bubble li { margin: 2px 0; }
#brain-cc .cc-bubble table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
}
#brain-cc .cc-bubble table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 2px solid #1A1D28;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  color: #5C6380;
}
#brain-cc .cc-bubble table td {
  padding: 5px 8px;
  border-bottom: 1px solid #1A1D2855;
  color: #C8CCD8;
}

/* Typing indicator */
#brain-cc .cc-typing {
  display: flex;
  gap: 4px;
  padding: 4px 2px;
}
#brain-cc .cc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E42529;
  animation: ccPulse 1.2s infinite;
}
#brain-cc .cc-typing span:nth-child(2) { animation-delay: 0.2s; }
#brain-cc .cc-typing span:nth-child(3) { animation-delay: 0.4s; }

/* Quick prompts */
#brain-cc .cc-quick-prompts {
  display: flex;
  gap: 8px;
  padding: 8px 24px;
  overflow-x: auto;
  border-top: 1px solid #151820;
  flex-shrink: 0;
}
#brain-cc .cc-quick-prompts button {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  background: #E4252910;
  border: 1px solid #E4252925;
  color: #E42529;
  transition: all 0.2s;
}
#brain-cc .cc-quick-prompts button:hover {
  background: #E4252920;
  border-color: #E4252955;
}

/* Input */
#brain-cc .cc-chat-input {
  padding: 12px 20px 16px;
  background: linear-gradient(transparent, #06070A 40%);
  flex-shrink: 0;
}
#brain-cc .cc-input-bar {
  display: flex;
  gap: 10px;
  background: #0E1017;
  border: 1px solid #1E2230;
  border-radius: 14px;
  padding: 6px 6px 6px 18px;
  align-items: center;
  transition: border-color 0.2s;
}
#brain-cc .cc-input-bar:focus-within { border-color: #E4252966; }
#brain-cc .cc-input-bar input {
  flex: 1;
  background: none;
  border: none;
  color: #F0F2F8;
  font-size: 15px;
  outline: none;
  font-family: 'Outfit', sans-serif;
  padding: 6px 0;
}
#brain-cc .cc-input-bar input::placeholder { color: #3A4060; }
#brain-cc .cc-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #E42529, #A01318);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(228, 37, 41, 0.25);
  transition: all 0.2s;
  font-size: 18px;
  font-weight: 700;
}
#brain-cc .cc-send:hover { box-shadow: 0 4px 20px rgba(228, 37, 41, 0.4); }

/* ============ DASHBOARD ============ */
#brain-cc .cc-dashboard {
  width: 45%;
  overflow-y: auto;
  padding: 20px;
  background: #08090D;
  min-height: 0;
}
#brain-cc .cc-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
#brain-cc .cc-dash-label {
  font-size: 11px;
  color: #5C6380;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
#brain-cc .cc-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Card */
#brain-cc .cc-card {
  background: #0C0E14;
  border: 1px solid #181C28;
  border-radius: 12px;
  padding: 16px 18px;
  transition: all 0.25s;
  position: relative;
}
#brain-cc .cc-card:hover {
  border-color: #252A3A;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
#brain-cc .cc-severity-cascade { border-left: 3px solid #EF4444; }
#brain-cc .cc-severity-weak    { border-left: 3px solid #F59E0B; }
#brain-cc .cc-severity-watch   { border-left: 3px solid #F59E0B; }
#brain-cc .cc-severity-healthy { border-left: 3px solid #22C55E; }
#brain-cc .cc-wide { grid-column: span 2; }
#brain-cc .cc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
#brain-cc .cc-card-title {
  font-size: 10px;
  font-weight: 700;
  color: #5C6380;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Metric card */
#brain-cc .cc-metric-value {
  font-size: 36px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.04em;
  color: #F0F2F8;
  line-height: 1;
}
#brain-cc .cc-metric-delta {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#brain-cc .cc-delta-good    { background: #22C55E18; color: #22C55E; }
#brain-cc .cc-delta-bad     { background: #EF444418; color: #EF4444; }
#brain-cc .cc-delta-neutral { background: #F59E0B18; color: #F59E0B; }

/* Pie */
#brain-cc .cc-pie-card {
  display: flex;
  gap: 16px;
  align-items: center;
}
#brain-cc .cc-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
#brain-cc .cc-pie-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
#brain-cc .cc-pie-legend-item .cc-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
#brain-cc .cc-pie-legend-item .cc-legend-name {
  color: #8B92A8;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#brain-cc .cc-pie-legend-item .cc-legend-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #F0F2F8;
  font-size: 11px;
}

/* Mini table */
#brain-cc .cc-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#brain-cc .cc-mini-table th {
  text-align: left;
  padding: 6px 8px;
  color: #5C6380;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #1A1D28;
}
#brain-cc .cc-mini-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #1A1D2855;
  color: #8B92A8;
}
#brain-cc .cc-mini-table td:first-child {
  color: #F0F2F8;
  font-weight: 600;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#brain-cc .cc-mini-table .cc-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
#brain-cc .cc-mini-table .cc-num-red { color: #EF4444; }
#brain-cc .cc-mini-table .cc-num-amber { color: #F59E0B; }
#brain-cc .cc-mini-table .cc-num-red-accent { color: #E42529; }
#brain-cc .cc-severity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
#brain-cc .cc-severity-badge.cc-cascade { background: #EF444418; color: #EF4444; }
#brain-cc .cc-severity-badge.cc-weak    { background: #F59E0B18; color: #F59E0B; }
#brain-cc .cc-severity-badge.cc-watch   { background: #F59E0B18; color: #F59E0B; }
#brain-cc .cc-severity-badge.cc-healthy { background: #22C55E18; color: #22C55E; }

/* Brief card */
#brain-cc .cc-brief {
  font-size: 13px;
  line-height: 1.75;
  color: #8B92A8;
}
#brain-cc .cc-brief strong { color: #F0F2F8; }
#brain-cc .cc-brief .cc-brief-accent { color: #E42529; font-weight: 600; }

/* ============ SCROLLBARS ============ */
#brain-cc ::-webkit-scrollbar { width: 4px; height: 4px; }
#brain-cc ::-webkit-scrollbar-track { background: transparent; }
#brain-cc ::-webkit-scrollbar-thumb { background: #252A3A; border-radius: 2px; }

/* ============ ANIMATIONS ============ */
@keyframes ccFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ccPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40%           { opacity: 1;   transform: scale(1); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  #brain-cc .cc-main { flex-direction: column; }
  #brain-cc .cc-chat,
  #brain-cc .cc-dashboard { width: 100%; }
  #brain-cc .cc-chat { border-right: none; border-bottom: 1px solid #151820; }
  #brain-cc .cc-cards { grid-template-columns: 1fr; }
  #brain-cc .cc-wide { grid-column: span 1; }
}
