body {
  background-color: #121212;
  background-image: radial-gradient(#303030 1px, transparent 1px);
  background-size: 30px 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: var(--spacing-md);
  box-sizing: border-box;
}

/* Terminal container - this wraps the actual terminal */
.terminal-container {
  width: 90%;
  max-width: 900px;
  height: 80vh;
  max-height: 700px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  position: relative;
}

/* Terminal window title bar */
.terminal-titlebar {
  height: 30px;
  background-color: rgba(20, 20, 20, 0.8);
  display: flex;
  align-items: center;
  padding: 0 15px;
  user-select: none;
}

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

.control-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
}

.close-btn {
  background-color: #ff5f56;
}

.minimize-btn {
  background-color: #ffbd2e;
}

.maximize-btn {
  background-color: #27c93f;
}

.window-title {
  color: #aaa;
  font-size: var(--font-size-xs);
  font-family: var(--font-main);
  flex-grow: 1;
  text-align: center;
}

/* Modified terminal element to fit in container */
#terminal {
  height: calc(100% - 30px);
  width: 100%;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  text-shadow: 0 0 5px rgba(150, 150, 150, 0.3);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--prompt) var(--background);
}

/* Theme switcher styles - moved to bottom right of terminal container */
.theme-switcher {
  position: absolute;
  bottom: 15px;
  right: 15px;
  z-index: 100;
  background-color: rgba(30, 30, 30, 0.7);
  padding: 8px;
  border-radius: 5px;
  display: flex;
  gap: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
}

.theme-option {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.theme-option:hover {
  transform: scale(1.2);
  box-shadow: 0 0 5px var(--prompt);
}

.theme-option.dark {
  background-color: #0d1117;
  border: 1px solid #58a6ff;
}

.theme-option.hacker {
  background-color: #0a0e0a;
  border: 1px solid #33ff33;
}

.theme-option.retro {
  background-color: #2b2b2b;
  border: 1px solid #ff8833;
}

/* Loading animation */
.loading {
  display: inline-block;
  margin-left: 5px;
}

.loading::after {
  content: "";
  animation: loading 1s infinite;
}

@keyframes loading {
  0% {
    content: ".";
  }
  33% {
    content: "..";
  }
  66% {
    content: "...";
  }
  100% {
    content: ".";
  }
}

/* Hidden Easter Egg styles */
.easter-egg {
  display: none;
}

.easter-egg.visible {
  display: block;
  animation: reveal 0.5s ease-out;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Matrix rain effect (hidden by default) */
#matrix-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  display: none;
}

#matrix-rain.active {
  display: block;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: var(--prompt);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--link);
}

/* Fireworks animation for easter eggs */
.fireworks {
  pointer-events: none;
  z-index: 999;
}

/* Snake game container */
.game-container {
  border: 2px solid var(--prompt);
  margin: 10px 0;
  position: relative;
  overflow: hidden;
}

/* Accessibility focus outline */
:focus {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.command:focus {
  outline: none;
}

/* Responsive adjustments for the terminal container */
@media (max-width: 768px) {
  .terminal-container {
    width: 100%;
    height: 100vh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .side-decoration {
    display: none; /* Hide decorations on mobile */
  }

  body {
    padding: 0; /* Remove padding on mobile */
  }

  .terminal-titlebar {
    height: 40px; /* Increase touch target size */
    padding: 0 10px;
  }

  .control-btn {
    width: 14px; /* Slightly larger control buttons */
    height: 14px;
  }

  .window-title {
    font-size: 12px;
  }

  #terminal {
    padding: 10px;
    font-size: 14px; /* Slightly smaller font for better fit */
  }
}

/* Additional tablet-specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .terminal-container {
    width: 95%;
    height: 90vh;
  }
}

/* Optional: Add side decorations */
.side-decoration {
  position: fixed;
  width: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: -1;
  opacity: 0.5;
}

.side-decoration.left {
  left: 20px;
}

.side-decoration.right {
  right: 20px;
}

.side-decoration svg {
  width: 100%;
  height: auto;
  fill: var(--prompt);
}
