/* Keyboard Shortcuts Help Modal */
/* Safe-Bite Keyboard Shortcuts Styles */

/* Help Button */
.keyboard-help-btn {
  margin-left: 1rem;
}

.keyboard-help-btn button {
  background: var(--bg-card, white);
  border: 1px solid var(--border-color, #e9ecef);
  color: var(--text-primary, #2c3e50);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.keyboard-help-btn button:hover {
  background: var(--accent-primary, #2ecc71);
  color: var(--text-primary, white);
  border-color: var(--accent-primary, #2ecc71);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Help Modal */
.keyboard-help-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.help-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.help-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card, white);
  border-radius: 16px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color, #e9ecef);
  background: var(--bg-secondary, #f8f9fa);
}

.help-header h3 {
  margin: 0;
  color: var(--text-primary, #2c3e50);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary, #6c757d);
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.help-close:hover {
  background: var(--bg-primary, white);
  color: var(--danger-red, #e74c3c);
}

.help-body {
  padding: 2rem;
  max-height: 60vh;
  overflow-y: auto;
}

.help-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.help-section {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color, #e9ecef);
}

.help-section h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary, #2c3e50);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

.shortcut-desc {
  color: var(--text-secondary, #6c757d);
  font-size: 0.9rem;
  text-align: right;
  flex: 1;
  margin-left: 1rem;
}

/* Keyboard Keys Styling */
kbd {
  background: var(--bg-primary, white);
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--text-primary, #2c3e50);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: inline-block;
  line-height: 1;
}

kbd:hover {
  background: var(--accent-primary, #2ecc71);
  color: var(--text-primary, white);
  border-color: var(--accent-primary, #2ecc71);
  transform: translateY(-1px);
}

/* Help Tips Section */
.help-tips {
  background: linear-gradient(135deg, var(--info-blue, #3498db), var(--accent-primary, #2ecc71));
  color: white;
  border-radius: 12px;
  padding: 1.5rem;
}

.help-tips h4 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-tips ul {
  margin: 0;
  padding-left: 1.5rem;
}

.help-tips li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* Dark Mode Overrides */
body.dark-mode .help-content {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-mode .help-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .help-header h3 {
  color: var(--text-primary);
}

body.dark-mode .help-close {
  color: var(--text-secondary);
}

body.dark-mode .help-close:hover {
  background: var(--bg-card);
  color: var(--danger-red);
}

body.dark-mode .help-section {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

body.dark-mode .help-section h4 {
  color: var(--text-primary);
}

body.dark-mode .shortcut-desc {
  color: var(--text-secondary);
}

body.dark-mode kbd {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode kbd:hover {
  background: var(--accent-primary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translate(-50%, -40%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .help-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .help-sections {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .help-body {
    padding: 1rem;
  }
  
  .help-header {
    padding: 1rem;
  }
  
  .help-section {
    padding: 1rem;
  }
  
  .shortcut-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .shortcut-desc {
    margin-left: 0;
    text-align: left;
  }
  
  .keyboard-help-btn {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* Print Styles */
@media print {
  .keyboard-help-modal {
    display: none !important;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .help-content {
    animation: none;
  }
  
  .keyboard-help-btn button:hover {
    transform: none;
  }
  
  kbd:hover {
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  kbd {
    border-width: 2px;
    font-weight: 700;
  }
  
  .help-section {
    border-width: 2px;
  }
}
