/* Vim Training - Buffer & Cursor Styles */

.vim-buffer {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Menlo, monospace;
  tab-size: 4;
  white-space: pre;
  overflow-x: auto;
}

/* Normal mode cursor (block) */
.vim-cursor {
  background-color: #22c55e;
  color: #000;
  animation: vim-blink 1s step-end infinite;
}

/* Insert mode cursor (line) */
.vim-cursor-insert {
  border-left: 2px solid #22c55e;
  animation: vim-blink 1s step-end infinite;
  margin-left: -1px;
}

/* Visual mode selection */
.vim-visual {
  background-color: rgba(99, 102, 241, 0.4);
}

/* Command line at bottom of buffer */
.vim-command-line {
  border-top: 1px solid #374151;
  padding: 2px 8px;
  min-height: 1.25rem;
  font-size: 0.875rem;
}

/* Focus ring for interactive buffer */
.vim-buffer:focus {
  outline: none;
}

.vim-buffer-wrapper {
  position: relative;
}

@keyframes vim-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Shake animation for wrong key */
.vim-shake {
  animation: vim-shake 0.4s ease-in-out;
}

@keyframes vim-shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}

/* Success flash */
.vim-success {
  animation: vim-success-flash 0.8s ease-out;
}

@keyframes vim-success-flash {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.2); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
