/* Help System Styles - Interactive, animated, well-organized, searchable */

.help-modal {
  z-index: 10003 !important;
}

.help-modal-card {
  width: min(1400px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: helpModalSlideIn 0.3s ease;
}

@keyframes helpModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid #e5e7eb;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.help-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.help-header-left strong {
  font-size: 1.5rem;
  font-weight: 600;
}

.help-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
}

.help-close-btn {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  padding: 0.5rem !important;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-close-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: rotate(90deg);
  transition: transform 0.3s ease;
}

.help-modal-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

/* Search Container */
.help-search-container {
  position: relative;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.help-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #cbd5e1;
  border-radius: 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.help-search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.help-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 1.5rem;
  right: 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
  z-index: 10;
  display: none;
  animation: helpSearchResultsSlide 0.2s ease;
}

.help-search-results.active {
  display: block;
}

@keyframes helpSearchResultsSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.help-search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  width: 100%;
  text-align: left;
  border: none;
  background: white;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
}

.help-search-result-item:last-child {
  border-bottom: none;
}

.help-search-result-item:hover {
  background: #f8fafc;
}

.help-search-result-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.help-search-result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.help-search-result-title {
  font-weight: 600;
  color: #0f172a;
}

.help-search-result-section {
  font-size: 0.85rem;
  color: #64748b;
}

.help-search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: #64748b;
}

/* Content Wrapper */
.help-content-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.help-sidebar {
  width: 300px;
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
  overflow-y: auto;
  flex-shrink: 0;
}

.help-nav {
  padding: 1rem 0;
}

.help-nav-section {
  margin-bottom: 0.5rem;
}

.help-nav-section-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
  transition: background 0.2s ease;
  text-align: left;
}

.help-nav-section-header:hover {
  background: rgba(102, 126, 234, 0.1);
}

.help-nav-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.help-nav-title {
  flex: 1;
}

.help-nav-arrow {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  color: #64748b;
}

.help-nav-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.help-nav-section.expanded .help-nav-items {
  max-height: 2000px;
}

.help-nav-item {
  width: 100%;
  padding: 0.6rem 1.25rem 0.6rem 3.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: #475569;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
  position: relative;
}

.help-nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: #667eea;
  transition: height 0.2s ease;
}

.help-nav-item:hover {
  background: rgba(102, 126, 234, 0.08);
  padding-left: 3.75rem;
}

.help-nav-item.active {
  color: #667eea;
  font-weight: 600;
  background: rgba(102, 126, 234, 0.1);
  padding-left: 3.75rem;
}

.help-nav-item.active::before {
  height: 60%;
}

/* Main Content */
.help-main-content {
  flex: 1;
  overflow-y: auto;
  background: white;
}

.help-content-area {
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.help-welcome {
  text-align: center;
  padding: 3rem 2rem;
  animation: helpFadeIn 0.5s ease;
}

.help-welcome-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: helpBounce 2s ease infinite;
}

@keyframes helpBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes helpFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.help-welcome h1 {
  font-size: 2rem;
  color: #0f172a;
  margin-bottom: 1rem;
}

.help-welcome p {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 2rem;
}

.help-quick-links h3 {
  margin-bottom: 1rem;
  color: #0f172a;
}

.help-quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.help-quick-link {
  padding: 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.help-quick-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Content Item */
.help-content-item {
  animation: helpContentSlideIn 0.4s ease;
}

@keyframes helpContentSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.help-content-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.help-content-icon {
  font-size: 2.5rem;
  display: inline-block;
  margin-right: 0.75rem;
  vertical-align: middle;
  animation: helpIconPulse 2s ease infinite;
}

@keyframes helpIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.help-content-header h2 {
  display: inline-block;
  font-size: 2rem;
  color: #0f172a;
  margin: 0;
  vertical-align: middle;
}

.help-content-breadcrumb {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #64748b;
}

.help-content-body {
  line-height: 1.7;
  color: #334155;
}

.help-content-body p {
  margin-bottom: 1rem;
}

.help-content-body ul,
.help-content-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.help-content-body li {
  margin-bottom: 0.5rem;
}

.help-content-body strong {
  color: #0f172a;
  font-weight: 600;
}

/* Help Tip Cards */
.help-tip {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left: 4px solid #3b82f6;
  border-radius: 0.5rem;
  margin: 1rem 0;
  animation: helpTipSlide 0.5s ease;
}

@keyframes helpTipSlide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.help-warning {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-left: 4px solid #ef4444;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Steps List */
.help-steps {
  counter-reset: step-counter;
  list-style: none;
  padding-left: 0;
}

.help-steps li {
  counter-increment: step-counter;
  padding: 1rem 1rem 1rem 3rem;
  margin-bottom: 1rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border-left: 4px solid #667eea;
  position: relative;
  animation: helpStepFadeIn 0.4s ease;
  animation-delay: calc(var(--step-index, 0) * 0.1s);
  animation-fill-mode: both;
}

.help-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  background: #667eea;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

@keyframes helpStepFadeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Keyboard Shortcuts */
.help-keyboard-shortcut {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.help-keyboard-shortcut kbd {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0.25rem;
}

.help-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shortcut-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shortcut-item kbd {
  flex-shrink: 0;
}

.shortcut-item span {
  flex: 1;
  color: #475569;
}

/* Tips List */
.help-tips-list {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.tip-card {
  padding: 1.25rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 0.75rem;
  border: 1px solid #bae6fd;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: helpTipCardFadeIn 0.4s ease;
  animation-fill-mode: both;
}

.tip-card:nth-child(1) { animation-delay: 0.1s; }
.tip-card:nth-child(2) { animation-delay: 0.2s; }
.tip-card:nth-child(3) { animation-delay: 0.3s; }
.tip-card:nth-child(4) { animation-delay: 0.4s; }
.tip-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes helpTipCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tip-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.tip-card strong {
  display: block;
  font-size: 1.1rem;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.tip-card p {
  margin: 0;
  color: #475569;
}

/* Troubleshooting */
.help-troubleshooting {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.issue-item {
  padding: 1.25rem;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 0.5rem;
  animation: helpIssueSlide 0.4s ease;
  animation-fill-mode: both;
}

.issue-item:nth-child(1) { animation-delay: 0.1s; }
.issue-item:nth-child(2) { animation-delay: 0.2s; }
.issue-item:nth-child(3) { animation-delay: 0.3s; }
.issue-item:nth-child(4) { animation-delay: 0.4s; }
.issue-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes helpIssueSlide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.issue-item strong {
  display: block;
  color: #92400e;
  margin-bottom: 0.5rem;
}

.issue-item p {
  margin: 0;
  color: #78350f;
}

/* Feature Demo */
.help-feature-demo {
  animation: helpFadeIn 0.5s ease;
}

.help-shape-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.help-shape-list li {
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

/* Interface Map */
.help-interface-map {
  display: grid;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.interface-section {
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 0.75rem;
  border: 2px solid #e5e7eb;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: helpInterfaceSlide 0.4s ease;
  animation-fill-mode: both;
}

.interface-section:nth-child(1) { animation-delay: 0.1s; }
.interface-section:nth-child(2) { animation-delay: 0.2s; }
.interface-section:nth-child(3) { animation-delay: 0.3s; }

@keyframes helpInterfaceSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.interface-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.interface-section strong {
  display: block;
  font-size: 1.1rem;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.interface-section p {
  margin: 0;
  color: #475569;
}

/* Animation Demo */
.help-animation-demo {
  animation: helpFadeIn 0.6s ease;
}

/* Scrollbar Styling */
.help-sidebar::-webkit-scrollbar,
.help-main-content::-webkit-scrollbar,
.help-search-results::-webkit-scrollbar {
  width: 8px;
}

.help-sidebar::-webkit-scrollbar-track,
.help-main-content::-webkit-scrollbar-track,
.help-search-results::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.help-sidebar::-webkit-scrollbar-thumb,
.help-main-content::-webkit-scrollbar-thumb,
.help-search-results::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.help-sidebar::-webkit-scrollbar-thumb:hover,
.help-main-content::-webkit-scrollbar-thumb:hover,
.help-search-results::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .help-content-wrapper {
    flex-direction: column;
  }
  
  .help-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    max-height: 300px;
  }
  
  .help-quick-links-grid {
    grid-template-columns: 1fr;
  }
  
  .help-shortcuts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .help-modal-card {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .help-content-area {
    padding: 1rem;
  }
  
  .help-welcome {
    padding: 2rem 1rem;
  }
  
  .help-welcome h1 {
    font-size: 1.5rem;
  }
}
