/**
 * ═══════════════════════════════════════════════════════════════════════════
 * GUARDIANGATE - Estilos para Indicadores de Atalhos de Teclado
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ─────────────────────────────────────────────────────────────────────────────
   INDICADORES DE ATALHO
   ───────────────────────────────────────────────────────────────────────────── */

/* Estilo base para badges de atalho */
.shortcut-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 500;
  line-height: 1;
  border-radius: 0.25rem;
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-left: 0.5rem;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

/* Dark mode */
.dark .shortcut-badge {
  background-color: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

/* Mostrar indicadores quando ativo */
.show-shortcut-indicators .shortcut-badge,
[data-show-shortcuts] .shortcut-badge {
  opacity: 1;
  transform: scale(1);
}

/* Hover em elementos com atalho */
[data-shortcut]:hover .shortcut-badge,
[data-shortcut]:focus .shortcut-badge {
  opacity: 1;
  transform: scale(1);
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOOLTIP DE ATALHO
   ───────────────────────────────────────────────────────────────────────────── */

.shortcut-tooltip {
  position: absolute;
  z-index: 9999;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  background-color: #1e293b;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.shortcut-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.shortcut-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #1e293b;
}

.shortcut-tooltip kbd {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.6875rem;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 0.25rem;
  margin-left: 0.5rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MODAL DE ATALHOS
   ───────────────────────────────────────────────────────────────────────────── */

#shortcuts-help-modal {
  animation: fadeIn 0.2s ease;
}

#shortcuts-help-modal.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#shortcuts-help-modal > div:last-child {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilo das teclas no modal */
#shortcuts-help-modal kbd {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  color: #475569;
  background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dark #shortcuts-help-modal kbd {
  color: #cbd5e1;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Grid responsivo para categorias */
#shortcuts-content {
  display: grid;
  gap: 2rem;
}

@media (min-width: 640px) {
  #shortcuts-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  #shortcuts-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Categoria de atalhos */
#shortcuts-content > div {
  background-color: #f8fafc;
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
}

.dark #shortcuts-content > div {
  background-color: #0f172a;
  border-color: #334155;
}

/* ─────────────────────────────────────────────────────────────────────────────
   NAVEGAÇÃO POR TECLADO - FOCO VISUAL
   ───────────────────────────────────────────────────────────────────────────── */

/* Indicador de item selecionado via teclado */
[data-keyboard-selected] {
  outline: 2px solid #10b981 !important;
  outline-offset: 2px !important;
  background-color: rgba(16, 185, 129, 0.05) !important;
}

.dark [data-keyboard-selected] {
  background-color: rgba(52, 211, 153, 0.1) !important;
}

/* Ring de foco para elementos navegáveis */
.keyboard-focus-ring:focus-visible {
  outline: none;
  ring: 2px;
  ring-color: #10b981;
  ring-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   ANIMAÇÃO DE FEEDBACK
   ───────────────────────────────────────────────────────────────────────────── */

@keyframes shortcutFeedback {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.shortcut-activated {
  animation: shortcutFeedback 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BARRA DE STATUS DE ATALHOS (Opcional)
   ───────────────────────────────────────────────────────────────────────────── */

.shortcuts-status-bar {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: #64748b;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.shortcuts-status-bar.visible {
  opacity: 1;
  transform: translateY(0);
}

.dark .shortcuts-status-bar {
  color: #94a3b8;
  background-color: rgba(15, 23, 42, 0.95);
  border-color: #334155;
}

.shortcuts-status-bar kbd {
  padding: 0.125rem 0.375rem;
  font-family: monospace;
  font-size: 0.6875rem;
  background-color: #f1f5f9;
  border-radius: 0.25rem;
}

.dark .shortcuts-status-bar kbd {
  background-color: #1e293b;
}
