/**
 * F1 Contextual Help Overlay Styles
 * ==================================
 * Modal overlay for room-specific help content.
 * Triggered by F1 key anywhere in the app.
 */

/* ============================================================================
   Overlay Backdrop
   ============================================================================ */

.f1-help-overlay {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.85) !important;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.f1-help-overlay--visible {
  opacity: 1;
}

.f1-help-overlay--closing {
  opacity: 0;
}

/* ============================================================================
   Modal Container
   ============================================================================ */

.f1-help-modal {
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--bg-primary, #0d0d1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease-out;
}

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

.f1-help-overlay--closing .f1-help-modal {
  transform: scale(0.95) translateY(10px);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .f1-help-overlay,
  .f1-help-modal {
    transition: none;
  }
}

/* ============================================================================
   Header
   ============================================================================ */

.f1-help-modal__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color, #333);
  background: var(--bg-secondary, #1a1a2e);
}

.f1-help-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--accent-color, #8b5cf6);
}

.f1-help-modal__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.f1-help-modal__title {
  flex: 1;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #e5e5e5);
}

.f1-help-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted, #888);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.f1-help-modal__close:hover {
  background: var(--bg-tertiary, #252540);
  color: var(--text-primary, #e5e5e5);
}

.f1-help-modal__close svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ============================================================================
   Content
   ============================================================================ */

.f1-help-modal__content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Overview text at top */
.f1-help-modal__overview {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-secondary, #aaa);
  padding: 0.75rem 1rem;
  background: var(--bg-secondary, #1a1a2e);
  border-radius: 8px;
  border-left: 3px solid var(--accent-color, #8b5cf6);
}

/* ============================================================================
   Sections
   ============================================================================ */

.f1-help-section__title {
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #888);
  border-bottom: 1px solid var(--border-color, #333);
}

.f1-help-section__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ============================================================================
   Help Items (action + description)
   ============================================================================ */

.f1-help-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary, #1a1a2e);
  border-radius: 6px;
}

.f1-help-item__action {
  font-family: var(--font-mono, 'Menlo', monospace);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-color, #8b5cf6);
  flex-shrink: 0;
}

.f1-help-item__description {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-secondary, #aaa);
  text-align: right;
}

/* ============================================================================
   Tips Section
   ============================================================================ */

.f1-help-tips {
  background: var(--bg-secondary, #1a1a2e);
  border-radius: 8px;
  padding: 1rem;
}

.f1-help-tips .f1-help-section__title {
  color: var(--success-color, #4ade80);
}

.f1-help-tips ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.f1-help-tips li {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary, #aaa);
  margin-bottom: 0.25rem;
}

.f1-help-tips li:last-child {
  margin-bottom: 0;
}

/* ============================================================================
   Footer
   ============================================================================ */

.f1-help-modal__footer {
  display: flex;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color, #333);
  background: var(--bg-secondary, #1a1a2e);
  font-size: 0.8125rem;
  color: var(--text-muted, #888);
}

.f1-help-modal__footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  margin: 0 0.25rem;
  font-family: var(--font-mono, 'Menlo', monospace);
  font-size: 0.6875rem;
  color: var(--text-primary, #e5e5e5);
  background: var(--bg-tertiary, #252540);
  border: 1px solid var(--border-color, #333);
  border-radius: 3px;
}

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

@media (max-width: 640px) {
  .f1-help-modal {
    width: 95%;
    max-height: 90vh;
  }

  .f1-help-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }

  .f1-help-item__description {
    text-align: left;
    font-size: 0.8125rem;
  }
}
