/* ==========================================================================
   Security Operations Command Center - Dark Theme
   Scoped under #tab-overview.command-center
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Base / Container
   --------------------------------------------------------------------------- */

#tab-overview.command-center {
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

/* Flex layout only when visible — must not override display:none from .tab-content */
#tab-overview.command-center.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Stat icon color variants */
#tab-overview.command-center .cc-icon-calls {
  background: rgba(79, 70, 229, 0.15);
  color: #818cf8;
}

#tab-overview.command-center .cc-icon-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

#tab-overview.command-center .cc-icon-tickets {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

#tab-overview.command-center .cc-icon-customers {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

#tab-overview.command-center *,
#tab-overview.command-center *::before,
#tab-overview.command-center *::after {
  box-sizing: border-box;
}

/* Scrollbar — inherited from dark-theme.css global styles */

/* ---------------------------------------------------------------------------
   Animations
   --------------------------------------------------------------------------- */

@keyframes cc-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

@keyframes cc-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.25);
  }
}

@keyframes cc-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cc-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------------------------------------------------------------------------
   Stats Row (Hero Stat Cards Grid)
   --------------------------------------------------------------------------- */

#tab-overview.command-center .cc-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ---------------------------------------------------------------------------
   Stat Card
   --------------------------------------------------------------------------- */

#tab-overview.command-center .cc-stat-card {
  background: #1a2035;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius, 10px);
  box-shadow: 0 0 20px rgba(15, 98, 254, 0.08);
  padding: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

#tab-overview.command-center .cc-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(15, 98, 254, 0.15);
}

#tab-overview.command-center .cc-stat-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

#tab-overview.command-center .cc-stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

#tab-overview.command-center .cc-stat-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-top: 4px;
}

/* Active glow state (e.g., Active Calls > 0) */
#tab-overview.command-center .cc-stat-card.active-glow {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
  animation: cc-glow-pulse 2s ease-in-out infinite;
}

#tab-overview.command-center .cc-stat-card.active-glow:hover {
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.25);
}

/* ---------------------------------------------------------------------------
   Chart Grids
   --------------------------------------------------------------------------- */

#tab-overview.command-center .cc-charts-primary {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
}

#tab-overview.command-center .cc-charts-secondary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ---------------------------------------------------------------------------
   Panel
   --------------------------------------------------------------------------- */

#tab-overview.command-center .cc-panel {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
}

#tab-overview.command-center .cc-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#tab-overview.command-center .cc-panel-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Chart Containers
   --------------------------------------------------------------------------- */

#tab-overview.command-center .cc-chart-container {
  position: relative;
  height: 260px;
}

#tab-overview.command-center .cc-charts-secondary .cc-chart-container {
  height: 220px;
}

/* ---------------------------------------------------------------------------
   Live Feed (Active Calls)
   --------------------------------------------------------------------------- */

#tab-overview.command-center .cc-live-feed {
  max-height: 400px;
  overflow-y: auto;
}

#tab-overview.command-center .cc-live-item {
  background: #1a2035;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-left: 3px solid #10b981;
  animation: cc-slide-in 0.3s ease forwards;
  display: flex;
  align-items: center;
  gap: 12px;
}

#tab-overview.command-center .cc-live-item:last-child {
  margin-bottom: 0;
}

#tab-overview.command-center .cc-live-name {
  font-weight: 600;
  color: #e2e8f0;
}

#tab-overview.command-center .cc-live-phone {
  font-size: 13px;
  color: #94a3b8;
}

#tab-overview.command-center .cc-live-duration {
  font-variant-numeric: tabular-nums;
  color: #10b981;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}

/* Pulsing border for live items */
#tab-overview.command-center .cc-live-item::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  min-width: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: cc-pulse 2s ease-in-out infinite;
}

/* ---------------------------------------------------------------------------
   Activity Feed
   --------------------------------------------------------------------------- */

#tab-overview.command-center .cc-activity-feed {
  max-height: 400px;
  overflow-y: auto;
}

#tab-overview.command-center .cc-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#tab-overview.command-center .cc-activity-item:last-child {
  border-bottom: none;
}

#tab-overview.command-center .cc-activity-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

#tab-overview.command-center .cc-activity-dot.dot-success {
  background: #10b981;
}

#tab-overview.command-center .cc-activity-dot.dot-warning {
  background: #f59e0b;
}

#tab-overview.command-center .cc-activity-dot.dot-danger {
  background: #ef4444;
}

#tab-overview.command-center .cc-activity-dot.dot-info {
  background: #3b82f6;
}

#tab-overview.command-center .cc-activity-dot.dot-primary {
  background: #0f62fe;
}

#tab-overview.command-center .cc-activity-text {
  font-size: 13px;
  color: #94a3b8;
  flex: 1;
  min-width: 0;
}

#tab-overview.command-center .cc-activity-time {
  font-size: 12px;
  color: #64748b;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Status Bar
   --------------------------------------------------------------------------- */

#tab-overview.command-center .cc-status-bar {
  background: #0d1117;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  color: #64748b;
}

#tab-overview.command-center .cc-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

#tab-overview.command-center .cc-status-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

#tab-overview.command-center .cc-status-dot.offline {
  background: #ef4444;
}

/* ---------------------------------------------------------------------------
   Badge - Live
   --------------------------------------------------------------------------- */

#tab-overview.command-center .badge-live {
  background: #10b981;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 10px;
  animation: cc-pulse 2s ease-in-out infinite;
  display: inline-block;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   Empty State
   --------------------------------------------------------------------------- */

#tab-overview.command-center .cc-empty {
  text-align: center;
  color: #64748b;
  padding: 40px;
  font-size: 14px;
}

/* ---------------------------------------------------------------------------
   Utility: Text Colors
   --------------------------------------------------------------------------- */

#tab-overview.command-center .text-primary-cc {
  color: #e2e8f0;
}

#tab-overview.command-center .text-secondary-cc {
  color: #94a3b8;
}

#tab-overview.command-center .text-muted-cc {
  color: #64748b;
}

/* ---------------------------------------------------------------------------
   Responsive: Below 1200px
   --------------------------------------------------------------------------- */

@media (max-width: 1200px) {
  #tab-overview.command-center .cc-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  #tab-overview.command-center .cc-charts-primary {
    grid-template-columns: 1fr;
  }

  #tab-overview.command-center .cc-charts-secondary {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------------------------------------------------------------------------
   Responsive: Below 768px
   --------------------------------------------------------------------------- */

@media (max-width: 768px) {
  #tab-overview.command-center .cc-stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  #tab-overview.command-center .cc-charts-primary {
    grid-template-columns: 1fr;
  }

  #tab-overview.command-center .cc-charts-secondary {
    grid-template-columns: 1fr;
  }

  #tab-overview.command-center .cc-chart-container,
  #tab-overview.command-center .cc-charts-secondary .cc-chart-container {
    height: 200px;
  }

  #tab-overview.command-center .cc-stat-value {
    font-size: 28px;
  }

  #tab-overview.command-center .cc-stat-card {
    padding: 16px;
  }

  #tab-overview.command-center .cc-status-bar {
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* ---------------------------------------------------------------------------
   Responsive: Below 480px
   --------------------------------------------------------------------------- */

@media (max-width: 480px) {
  #tab-overview.command-center .cc-stats-row {
    grid-template-columns: 1fr;
  }
}
