/* xterm.js terminal customizations — integrates with app theme */

/* Bundled Nerd Font Symbols — provides Powerline / Devicon glyphs as a
   fallback regardless of what fonts the user has installed. */
@font-face {
  font-family: 'Symbols Nerd Font Mono';
  src: url('../assets/fonts/SymbolsNerdFontMono-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/* Ensure terminal fills its container */
.terminal-view-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--background);
}

.terminal-view-container .xterm {
  height: 100%;
  background: var(--background);
  padding: 0;
}

.terminal-view-container .xterm .xterm-viewport {
  background-color: var(--background) !important;
}

.terminal-view-container .xterm .composition-view {
  background: var(--background);
  color: var(--foreground);
}

/* Override xterm viewport scrollbar to match app style */
.terminal-view-container .xterm-viewport {
  scrollbar-width: thin;
  scrollbar-color: var(--muted-foreground, rgba(128, 128, 128, 0.3)) transparent;
}

.terminal-view-container .xterm-viewport::-webkit-scrollbar {
  width: 6px;
}

.terminal-view-container .xterm-viewport::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-view-container .xterm-viewport::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted-foreground, rgb(128, 128, 128)) 30%, transparent);
  border-radius: 3px;
}

.terminal-view-container .xterm-viewport::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted-foreground, rgb(128, 128, 128)) 50%, transparent);
}

/* Remove any outline when terminal is focused */
.terminal-view-container .xterm:focus,
.terminal-view-container .xterm-screen:focus {
  outline: none;
}

/* Ensure selection is visible and uses theme-consistent colors */
.terminal-view-container .xterm-selection div {
  opacity: 0.4;
}

/* Search highlight decorations from @xterm/addon-search */
.terminal-view-container .xterm-find-result-decoration {
  outline: 1px solid var(--ring, hsl(270 60% 55%));
  outline-offset: -1px;
}

.terminal-view-container .xterm-find-active-result-decoration {
  outline: 2px solid var(--primary, hsl(270 60% 55%));
  outline-offset: -1px;
  background-color: color-mix(in srgb, var(--primary, hsl(270 60% 55%)) 30%, transparent);
}
