/**
 * Retro Gaming Command Center Theme - 1980s NES/SNES Style
 * Using Springlite colors and Pixelify Sans font
 */

/* Springlite Color Variables */
:root {
  --nown-yellow: #efe13b;
  --nown-green: #28ce6f;
  --spring-pink: #cc4e74;
  --nown-blue: #4eb3cc;
  --fiit-green: #28ce6f;

  /* Retro 8-bit palette */
  --retro-bg: #0f0f23;
  --retro-screen: #1a1a2e;
  --retro-border: #00ff41;
  --retro-text: #00ff41;
  --retro-yellow: #efe13b;
  --retro-pink: #cc4e74;
  --retro-cyan: #4eb3cc;
}

/* CRT Screen Effect */
body.retro-mode {
  background: var(--retro-bg);
  font-family: 'Pixelify Sans', monospace !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

body.retro-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.15),
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 2px
    );
  pointer-events: none;
  z-index: 9999;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* AI Bot - Pixel Sprite */
.pixel-bot {
  position: fixed;
  width: 48px;
  height: 48px;
  z-index: 10000;
  cursor: pointer;
  image-rendering: pixelated;
  transition: none;  /* Instant movement like old games */
}

/* Hide behind elements mode */
.pixel-bot.hiding {
  z-index: 5;  /* Lower than task cards/displays */
  opacity: 0.7;
}

.pixel-bot.peeking {
  z-index: 5;
  opacity: 0.9;
}

.bot-sprite {
  width: 48px;
  height: 48px;
  background: var(--retro-border);
  border: 4px solid var(--nown-yellow);
  box-shadow:
    0 0 20px var(--retro-border),
    inset 0 0 10px rgba(0, 255, 65, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
}

.bot-sprite::after {
  content: '🤖';
  filter: hue-rotate(90deg) contrast(2);
}

/* Bot animations - choppy like 8-bit games */
.bot-dodge {
  animation: pixel-dodge 0.2s steps(4) forwards;
}

.bot-spin {
  animation: pixel-spin 0.6s steps(8) forwards;
}

.bot-bounce {
  animation: pixel-bounce 0.4s steps(4) infinite;
}

@keyframes pixel-dodge {
  0% { transform: translate(0, 0); }
  100% { transform: translate(var(--dodge-x, 100px), var(--dodge-y, 0)); }
}

@keyframes pixel-spin {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg) scale(0.9); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg) scale(0.9); }
  100% { transform: rotate(360deg); }
}

@keyframes pixel-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* Chat Dialog - Retro Terminal Style */
.bot-dialog {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 400px;
  max-height: 500px;
  background: var(--retro-screen);
  border: 4px solid var(--retro-border);
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.5);
  font-family: 'Pixelify Sans', monospace;
  z-index: 9998;
  display: none;
}

.bot-dialog.active {
  display: flex;
  flex-direction: column;
}

.dialog-header {
  background: var(--retro-border);
  color: #000;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.dialog-close {
  background: var(--spring-pink);
  border: 2px solid #000;
  color: #000;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-weight: 900;
}

.dialog-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #000;
  color: var(--retro-text);
  max-height: 350px;
}

.message {
  margin-bottom: 1rem;
  padding: 0.5rem;
  border: 2px solid;
}

.message.user {
  background: rgba(78, 179, 204, 0.1);
  border-color: var(--nown-blue);
  color: var(--nown-blue);
  margin-left: 2rem;
}

.message.bot {
  background: rgba(0, 255, 65, 0.1);
  border-color: var(--retro-border);
  color: var(--retro-text);
  margin-right: 2rem;
}

.dialog-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--retro-screen);
  border-top: 2px solid var(--retro-border);
}

.dialog-input input {
  flex: 1;
  background: #000;
  border: 2px solid var(--retro-border);
  color: var(--retro-text);
  padding: 0.5rem;
  font-family: 'Pixelify Sans', monospace;
}

.dialog-input button {
  background: var(--nown-yellow);
  border: 2px solid #000;
  color: #000;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 700;
}

.dialog-input button:hover {
  background: var(--retro-border);
}
