/**
 * Keyboard Shortcuts - Styles
 * CLS-safe animations and visual feedback
 */

/* ============================================
   Visual Feedback Overlay
   ============================================ */

.shortcut-feedback {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, var(--blue, #1E88E5), var(--blue-700, #1565C0));
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(30, 136, 229, 0.3);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shortcut-feedback.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.shortcut-feedback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shortcut-feedback-icon svg {
  width: 16px;
  height: 16px;
  stroke: white;
  fill: none;
}

.shortcut-feedback-text {
  white-space: nowrap;
}

/* ============================================
   Help Modal
   ============================================ */

.shortcuts-help-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.shortcuts-help-modal.visible {
  opacity: 1;
  pointer-events: all;
}

.shortcuts-help-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.shortcuts-help-content {
  position: relative;
  background: white;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.shortcuts-help-modal.visible .shortcuts-help-content {
  transform: scale(1);
}

.shortcuts-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid #E2E8F0;
}

.shortcuts-help-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink, #0F172A);
}

.shortcuts-help-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #F1F5F9;
  color: #64748B;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcuts-help-close:hover {
  background: #E2E8F0;
  color: var(--ink, #0F172A);
}

.shortcuts-help-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  background: #F8FAFC;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.shortcut-item:hover {
  background: #F1F5F9;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 140px;
}

.shortcut-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  background: white;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate, #475569);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.shortcut-plus {
  color: #94A3B8;
  font-size: 12px;
  font-weight: 500;
}

.shortcut-desc {
  flex: 1;
  color: var(--slate, #475569);
  font-size: 14px;
  font-weight: 500;
}

.shortcuts-help-footer {
  padding: 20px 28px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  border-radius: 0 0 18px 18px;
}

.shortcuts-help-footer p {
  margin: 0;
  text-align: center;
  color: var(--muted, #64748B);
  font-size: 13px;
}

.shortcuts-help-footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: white;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate, #475569);
  margin: 0 4px;
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
  .shortcuts-help-content {
    width: 95%;
    max-height: 90vh;
  }

  .shortcuts-help-header {
    padding: 20px;
  }

  .shortcuts-help-header h2 {
    font-size: 18px;
  }

  .shortcuts-help-body {
    padding: 20px;
  }

  .shortcut-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .shortcut-keys {
    min-width: auto;
  }

  .shortcuts-help-footer {
    padding: 16px 20px;
  }
}

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .shortcut-feedback,
  .shortcuts-help-modal,
  .shortcuts-help-content,
  .shortcut-item {
    transition: none;
  }

  .shortcuts-help-modal.visible .shortcuts-help-content {
    transform: none;
  }
}

/* Focus styles */
.shortcuts-help-close:focus-visible {
  outline: 2px solid var(--blue, #1E88E5);
  outline-offset: 2px;
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  .shortcuts-help-content {
    background: #1E293B;
    color: #E2E8F0;
  }

  .shortcuts-help-header {
    border-bottom-color: #334155;
  }

  .shortcuts-help-header h2 {
    color: #F1F5F9;
  }

  .shortcuts-help-close {
    background: #334155;
    color: #94A3B8;
  }

  .shortcuts-help-close:hover {
    background: #475569;
    color: #E2E8F0;
  }

  .shortcut-item {
    background: #0F172A;
  }

  .shortcut-item:hover {
    background: #1E293B;
  }

  .shortcut-keys kbd {
    background: #334155;
    border-color: #475569;
    color: #E2E8F0;
  }

  .shortcut-desc {
    color: #CBD5E1;
  }

  .shortcuts-help-footer {
    background: #0F172A;
    border-top-color: #334155;
  }

  .shortcuts-help-footer p {
    color: #94A3B8;
  }

  .shortcuts-help-footer kbd {
    background: #334155;
    border-color: #475569;
    color: #E2E8F0;
  }
}
