/**
 * AIHackers Terminal Styling
 * Brand-aligned utilities for terminal aesthetic
 */

/* Import Fira Code for proper ligature support */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');

/* Base terminal font stack */
.font-terminal {
  font-family: 'Fira Code', 'Fira Mono', 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

/* Prompt styling utilities */
.prompt {
  font-family: 'Fira Code', 'Fira Mono', monospace;
  font-weight: 500;
  color: var(--brand, #d6b16e);
  white-space: nowrap;
}

/* Community mode: ai@hackers$ */
.prompt-community::before {
  content: "ai@hackers:~$ ";
  color: var(--brand, #d6b16e);
}

/* Authority mode: root@ai# */
.prompt-root::before {
  content: "root@ai:~# ";
  color: var(--brand, #d6b16e);
}

/* Interactive mode: ai> */
.prompt-interactive::before {
  content: "ai> ";
  color: var(--brand, #d6b16e);
}

/* Instance mode: #ai */
.prompt-instance::before {
  content: "#ai ";
  color: var(--brand, #d6b16e);
}

/* Terminal block styling */
.terminal-block {
  background-color: var(--bg, #0b0b0a);
  border: 1px solid var(--muted, #b7b2a8);
  border-radius: 4px;
  padding: 1rem;
  font-family: 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-x: auto;
}

.terminal-block .line {
  display: block;
  margin: 0;
  padding: 0.125rem 0;
}

.terminal-block .prompt-line::before {
  content: "ai@hackers:~$ ";
  color: var(--brand, #d6b16e);
  user-select: none;
}

.terminal-block .output {
  color: var(--muted, #b7b2a8);
}

.terminal-block .comment {
  color: var(--muted, #b7b2a8);
  font-style: italic;
}

.terminal-block .error {
  color: var(--risk-high, #d16969);
}

.terminal-block .success {
  color: var(--risk-low, #6a9955);
}

/* Cursor blink animation */
@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.cursor::after {
  content: "▌";
  animation: cursor-blink 1s step-end infinite;
  color: var(--brand, #d6b16e);
}

/* Syntax highlighting colors matching ANSI */
.terminal-ansi-black { color: #0b0b0a; }
.terminal-ansi-red { color: #d16969; }
.terminal-ansi-green { color: #6a9955; }
.terminal-ansi-yellow { color: #d6b16e; }
.terminal-ansi-blue { color: #6b9dc7; }
.terminal-ansi-magenta { color: #c9a227; }
.terminal-ansi-cyan { color: #7ecce0; }
.terminal-ansi-white { color: #f2f1ed; }

/* Command input styling */
.command-input {
  background: transparent;
  border: none;
  color: var(--text, #f2f1ed);
  font-family: 'Fira Code', 'Fira Mono', monospace;
  font-size: inherit;
  outline: none;
  width: 100%;
}

/* Shell personality indicators */
.shell-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-family: 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 2px;
  background-color: var(--bg, #0b0b0a);
  border: 1px solid var(--brand, #d6b16e);
  color: var(--brand, #d6b16e);
}

.shell-badge.community::before { content: "ai@hackers"; }
.shell-badge.root::before { content: "root@ai"; }
.shell-badge.interactive::before { content: "ai>"; }
.shell-badge.instance::before { content: "#ai"; }

/* Article structure using terminal metaphor */
.article-section {
  position: relative;
}

.article-section::before {
  content: attr(data-prompt);
  position: absolute;
  left: -1rem;
  font-family: 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.75rem;
  color: var(--brand, #d6b16e);
  opacity: 0.6;
}

/* 404 Page Enhancements */
.error-block {
  background: linear-gradient(to right, rgba(209, 105, 105, 0.05), transparent);
}

.tag-directory .line,
.section-nav .line {
  transition: background-color 0.15s ease;
}

.tag-directory .line:hover,
.section-nav .line:hover {
  background-color: rgba(214, 177, 110, 0.08);
  border-radius: 2px;
}

.section-entry a {
  transition: color 0.15s ease;
}

.section-entry a:hover {
  color: var(--brand, #d6b16e) !important;
}

.help-block a {
  transition: color 0.15s ease;
}

.help-block a:hover {
  color: var(--brand, #d6b16e) !important;
}

/* Grep output styling for 404 */
.grep-match {
  display: block;
  padding: 0.25rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.5rem;
  margin-left: -0.5rem;
}

.grep-match:hover {
  border-left-color: var(--brand, #d6b16e);
  background-color: rgba(214, 177, 110, 0.05);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .terminal-block {
    font-size: 0.8125rem;
    padding: 0.75rem;
  }
  
  .prompt-community::before,
  .terminal-block .prompt-line::before {
    content: "ai$ ";
  }
}
