* {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

:root {
  --terminal-bg-color: #000;
  --nano-bg-color: #888888;
  --terminal-text-color: #ffffffb7;
  --terminal-code-color: #8ebefac3;
  --terminal-text-output-color: #ff8c4eb7;
  --terminal-cursor-color: #fff;
  --terminal-toolbar-bg-color: rgb(157, 157, 189);
  --terminal-toolbar-text-color: #ffffffb7;
  --toolbar-button-bg-color: #444;
  --toolbar-button-bg-color-hover: #666;
  --terminal-link-color: rgb(190, 168, 0);
  --terminal-link-hover-color: #9d47ee;
}

.hidden {
  display: none;
}

body {
  background-color: var(--terminal-bg-color);
  color: var(--terminal-text-color);
  font-family: monospace;
  margin: 0;
  font-size: 14px;
  overflow: hidden;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

a {
  color: var(--terminal-link-color);
  text-decoration: none;
}

a:hover {
  color: var(--terminal-link-hover-color);
}

#toolbar {
  background-color: var(--terminal-toolbar-bg-color);
  color: var(--terminal-toolbar-text-color);
  padding: 5px;
  text-align: right;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  z-index: 1000;
  border-bottom: 1px solid var(--terminal-text-color);
}

#toolbar #userInfo {
  margin: 0px 10px;
}

#toolbar .buttons {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-right: 5px;
}

#toolbar .buttons::-webkit-scrollbar {
  display: none;
}

#toolbar .buttons {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#toolbar .buttons .toggle {
  background-color: var(--terminal-bg-color);
  color: var(--terminal-toolbar-text-color);
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

#toolbar .buttons .toggle:hover {
  background-color: var(--toolbar-button-bg-color-hover);
}

#toolbar .buttons button {
  background-color: var(--toolbar-button-bg-color);
  color: var(--terminal-text-color);
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
  font-size: inherit;
  line-height: 1;
  margin: 0;
  outline: none;
  box-shadow: none;
}

#toolbar .buttons button:hover {
  background-color: var(--toolbar-button-bg-color-hover);
}

#toolbar .buttons button:focus {
  outline: none;
  box-shadow: none;
}

#terminal {
  padding: 10px;
  margin-top: 40px;
  height: calc(100vh - 70px);
  overflow-y: auto;
}

#terminalHeader {
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 10px;
}

#terminalOutput {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.commandLine {
  display: flex;
}

.commandLine.output {
  margin-bottom: 2px;
  margin-left: 2px;
  color: var(--terminal-text-output-color);
}

.commandLine .newLine {
  padding-right: 5px;
}

.commandLine .terminalInputLine {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.commandLine .terminalInputLine span {
  display: inline;
}

.commandLine .terminalInputLine span.outputLine {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.commandLine .terminalInputLine .cursor,
#nanoOutput #nanoOutputContent .cursor {
  display: inline-block;
  width: 6px;
  height: 11px;
  padding: 0;
  border: 1px solid var(--terminal-cursor-color);
  margin-left: 2px;
  transform: translateY(1px);
  animation: blink 1.5s step-start infinite;
}

.commandLine .terminalInputLine .cursor.no-blink,
#nanoOutput #nanoOutputContent .cursor.no-blink {
  animation: none;
}

@keyframes blink {
  0%, 100% {
    background-color: var(--terminal-cursor-color);
  }
  50% {
    background-color: transparent;
  }
}

#nanoOutput {
  position: fixed;
  top: 35px;
  left: 0;
  display: none;
  background-color: var(--terminal-bg-color);
  width: 100%;
  height: calc(100vh - 35px);
  flex-direction: column;
}

#nanoOutputHeader {
  position: relative;
  top: 0;
  height: 20px;
  font-size: 0.8rem;
  padding: 0 10px;
  background-color: var(--nano-bg-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#nanoOutputContent {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  padding: 10px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-grow: 1;
  background-color: var(--terminal-bg-color);
}

#nanoOutputInput {
  white-space: pre-wrap;
  line-height: 1.2;
  word-wrap: break-word;
  word-break: break-word;
}

#nanoOutputFooter {
  position: relative;
  bottom: 0;
  height: 20px;
  font-size: 0.8rem;
  padding: 0 10px;
  background-color: var(--nano-bg-color);
  display: flex;
  align-items: center;
  gap: 30px;
}

#nanoOutputContent::-webkit-scrollbar {
  display: none;
}

.nanoLine {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.code {
  padding: 2px;
  color: var(--terminal-code-color);
}

.files {
  word-break: keep-all;
}

#notification {
  position: fixed;
  bottom: 0;
  right: 0;
  color: var(--terminal-text-color);
  margin: 20px;
  max-width: 400px;
  width: 100%;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#notification .notification {
  background-color: var(--terminal-bg-color);
  border: 1px solid var(--terminal-text-color);
  padding: 10px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

#notification .notification.exit {
  animation: slideOut 0.3s ease-in forwards;
}


#notification .notification .notificationText {
  margin: 0;
  font-size: 0.8rem;
  color: var(--terminal-text-color);
}

#notification .notification i {
  border: none;
  padding: 5px;
  width: 12px;
  height: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  cursor: pointer;
}

#notification .notification i:hover {
  background-color: var(--toolbar-button-bg-color-hover);
}


@media screen and (max-width: 500px) {
  body {
    font-size: 12px;
  }
  #toolbar #userInfo {
    text-align: left;
    word-wrap: break-word;
    font-size: 0.5rem;
    max-width: 100px;
  }
}

.theme-selector {
  background-color: var(--terminal-bg-color);
  z-index: 1000;
  /* display: flex; */
  flex-direction: column;
  margin-top: 40px;
  padding: 10px;
  align-items: center;
  justify-content: center;
}

.theme-selector-header {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--terminal-text-color);
}

.theme-selector-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

.theme-option {
  background-color: var(--terminal-toolbar-bg-color);
  border: 2px solid var(--terminal-text-color);
  border-radius: 8px;
  max-width: 250px;
  width: 100%;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.theme-option:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.theme-option.active {
  border-color: red;
  background-color: var(--terminal-link-hover-color);
  color: var(--terminal-bg-color);
}

.theme-preview {
  width: 100%;
  height: 120px;
  border-radius: 4px;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.theme-preview-header {
  height: 20px;
  background-color: var(--terminal-toolbar-bg-color);
  border-bottom: 1px solid var(--terminal-text-color);
}

.theme-preview-content {
  height: 80px;
  background-color: var(--terminal-bg-color);
  position: relative;
}

.theme-preview-content::before {
  content: "user@ITCPR:~# ls";
  position: absolute;
  top: 10px;
  left: 10px;
  color: var(--terminal-text-color);
  font-size: 12px;
  font-family: monospace;
}

.theme-preview-footer {
  height: 20px;
  background-color: var(--terminal-toolbar-bg-color);
  border-top: 1px solid var(--terminal-text-color);
}

.theme-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--terminal-text-color);
}

/* Theme Definitions */
.theme-default {
  --terminal-bg-color: #000;
  --nano-bg-color: #888888;
  --terminal-text-color: #ffffffb7;
  --terminal-code-color: #8ebefac3;
  --terminal-text-output-color: #ff8c4eb7;
  --terminal-cursor-color: #fff;
  --terminal-toolbar-bg-color: #222;
  --terminal-toolbar-text-color: #ffffffb7;
  --toolbar-button-bg-color: #444;
  --toolbar-button-bg-color-hover: #666;
  --terminal-link-color: rgb(190, 168, 0);
  --terminal-link-hover-color: #9d47ee;
}

.theme-purple {
  --terminal-bg-color: #000000;
  --nano-bg-color: rgb(157, 157, 189);
  --terminal-text-color: rgb(157, 157, 189);
  --terminal-code-color: rgb(157, 157, 189);
  --terminal-text-output-color: rgb(157, 157, 189);
  --terminal-cursor-color: rgb(157, 157, 189);
  --terminal-toolbar-bg-color: #000000;
  --terminal-toolbar-text-color: rgb(157, 157, 189);
  --toolbar-button-bg-color: #111111;
  --toolbar-button-bg-color-hover: rgb(157, 157, 189);
  --terminal-link-color: rgb(157, 157, 189);
  --terminal-link-hover-color: #ffffff;
}

.theme-blue {
  --terminal-bg-color: #1a1a2e;
  --nano-bg-color: #4a90e2;
  --terminal-text-color: #e8f4fd;
  --terminal-code-color: #4a90e2;
  --terminal-text-output-color: #4a90e2;
  --terminal-cursor-color: #4a90e2;
  --terminal-toolbar-bg-color: #16213e;
  --terminal-toolbar-text-color: #e8f4fd;
  --toolbar-button-bg-color: #0f3460;
  --toolbar-button-bg-color-hover: #4a90e2;
  --terminal-link-color: #4a90e2;
  --terminal-link-hover-color: #ffffff;
}

.theme-green {
  --terminal-bg-color: #0a0a0a;
  --nano-bg-color: #50c878;
  --terminal-text-color: #e8f5e8;
  --terminal-code-color: #50c878;
  --terminal-text-output-color: #50c878;
  --terminal-cursor-color: #50c878;
  --terminal-toolbar-bg-color: #0a0a0a;
  --terminal-toolbar-text-color: #e8f5e8;
  --toolbar-button-bg-color: #1a1a1a;
  --toolbar-button-bg-color-hover: #50c878;
  --terminal-link-color: #50c878;
  --terminal-link-hover-color: #ffffff;
}

.theme-light {
  --terminal-bg-color: #ffffff;
  --nano-bg-color: #cccccc;
  --terminal-text-color: #000000e1;
  --terminal-code-color: #3b93ffd4;
  --terminal-text-output-color: #d35400;
  --terminal-cursor-color: #000;
  --terminal-toolbar-bg-color: #afafaf;
  --terminal-toolbar-text-color: #000000;
  --toolbar-button-bg-color: #7d7d7d;
  --toolbar-button-bg-color-hover: #999999;
  --terminal-link-color: #567300;
  --terminal-link-hover-color: #7d0fe4;
}

.theme-light-purple {
  --terminal-bg-color: #ffffff;
  --nano-bg-color: rgb(157, 157, 189);
  --terminal-text-color: #000000;
  --terminal-code-color: rgb(157, 157, 189);
  --terminal-text-output-color: rgb(157, 157, 189);
  --terminal-cursor-color: #000000;
  --terminal-toolbar-bg-color: #ffffff;
  --terminal-toolbar-text-color: #000000;
  --toolbar-button-bg-color: #f0f0f0;
  --toolbar-button-bg-color-hover: rgb(157, 157, 189);
  --terminal-link-color: rgb(157, 157, 189);
  --terminal-link-hover-color: #000000;
}

.theme-light-blue {
  --terminal-bg-color: #f0f8ff;
  --nano-bg-color: #4a90e2;
  --terminal-text-color: #1a1a2e;
  --terminal-code-color: #4a90e2;
  --terminal-text-output-color: #4a90e2;
  --terminal-cursor-color: #1a1a2e;
  --terminal-toolbar-bg-color: #e6f3ff;
  --terminal-toolbar-text-color: #1a1a2e;
  --toolbar-button-bg-color: #d1e7ff;
  --toolbar-button-bg-color-hover: #4a90e2;
  --terminal-link-color: #4a90e2;
  --terminal-link-hover-color: #1a1a2e;
}

.theme-light-green {
  --terminal-bg-color: #f0fff0;
  --nano-bg-color: #50c878;
  --terminal-text-color: #0a0a0a;
  --terminal-code-color: #50c878;
  --terminal-text-output-color: #50c878;
  --terminal-cursor-color: #0a0a0a;
  --terminal-toolbar-bg-color: #e6f5e6;
  --terminal-toolbar-text-color: #0a0a0a;
  --toolbar-button-bg-color: #d1f0d1;
  --toolbar-button-bg-color-hover: #50c878;
  --terminal-link-color: #50c878;
  --terminal-link-hover-color: #0a0a0a;
}