/* ============================================================================
   HELP SYSTEM - help-system.css
   Contextual help tooltips and documentation links for PreRollTracker.

   Usage: <link rel="stylesheet" href="/static/help-system.css">
   Requires: polish-system.css loaded first for design token inheritance
   ============================================================================ */

/* --- Help Icon (inline ? button) --- */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #81C784;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Work Sans', sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  margin-left: 6px;
  position: relative;
  transition: all 0.2s ease;
  line-height: 1;
  flex-shrink: 0;
  /* Override inherited gradient text properties from parent headings */
  -webkit-text-fill-color: #81C784;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}

.help-tip:hover,
.help-tip:focus-visible {
  background: rgba(255, 255, 255, 0.25);
  color: #4CAF50;
  -webkit-text-fill-color: #4CAF50;
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.help-tip:focus-visible {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

/* --- Tooltip --- */
.help-tooltip {
  position: fixed;
  z-index: 10001;
  max-width: 280px;
  padding: 0.75rem 1rem;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.12);
  color: #f5f5f5;
  font-size: 0.85rem;
  font-family: 'Work Sans', sans-serif;
  line-height: 1.5;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.help-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.help-tooltip.above {
  transform: translateY(-4px);
}

.help-tooltip.above.visible {
  transform: translateY(0);
}

.help-tooltip-text {
  margin: 0 0 0.5rem 0;
  color: #f5f5f5;
}

.help-tooltip-link {
  display: inline-block;
  color: #4CAF50;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.help-tooltip-link:hover {
  color: #81C784;
}

.help-tooltip-link::after {
  content: ' \2192';
}

/* Mobile tap hint */
.help-tooltip-tap-hint {
  display: none;
  color: #888;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

@media (hover: none) and (pointer: coarse) {
  .help-tooltip-tap-hint {
    display: block;
  }
}

/* --- Global Nav Help Button --- */
.nav-help-btn {
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  min-width: unset;
}

/* --- First-Time Help Banner --- */
.help-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 9999;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  max-width: 500px;
  width: calc(100% - 2rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-family: 'Work Sans', sans-serif;
  color: #f5f5f5;
  font-size: 0.9rem;
  animation: helpBannerSlideUp 0.5s ease 1s forwards;
}

.help-banner-text {
  flex: 1;
  line-height: 1.5;
}

.help-banner-text a {
  color: #4CAF50;
  text-decoration: none;
  font-weight: 600;
}

.help-banner-text a:hover {
  color: #81C784;
}

.help-banner-dismiss {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #f5f5f5;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: 'Work Sans', sans-serif;
}

.help-banner-dismiss:hover {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes helpBannerSlideUp {
  to {
    transform: translateX(-50%) translateY(0);
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .help-tip,
  .help-tooltip,
  .help-banner {
    transition: none;
    animation: none;
  }
  .help-banner {
    transform: translateX(-50%) translateY(0);
  }
}
