/* Terminal-style notification system
 * Full-width bars at top of viewport, like terminal output
 */

/* ============================================================================
   Terminal Container - fixed to top, stacks downward
   ============================================================================ */

.terminal-notify {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  font-family: 'JetBrains Mono', var(--font-mono);
  font-style: italic;
  font-size: var(--text-sm);
}

/* ============================================================================
   Terminal Line - single notification row
   ============================================================================ */

.term-line {
  display: flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  background: var(--bg1);
  border-bottom: 1px solid var(--accent);
  pointer-events: auto;
  min-height: 32px;
  max-height: 60px; /* For collapse animation */

  /* Quick fade entrance */
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 80ms ease-out, transform 80ms ease-out;
}

.term-line-visible {
  opacity: 1;
  transform: translateY(0);
}

.term-line-exit {
  /* Slide up and out like terminal scroll */
  transform: translateY(-100%);
  opacity: 0;
  margin-bottom: -32px; /* Pull lines below up as this slides out */
  pointer-events: none;
  transition:
    transform 180ms ease-in,
    opacity 180ms ease-in,
    margin-bottom 180ms ease-in;
}

/* Line types - subtle left accent, muted tag colors */
.term-line-error {
  border-left: 3px solid var(--danger);
}

.term-line-warn {
  border-left: 3px solid var(--warning);
}

.term-line-info {
  border-left: 3px solid var(--info);
}

.term-line-trace {
  border-left: 3px solid var(--fg2);
}

.term-line-trace .term-tag {
  color: var(--fg2);
}

.term-line-offline {
  border-left: 3px solid var(--warning);
}

.term-line-offline .term-tag {
  color: var(--warning);
}

.term-line-update {
  border-left: 3px solid var(--warning);
}

.term-line-update .term-tag {
  color: var(--warning);
}

.term-line-undo {
  border-left: 3px solid var(--accent-purple);
}

.term-line-undo .term-tag {
  color: var(--accent-purple);
}

.term-line-undo .term-undo {
  color: var(--accent-purple);
  font-weight: 600;
}

.term-line-undo .term-undo:hover {
  color: var(--accent-purple-light, #c0a3ff);
}

/* ============================================================================
   Terminal Line Content
   ============================================================================ */

.term-prompt {
  color: var(--fg2);
  margin-right: var(--space-xs);
  user-select: none;
}

.term-tag {
  font-weight: 600;
  margin-right: var(--space-sm);
  font-style: normal;
}

.term-line-error .term-tag {
  color: var(--danger);
}

.term-line-warn .term-tag {
  color: var(--warning);
}

.term-line-info .term-tag {
  color: var(--info);
}

.term-message {
  flex: 1;
  color: var(--fg1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   Terminal Actions - right-aligned, CLI-style bracketed links
   ============================================================================ */

.term-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: var(--space-md);
}

.term-action {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  color: var(--fg2);
  cursor: pointer;
  text-decoration: none;
  transition: color 60ms;
}

.term-action:hover {
  color: var(--fg0);
  text-decoration: underline;
}

.term-action::before {
  content: '[';
}

.term-action::after {
  content: ']';
}

/* Inline refresh link in version mismatch message */
.term-refresh {
  color: var(--fg2);
  text-decoration: none;
  transition: color 60ms;
}

.term-refresh:hover {
  color: var(--fg0);
  text-decoration: underline;
}

/* ============================================================================
   Expanded Error Details - terminal tree style
   ============================================================================ */

.term-details {
  display: none;
  flex-direction: column;
  padding: 0 var(--space-md) var(--space-sm);
  padding-left: calc(var(--space-md) + 1.5ch); /* Align with message after $ */
  background: var(--bg1);
  border-bottom: 1px solid var(--accent);
  font-family: 'JetBrains Mono', var(--font-mono);
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--fg2);
  pointer-events: auto;
}

.term-details-visible {
  display: flex;
}

.term-details-line {
  display: flex;
  align-items: flex-start;
  line-height: 1.5;
}

.term-details-line::before {
  content: '│';
  color: var(--accent);
  margin-right: var(--space-xs);
  flex-shrink: 0;
}

.term-details-line:last-of-type::before {
  content: '└─';
}

.term-details-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.term-details-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xs);
}

.term-details-actions .term-action {
  font-size: var(--text-xs);
}

/* ============================================================================
   Success Flash - subtle border pulse
   ============================================================================ */

@keyframes success-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--success);
  }
  50% {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 50%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.success-flash {
  animation: success-pulse 0.3s ease-out;
}

