:root {
  --terminal-bg: #000;
  --terminal-text: #0f0;
  --terminal-prompt: #0f0;
  --terminal-error: #f00;
}

html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--terminal-bg);
  color: var(--terminal-text);
  font-family: 'Press Start 2P', monospace;
  overflow: hidden;
}

#app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

#welcome-text {
  background-color: var(--terminal-bg);
  color: var(--terminal-text);
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  border: none;
}

.terminal {
  width: 90%;
  max-width: 900px;
  height: 600px;
  max-height: 85vh;
  background-color: var(--terminal-bg);
  border: 2px solid var(--terminal-text);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'Press Start 2P', monospace;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
}

.terminal-header {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-bottom: 1px solid var(--terminal-text);
  -webkit-backdrop-filter: brightness(1.2);
  backdrop-filter: brightness(1.2);
}

.terminal-title {
  color: var(--terminal-text);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  font-weight: bold;
}

.terminal-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
}

.terminal-output {
  margin-bottom: 10px;
}

.welcome-message pre {
  color: var(--terminal-text);
  font-family: 'Press Start 2P', monospace;
  margin: 0;
  line-height: 1.4;
}

.terminal-input-line {
  display: flex;
  align-items: center;
}

.terminal-prompt {
  color: var(--terminal-prompt);
  font-family: 'Press Start 2P', monospace;
  margin-right: 5px;
  font-size: 12px;
}

.terminal-prompt::after {
  display: none;
}

.terminal-input {
  background: transparent;
  border: none !important;
  color: var(--terminal-text);
  font-family: 'Press Start 2P', monospace !important;
  font-size: 12px;
  outline: none;
  flex: 1;
  line-height: 1.4;
}

/* Ensure input inherits font in all states */
input.terminal-input,
input.terminal-input:focus,
input.terminal-input:active {
  font-family: 'Press Start 2P', monospace !important;
  line-height: 1.6;
  margin-bottom: .425rem;

}


@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.command-output {
  margin: 10px 0;
  white-space: pre-wrap;
  font-family: 'Press Start 2P', monospace;
}

.error-output {
  color: var(--terminal-error);
}

.ls-output {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 10px 0;
}

.ls-item {
  color: var(--terminal-text);
  min-width: 150px;
}

.ls-item.directory {
  color: #0ff;
}

.ls-item.executable {
  color: #ff0;
}

/* Scrollbar styling */
/* Webkit browsers (Chrome, Safari, Edge) */
.terminal-body::-webkit-scrollbar {
  width: 12px;
}

.terminal-body::-webkit-scrollbar-track {
  background: var(--terminal-bg);
  border-left: 1px solid var(--terminal-text);
}

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--terminal-text);
  border-radius: 6px;
  border: 2px solid var(--terminal-bg);
  opacity: 0.6;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
  background: var(--terminal-prompt);
  opacity: 1;
}

/* Firefox */
.terminal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--terminal-text) var(--terminal-bg);
}

/* For better visibility, make scrollbar track slightly different from bg.
   Static value (10% text over bg): html2canvas can't parse color-mix() in
   Safari, which freezes the 3D terminal screen texture. */
.terminal-body::-webkit-scrollbar-track {
  background: #001a00;
}

/* Override terminal.css pre element styling */
pre {
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: var(--terminal-text) !important;
}

/* Loading Screen Styles */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--terminal-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

/* Progress bar */
.progress-bar {
  width: 300px;
  height: 20px;
  border: 2px solid var(--terminal-text);
  background: var(--terminal-bg);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--terminal-text);
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

/* Retro scanline effect */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.3) 2px,
    rgba(0, 0, 0, 0.3) 4px
  );
  pointer-events: none;
}

/* App starts hidden and gets shown by loader.js */

/* Responsive */
@media (max-width: 768px) {
  #app {
    padding: 10px;
  }
  
  .terminal {
    width: 100%;
    height: 95vh;
    max-height: none;
  }
  
  .terminal-body {
    padding: 10px;
  }
  
  .loader-container {
    padding: 20px;
  }
  
  .progress-bar {
    width: 80%;
    max-width: 250px;
  }
}