/* Complete redesign with cyberpunk blue/cyan theme */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-deep-blue: #000033;
  --bg-dark-blue: #000044;
  --neon-cyan: #00ffff;
  --neon-green: #00ff00;
  --bright-cyan: #0ff;
  --text-cyan: #00dddd;
  --border-cyan: #00ffff;
  --shadow-cyan: 0 0 10px #00ffff, 0 0 20px #00ffff80;
  --shadow-green: 0 0 10px #00ff00;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background: #000022;
  font-family: "Courier New", Courier, monospace;
  color: var(--neon-cyan);
  position: relative;
}

html {
  overflow: hidden;
  width: 100%;
  height: 100%;
}

/* Starfield Background */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000022;
  z-index: 0;
}

.stars::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20px 30px, white, transparent),
    radial-gradient(2px 2px at 60px 70px, white, transparent), radial-gradient(1px 1px at 50px 50px, white, transparent),
    radial-gradient(1px 1px at 130px 80px, white, transparent),
    radial-gradient(2px 2px at 90px 10px, white, transparent);
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: stars 200s linear infinite;
  opacity: 0.3;
}

@keyframes stars {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-200px);
  }
}

/* Added loading screen styles */
/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-deep-blue);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: screen-flicker 0.15s infinite;
}

.ascii-logo {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 30px;
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%,
  100% {
    text-shadow: 0 0 10px var(--neon-cyan);
  }
  50% {
    text-shadow: 0 0 20px var(--neon-cyan), 0 0 30px var(--neon-cyan);
  }
}

.loading-text {
  color: var(--neon-cyan);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
  text-shadow: 0 0 8px var(--neon-cyan);
}

.loading-dots {
  display: inline-block;
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60% {
    content: "...";
  }
  80%,
  100% {
    content: "";
  }
}

.spinner {
  font-size: 20px;
  color: var(--neon-green);
  text-shadow: 0 0 10px var(--neon-green);
  font-weight: bold;
  animation: none;
}

/* Main Container */
.container {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 2.5vh 2.5vw;
}

/* Title Bar */
/* Made title bar more compact */
.title-bar {
  background: var(--neon-cyan);
  color: var(--bg-deep-blue);
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 12px;
  border: 2px solid var(--neon-cyan);
  box-shadow: var(--shadow-cyan);
  flex-shrink: 0;
}

.title-text {
  letter-spacing: 2px;
}

.window-controls {
  display: flex;
  gap: 8px;
}

.control {
  cursor: pointer;
  user-select: none;
}

/* Terminal Window */
.terminal-window {
  flex: 1;
  background: var(--bg-deep-blue);
  border: 3px solid var(--neon-cyan);
  border-top: none;
  box-shadow: var(--shadow-cyan), inset 0 0 50px rgba(0, 255, 255, 0.1);
  padding: 16px;
  overflow: hidden;
  position: relative;
  animation: screen-flicker 0.15s infinite;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@keyframes screen-flicker {
  0%,
  100% {
    opacity: 0.98;
  }
  50% {
    opacity: 1;
  }
}

/* Scanline Effect */
.terminal-window::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 255, 255, 0.02) 51%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 10;
}

/* Boot Section */
.boot-section {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
  /* Add transition and max-height for smooth collapse */
  transition: all 0.5s ease;
  max-height: 500px;
  overflow: hidden;
}

/* Add collapsed state for boot section */
.boot-section.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

.boot-text {
  margin-bottom: 8px;
  animation: text-glow 2s ease-in-out infinite;
}

.success-text {
  color: var(--neon-green);
  text-shadow: var(--shadow-green);
  font-weight: bold;
  margin-top: 8px;
}

.prompt-text {
  color: var(--bright-cyan);
  margin-top: 8px;
}

@keyframes text-glow {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
}

/* Main Content */
/* Restructured main content to prioritize command input over output */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fade-in 1s ease-in;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Collapsible header section for compact layout */
.header-section {
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.header-section.collapsed {
  display: none;
}

.tagline {
  text-align: center;
  color: var(--text-cyan);
  font-size: 14px;
  margin-bottom: 16px;
  text-shadow: 0 0 8px var(--neon-cyan);
  flex-shrink: 0;
}

/* Content Grid */
/* Made grid more compact */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

/* Panels */
/* Reduced panel padding for compactness */
.panel {
  border: 2px solid var(--neon-cyan);
  background: rgba(0, 0, 68, 0.5);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
  padding: 10px;
}

.panel-title {
  color: var(--bright-cyan);
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 11px;
  border-bottom: 1px solid var(--neon-cyan);
  padding-bottom: 6px;
  text-shadow: 0 0 8px var(--neon-cyan);
}

.panel-content {
  font-size: 11px;
  line-height: 1.6;
}

/* Menu Items */
.menu-item {
  color: var(--neon-green);
  cursor: pointer;
  padding: 3px 0;
  transition: all 0.2s;
  text-shadow: 0 0 5px var(--neon-green);
}

.menu-item:hover {
  color: var(--bright-cyan);
  text-shadow: 0 0 10px var(--bright-cyan);
  transform: translateX(4px);
}

/* Status Items */
.status-item {
  color: var(--text-cyan);
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.status-value {
  color: var(--neon-green);
  font-weight: bold;
  text-shadow: var(--shadow-green);
}

.status-bar {
  color: var(--neon-green);
  text-shadow: var(--shadow-green);
  letter-spacing: 2px;
}

/* Command Section */
/* Command section now positioned above output */
.command-section {
  border: 2px solid var(--neon-cyan);
  background: rgba(0, 0, 68, 0.5);
  padding: 12px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
  flex-shrink: 0;
  order: 1;
}

.command-prompt {
  color: var(--bright-cyan);
  font-size: 13px;
  margin-bottom: 6px;
  text-shadow: 0 0 8px var(--neon-cyan);
}

.prompt-label {
  color: #ffff00;
  text-shadow: 0 0 8px #ffff00;
}

.command-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px;
  border: 1px solid var(--neon-cyan);
  position: relative;
}

.command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--neon-cyan);
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  text-shadow: 0 0 5px var(--neon-cyan);
  caret-color: transparent;
  padding-left: 4px;
}

/* Cursor positioned on the left and moves with text like MS-DOS */
.cursor-blink {
  color: var(--neon-cyan);
  animation: cursor-blink 1s step-end infinite;
  position: absolute;
  left: 8px;
  pointer-events: none;
  text-shadow: 0 0 5px var(--neon-cyan);
}

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

/* Output Section */
/* Output section now below command and auto-scrolls, grows to fill space */
.output-section {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  border: 2px solid var(--neon-cyan);
  background: rgba(0, 0, 68, 0.3);
  padding: 12px;
  color: var(--text-cyan);
  font-size: 12px;
  line-height: 1.5;
  box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.2);
  display: none;
  order: 2;
  min-height: 0;
}

.output-section.active {
  display: block;
}

.output-section::-webkit-scrollbar {
  width: 8px;
}

.output-section::-webkit-scrollbar-track {
  background: transparent;
}

.output-section::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  box-shadow: 0 0 5px var(--neon-cyan);
}

.output-line {
  margin-bottom: 3px;
  text-shadow: 0 0 5px var(--neon-cyan);
  word-wrap: break-word;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 1vh 1vw;
  }

  .terminal-window {
    padding: 10px;
  }

  .main-content {
    gap: 10px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .title-bar {
    font-size: 10px;
    padding: 5px 10px;
  }

  .panel-content,
  .command-input,
  .output-section {
    font-size: 11px;
  }

  .panel {
    padding: 8px;
  }

  .command-section {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5vh 0.5vw;
  }

  .terminal-window {
    padding: 8px;
  }

  .content-grid {
    gap: 8px;
  }

  .panel {
    padding: 8px;
  }

  .command-section {
    padding: 8px;
  }

  .title-bar {
    font-size: 9px;
    padding: 4px 8px;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.error-text {
  color: #ff0000;
  text-shadow: 0 0 8px #ff0000;
}

.success-text {
  color: var(--neon-green);
  text-shadow: var(--shadow-green);
}

.highlight-text {
  color: #ffff00;
  text-shadow: 0 0 8px #ffff00;
}
