/* ==========================================================================
   TypeGuru Keyboard & Anatomical Hands Styling
   Left & Right Space Hands with Floating Green Indicator Dots
   Virtual Keyboard with Dedicated Close Option
   ========================================================================== */

/* --- Anatomical Hands in Left & Right Space --- */
.hand-side-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
}

.hand-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hand-graphic-svg {
  width: 170px;
  max-width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.hand-silhouette {
  fill: var(--hand-fill, #a2b2df);
  stroke: var(--hand-stroke, #1e293b);
  stroke-width: 2.8px;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

/* Floating Green Active Indicator Dot above active fingertip */
.finger-indicator-dot {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease-in-out;
}

.finger-indicator-dot.dot-active {
  opacity: 1 !important;
  animation: dotPulse 0.8s infinite alternate ease-in-out;
}

@keyframes dotPulse {
  0% {
    transform: scale(1);
    transform-origin: center;
    filter: drop-shadow(0 0 3px #22c55e);
  }
  100% {
    transform: scale(1.2);
    transform-origin: center;
    filter: drop-shadow(0 0 10px #22c55e);
  }
}

/* --- Virtual Keyboard Section --- */
.virtual-keyboard-drawer {
  position: relative;
  z-index: 20;
  pointer-events: auto;
  margin-top: 0.75rem;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
}

.virtual-keyboard-drawer.collapsed {
  display: none !important;
}

.virtual-keyboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 25;
}

.virtual-keyboard-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.layout-pill {
  font-size: 0.7rem;
  background: #1e293b;
  color: #38bdf8;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Close button inside Virtual Keyboard */
.btn-close-vk {
  position: relative;
  z-index: 30;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #ef4444;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
  transition: all 0.2s ease;
}

.btn-close-vk:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.6);
}

/* Keyboard Container */
.keyboard-container {
  background: #0f172a;
  padding: 0.75rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  user-select: none;
  overflow-x: auto;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
}

/* Keycaps */
.keyboard-key {
  position: relative;
  height: 42px;
  min-width: 36px;
  flex: 1;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #f3f4f6;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 3px 0 #111827, 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  transition: all 0.12s ease;
  cursor: default;
}

.keyboard-key .key-label-main {
  font-size: 0.88rem;
  line-height: 1;
}

.keyboard-key .key-label-sub {
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 0.65rem;
  color: #9ca3af;
  font-weight: 500;
}

/* Home Row Bump */
.keyboard-key.home-key::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 12px;
  height: 2px;
  background: #60a5fa;
  border-radius: 2px;
}

/* Width Modifiers */
.keyboard-key.wide-backspace { min-width: 75px; flex: 1.8; font-size: 0.75rem; }
.keyboard-key.wide-tab { min-width: 55px; flex: 1.4; font-size: 0.75rem; }
.keyboard-key.wide-caps { min-width: 62px; flex: 1.6; font-size: 0.75rem; }
.keyboard-key.wide-enter { min-width: 75px; flex: 1.9; font-size: 0.75rem; }
.keyboard-key.wide-shift-l { min-width: 80px; flex: 2; font-size: 0.75rem; }
.keyboard-key.wide-shift-r { min-width: 88px; flex: 2.2; font-size: 0.75rem; }
.keyboard-key.wide-ctrl { min-width: 48px; flex: 1.2; font-size: 0.7rem; }
.keyboard-key.wide-alt { min-width: 46px; flex: 1.1; font-size: 0.7rem; }
.keyboard-key.wide-space { min-width: 210px; flex: 5.5; }
.keyboard-key.wide-backslash { min-width: 46px; flex: 1.2; }

/* Interactive Key Highlights */
.keyboard-key.key-target {
  background: #2563eb !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #1d4ed8, 0 0 14px rgba(59, 130, 246, 0.75) !important;
  animation: keyPulse 1s infinite alternate ease-in-out;
}

.keyboard-key.key-shift-needed {
  background: #d97706 !important;
  border-color: #fbbf24 !important;
  color: #ffffff !important;
  animation: shiftGlow 0.8s infinite alternate ease-in-out;
}

.keyboard-key.key-pressed-correct {
  background: #10b981 !important;
  border-color: #34d399 !important;
  transform: translateY(2px);
  box-shadow: 0 1px 0 #059669 !important;
}

.keyboard-key.key-pressed-error {
  background: #ef4444 !important;
  border-color: #f87171 !important;
  transform: translateY(2px);
  box-shadow: 0 1px 0 #dc2626 !important;
}

@keyframes keyPulse {
  0% { transform: translateY(-2px); box-shadow: 0 3px 0 #1d4ed8, 0 0 8px rgba(59, 130, 246, 0.5); }
  100% { transform: translateY(-3px); box-shadow: 0 5px 0 #1d4ed8, 0 0 16px rgba(59, 130, 246, 0.9); }
}

@keyframes shiftGlow {
  0% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
  100% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.8); }
}

/* Kruti Dev & Mangal Font helpers */
.kruti-font {
  font-family: 'Kruti Dev 010', 'KrutiDev', 'DV-TTSurekh', sans-serif !important;
}

.mangal-font {
  font-family: 'Mangal', 'Noto Sans Devanagari', 'Aparajita', sans-serif !important;
}
