/* Terminal Interface - robbyrussell zsh theme inspired */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  background: #000;
  margin: 0;
  padding: 0;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  overflow: hidden;
}

.terminal-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.terminal-split {
  display: grid !important;
  grid-template-columns: 1fr 350px !important;
  height: 100%;
  width: 100%;
  position: relative;
}

.terminal-container .terminal-split .terminal-left {
  overflow: auto !important;
  display: flex !important;
  flex-direction: column !important;
  border-right: 2px solid #44475a !important;
  background: #000;
}

.terminal-right {
  overflow: auto;
  background: #000 !important;
  display: flex !important;
  flex-direction: column !important;
}

.terminal-content {
  flex: 1;
  background: #000;
  color: #fff;
  padding: 20px;
  font-size: 14px;
  line-height: 1.4;
  overflow-y: scroll !important;
  overflow-x: hidden;
  font-family: 'JetBrains Mono', monospace;
  height: 100vh;
  max-height: 100vh;
}

.terminal-line {
  margin-bottom: 2px;
  word-wrap: break-word;
}

.terminal-input-line {
  margin-top: 20px;
  display: flex;
  align-items: center;
}

/* robbyrussell theme colors */
.terminal-prompt {
  color: #50fa7b; /* green */
  font-weight: 500;
}

.terminal-git {
  color: #8be9fd; /* cyan */
}

.terminal-branch {
  color: #ff79c6; /* pink */
  font-weight: 500;
}

.terminal-cursor {
  color: #50fa7b; /* green */
  font-weight: 700;
}

.terminal-command {
  color: #f8f8f2; /* foreground */
}

.terminal-info {
  color: #6272a4; /* comment */
  font-style: italic;
}

.terminal-input {
  background: transparent;
  border: none;
  color: #f8f8f2;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  outline: none;
  flex: 1;
  margin-left: 5px;
}

.terminal-input::placeholder {
  color: #6272a4;
  font-style: italic;
}


/* Terminal output styling */
.terminal-success {
  color: #50fa7b; /* green */
}

.terminal-error {
  color: #ff5555; /* red */
}

.terminal-warning {
  color: #ffb86c; /* orange */
}

.terminal-info {
  color: #8be9fd; /* cyan */
}

.terminal-normal {
  color: #f8f8f2; /* foreground */
}

.terminal-line .terminal-normal {
  margin-left: 4px;
}

.terminal-command-echo {
  color: #50fa7b; /* green for prompt */
}

.terminal-command-echo::before {
  content: '';
}

/* Scrollbar styling */
.terminal-content::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
  width: 8px;
}

.terminal-content::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.terminal-content::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
  background: #404040;
  border-radius: 4px;
}

.terminal-content::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
  background: #606060;
}

/* Mobile history drawer */
.history-drawer-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #50fa7b;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.history-drawer-toggle:hover {
  transform: scale(1.1);
}

.history-drawer-toggle.active {
  background: #ff5555;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .terminal-split {
    grid-template-columns: 1fr !important;
  }

  .terminal-left {
    border-right: none !important;
  }

  .terminal-right {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60vh;
    max-height: 60vh;
    background: #000;
    border-top: 2px solid #44475a;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 999;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.3);
  }

  .terminal-right.drawer-open {
    transform: translateY(0);
  }

  .history-drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .terminal-content {
    padding: 15px;
    font-size: 13px;
  }

  .terminal-input {
    font-size: 13px;
  }

  /* Add padding to bottom of terminal-left to account for FAB */
  .terminal-left {
    padding-bottom: 100px;
  }

  /* Make history panel scrollable */
  .history-list {
    max-height: calc(60vh - 80px);
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .terminal-content {
    padding: 10px;
    font-size: 12px;
  }

  .terminal-input {
    font-size: 12px;
  }

  .terminal-right {
    height: 70vh;
    max-height: 70vh;
  }

  .history-list {
    max-height: calc(70vh - 80px);
  }
}

/* Selection styling */
::selection {
  background: #44475a;
  color: #f8f8f2;
}

::-moz-selection {
  background: #44475a;
  color: #f8f8f2;
}

/* Terminal link styling */
.terminal-link {
  color: #8be9fd;
  text-decoration: none;
  border-bottom: 1px dotted #8be9fd;
}

.terminal-link:hover {
  color: #50fa7b;
  border-bottom-color: #50fa7b;
}

/* History hint styling */
.history-hint {
  color: #6272a4;
  font-style: italic;
  margin-left: 10px;
  font-size: 13px;
}

/* History panel */
.history-panel {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
}

.history-header {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 0;
  padding: 20px 20px 12px 20px;
  border-bottom: 2px solid #44475a;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #000;
  flex-shrink: 0;
}

.history-clear-btn {
  background: #44475a;
  border: 1px solid #6272a4;
  color: #f8f8f2;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.history-clear-btn:hover {
  background: #6272a4;
  border-color: #8be9fd;
  color: #fff;
}

.history-clear-btn:active {
  background: #50fa7b;
  border-color: #50fa7b;
  color: #282a36;
}

.history-list {
  flex: 1;
  overflow-y: auto;
}

.history-empty {
  color: #8be9fd;
  font-style: italic;
  font-size: 13px;
}

.history-entry {
  padding: 8px 10px;
  margin-bottom: 2px;
  cursor: pointer !important;
  transition: background-color 0.2s ease;
  font-size: 13px;
  border-radius: 4px;
}

.history-entry:hover {
  background-color: rgba(80, 250, 123, 0.1);
  cursor: pointer !important;
}

.history-entry.selected {
  background-color: #44475a;
  border-left: 3px solid #50fa7b;
  padding-left: 7px;
}

.history-steamid {
  color: #8be9fd;
  text-decoration: underline;
  cursor: pointer !important;
}

.history-steamid:hover {
  cursor: pointer !important;
}

.history-separator {
  color: #fff;
  margin: 0 8px;
}

.history-name {
  color: #fff;
}