/**
 * Status Bar Styles
 * @countermeasure/web-components
 *
 * Fixed bottom bar with left, center, and right sections.
 */

/* ============================================================================
   STATUS BAR
   ============================================================================ */
.cmm-status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky, 100);
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 24px;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--secondary));
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  user-select: none;
}

/* ============================================================================
   SECTIONS
   ============================================================================ */
.cmm-status-bar__left {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-start;
  overflow: hidden;
}

.cmm-status-bar__center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cmm-status-bar__right {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
  overflow: hidden;
}

/* ============================================================================
   SECTION ITEMS
   ============================================================================ */
.cmm-status-bar__section {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0 0.625rem;
  height: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid hsl(var(--border));
}

.cmm-status-bar__section:last-child {
  border-right: none;
}

.cmm-status-bar__right .cmm-status-bar__section {
  border-right: none;
  border-left: 1px solid hsl(var(--border));
}

.cmm-status-bar__right .cmm-status-bar__section:first-child {
  border-left: none;
}

/* Clickable sections */
.cmm-status-bar__section--clickable {
  cursor: pointer;
  transition: background-color var(--transition-fast, 150ms),
              color var(--transition-fast, 150ms);
}

.cmm-status-bar__section--clickable:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* ============================================================================
   STATUS INDICATORS
   ============================================================================ */
.cmm-status-bar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.cmm-status-bar__icon svg {
  width: 100%;
  height: 100%;
}

.cmm-status-bar__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cmm-status-bar__dot--success {
  background-color: hsl(var(--success));
}

.cmm-status-bar__dot--warning {
  background-color: hsl(var(--warning));
}

.cmm-status-bar__dot--error {
  background-color: hsl(var(--danger));
}

.cmm-status-bar__dot--info {
  background-color: hsl(var(--info));
}

/* Pulsing animation for active indicators */
.cmm-status-bar__dot--pulse {
  animation: cmm-status-bar-pulse 2s ease-in-out infinite;
}

@keyframes cmm-status-bar-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ============================================================================
   STATUS BAR TEXT
   ============================================================================ */
.cmm-status-bar__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 24px;
}

.cmm-status-bar__text--bold {
  font-weight: 600;
}

/* ============================================================================
   PROGRESS WITHIN STATUS BAR
   ============================================================================ */
.cmm-status-bar__progress {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.cmm-status-bar__progress-bar {
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background-color: hsl(var(--border));
  overflow: hidden;
}

.cmm-status-bar__progress-fill {
  height: 100%;
  border-radius: 2px;
  background-color: hsl(var(--info));
  transition: width var(--transition-fast, 150ms);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 640px) {
  .cmm-status-bar__center {
    display: none;
  }

  .cmm-status-bar__section {
    padding: 0 0.375rem;
  }
}
