/**
 * Keyboard Shortcuts Help Modal Styles
 */

/* Help Modal */
.keyboard-help-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.keyboard-help-modal.visible {
  opacity: 1;
}

.keyboard-help-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.keyboard-help-content {
  position: relative;
  z-index: 1;
  background: var(--content-bg, white);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.2s ease;
}

.keyboard-help-modal.visible .keyboard-help-content {
  transform: scale(1) translateY(0);
}

.keyboard-help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: linear-gradient(to right, rgba(102, 126, 234, 0.05), transparent);
}

.keyboard-help-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--content-text, #1f2937);
}

.keyboard-help-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--content-text-secondary, #9ca3af);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: all 0.15s ease;
  border-radius: 8px;
}

.keyboard-help-close:hover {
  color: var(--content-text, #6b7280);
  background: var(--hover-bg, #f3f4f6);
}

.keyboard-help-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.keyboard-help-section {
  /* Single column sections span full width */
}

.keyboard-help-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-color, #667eea);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.keyboard-help-section h4 .section-icon {
  font-size: 1rem;
}

.keyboard-help-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.keyboard-help-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  transition: background 0.1s ease;
}

.keyboard-help-item:hover {
  background: var(--hover-bg, #f9fafb);
}

.keyboard-help-keys {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.keyboard-help-item kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  background: var(--hover-bg, #f3f4f6);
  border: 1px solid var(--border-color, #e5e7eb);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--content-text, #374151);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.keyboard-help-desc {
  font-size: 0.8125rem;
  color: var(--content-text-secondary, #6b7280);
  text-align: right;
}

.keyboard-help-footer {
  padding: 0.875rem 1.5rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--hover-bg, #f9fafb);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.keyboard-help-footer-left,
.keyboard-help-footer-right {
  display: flex;
  align-items: center;
}

.keyboard-help-hint {
  font-size: 0.8125rem;
  color: var(--content-text-secondary, #6b7280);
}

.keyboard-help-tip {
  font-size: 0.75rem;
  color: var(--content-text-secondary, #9ca3af);
}

.keyboard-help-hint kbd,
.keyboard-help-footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin: 0 2px;
  background: var(--content-bg, white);
  border: 1px solid var(--border-color, #e5e7eb);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--content-text, #374151);
}

/* Keyboard focus style for rows */
.dv-table tbody tr.dv-keyboard-focus,
.dv-list-item.dv-keyboard-focus,
.dv-card.dv-keyboard-focus {
  outline: 2px solid var(--primary-color, #667eea);
  outline-offset: -2px;
  background: rgba(102, 126, 234, 0.05);
}

.dv-table tbody tr.dv-keyboard-focus:hover,
.dv-list-item.dv-keyboard-focus:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* Keyboard hint in empty states */
.dv-empty-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin: 0 3px;
  background: var(--hover-bg, #f3f4f6);
  border: 1px solid var(--border-color, #e5e7eb);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--content-text, #374151);
}

/* Dark mode adjustments */
[data-theme="dark"] .keyboard-help-item kbd,
[data-theme="dark"] .keyboard-help-hint kbd,
[data-theme="dark"] .dv-empty-hint kbd {
  background: var(--input-bg, #252542);
  border-color: var(--border-color, #374151);
}

[data-theme="dark"] .keyboard-help-content {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 640px) {
  .keyboard-help-body {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .keyboard-help-content {
    max-height: 90vh;
    border-radius: 12px;
  }
  
  .keyboard-help-footer {
    flex-direction: column;
    text-align: center;
  }
  
  .keyboard-help-item {
    padding: 0.5rem;
  }
}
