/**
 * Status Indicator Styles
 * Glassmorphic UI for streaming status updates
 */

/* Status Container - appears above typing indicator */
.status-container {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  margin: 8px 0;
  background: var(--gradient-card, linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05)));
  backdrop-filter: blur(var(--blur-xl, 20px));
  -webkit-backdrop-filter: blur(var(--blur-xl, 20px));
  border: 1px solid var(--color-border-card, rgba(255,255,255,0.1));
  border-radius: var(--radius-lg, 12px);
  font-size: 14px;
}

.status-container.visible {
  display: flex;
}

/* Thinking Line - generic rotating messages */
.thinking-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary, #a0a0a0);
  transition: opacity 0.3s ease;
}

.thinking-line.complete {
  opacity: 0.6;
}

.thinking-line.complete .thinking-icon {
  color: var(--color-accent-green, #4ade80);
}

.thinking-icon {
  font-size: 16px;
  display: inline-block;
  line-height: 1;
}

.thinking-icon.rotating {
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.thinking-text {
  font-style: italic;
}

/* Status Line - specific task with expand */
.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-primary, #ffffff);
}

.status-expand-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-text-secondary, #a0a0a0);
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.status-expand-btn:hover {
  color: var(--color-text-primary, #ffffff);
}

.status-expand-btn:focus {
  outline: 2px solid var(--color-accent-blue, #3b82f6);
  outline-offset: 2px;
  border-radius: 4px;
}

.expand-icon {
  font-size: 10px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.status-expand-btn[aria-expanded="true"] .expand-icon {
  transform: rotate(90deg);
}

/* Phase Badge */
.status-phase-badge {
  padding: 2px 8px;
  border-radius: var(--radius-sm, 4px);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.phase-draft {
  background: var(--color-accent-blue, #3b82f6);
  color: white;
}

.phase-refine {
  background: var(--color-accent-purple, #8b5cf6);
  color: white;
}

.phase-validate {
  background: var(--color-accent-green, #22c55e);
  color: white;
}

.phase-share {
  background: var(--color-accent-orange, #f97316);
  color: white;
}

.status-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-count {
  color: var(--color-text-muted, #6b7280);
  font-size: 12px;
  flex-shrink: 0;
}

/* Expandable History */
.status-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 24px;
  border-left: 2px solid var(--color-border-subtle, rgba(255,255,255,0.1));
  margin-left: 8px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-subtle, rgba(255,255,255,0.2)) transparent;
}

.status-history::-webkit-scrollbar {
  width: 6px;
}

.status-history::-webkit-scrollbar-track {
  background: transparent;
}

.status-history::-webkit-scrollbar-thumb {
  background: var(--color-border-subtle, rgba(255,255,255,0.2));
  border-radius: 3px;
}

.status-history::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-card, rgba(255,255,255,0.3));
}

.status-history-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-secondary, #a0a0a0);
  padding: 4px 0;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-phase {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-xs, 3px);
  flex-shrink: 0;
  margin-top: 2px;
}

.status-history-item.phase-draft .history-phase {
  background: var(--color-accent-blue, #3b82f6);
  color: white;
}

.status-history-item.phase-refine .history-phase {
  background: var(--color-accent-purple, #8b5cf6);
  color: white;
}

.status-history-item.phase-validate .history-phase {
  background: var(--color-accent-green, #22c55e);
  color: white;
}

.status-history-item.phase-share .history-phase {
  background: var(--color-accent-orange, #f97316);
  color: white;
}

.history-message {
  flex: 1;
  word-break: break-word;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .status-container {
    padding: 10px 12px;
    font-size: 13px;
  }

  .status-phase-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .status-history {
    max-height: 150px;
    padding-left: 16px;
  }

  .status-history-item {
    font-size: 12px;
  }

  .history-phase {
    font-size: 9px;
  }
}
