/* Tutorial System Styles */

/* Tutorial Overlay */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  pointer-events: auto;
}

/* Tutorial Highlighted Element */
.tutorial-highlighted {
  position: relative;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85),
              0 0 20px 5px rgba(0, 191, 255, 0.8),
              inset 0 0 20px 2px rgba(0, 191, 255, 0.3);
  border-radius: 8px;
  animation: tutorial-pulse 2s ease-in-out infinite;
}

@keyframes tutorial-pulse {
  0%, 100% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85),
                0 0 20px 5px rgba(0, 191, 255, 0.8),
                inset 0 0 20px 2px rgba(0, 191, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85),
                0 0 30px 8px rgba(0, 255, 255, 1),
                inset 0 0 30px 4px rgba(0, 255, 255, 0.5);
  }
}

.tutorial-pulse {
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
  }
}

.tutorial-highlight {
  outline: 3px solid rgba(0, 191, 255, 0.8);
  outline-offset: 3px;
  background: rgba(0, 191, 255, 0.05) !important;
}

/* Tutorial Tooltip */
.tutorial-tooltip {
  position: fixed;
  max-width: 450px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid var(--accent-blue);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
              0 0 20px rgba(0, 191, 255, 0.3);
  z-index: 10002;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tutorial-tooltip.visible {
  opacity: 1;
  transform: scale(1);
}

.tutorial-tooltip.tooltip-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
}

.tutorial-tooltip.tooltip-center.visible {
  transform: translate(-50%, -50%) scale(1);
}

.tutorial-tooltip-content {
  padding: 0;
}

.tutorial-tooltip-header {
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(0, 123, 255, 0.2));
  border-bottom: 1px solid var(--accent-blue);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px 10px 0 0;
}

.tutorial-tooltip-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.tutorial-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.tutorial-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.tutorial-tooltip-body {
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.tutorial-tooltip-body p {
  margin: 0;
}

.tutorial-tooltip-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tutorial-progress {
  font-size: 12px;
  color: var(--text-muted);
}

.tutorial-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tutorial-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tutorial-btn-primary {
  background: var(--accent-blue);
  color: white;
}

.tutorial-btn-primary:hover {
  background: #0099ff;
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.5);
}

.tutorial-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.tutorial-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.tutorial-btn-skip {
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
}

.tutorial-btn-skip:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.tutorial-requirement {
  font-size: 12px;
  color: var(--accent-yellow);
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Help Modal */
#help-modal .modal-content {
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.help-modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text-primary);
}

.help-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.help-tab {
  padding: 8px 16px;
  background: var(--bg-panel-hover);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.help-tab:hover {
  background: rgba(0, 191, 255, 0.1);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.help-tab.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.help-content-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
}

.help-section {
  padding: 0;
}

.help-section h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  color: var(--accent-blue);
  border-bottom: 2px solid var(--accent-blue);
  padding-bottom: 8px;
}

.help-topic {
  background: var(--bg-panel-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.help-topic h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--text-primary);
}

.help-topic p {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.help-topic ul {
  margin: 8px 0 0 0;
  padding-left: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.help-topic li {
  margin: 4px 0;
}

.help-formula {
  background: rgba(0, 191, 255, 0.1);
  border-left: 3px solid var(--accent-blue);
  padding: 12px;
  margin: 12px 0;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--accent-blue);
}

.help-example {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  margin-top: 12px;
}

.help-example p {
  margin: 8px 0;
}

.help-result {
  color: var(--accent-green);
  font-weight: 600;
  font-size: 15px;
  margin-top: 12px !important;
}

/* Tutorials List */
.tutorials-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tutorial-card {
  background: var(--bg-panel-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
}

.tutorial-card:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(0, 191, 255, 0.2);
}

.tutorial-card.completed {
  border-color: var(--accent-green);
}

.tutorial-card.active {
  border-color: var(--accent-yellow);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.tutorial-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.tutorial-card h4 {
  margin: 0;
  font-size: 15px;
  color: var(--text-primary);
  flex: 1;
}

.tutorial-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.tutorial-card.completed .tutorial-status {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
}

.tutorial-card.active .tutorial-status {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-yellow);
}

.tutorial-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.tutorial-start-btn {
  width: 100%;
  padding: 8px;
  background: var(--accent-blue);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tutorial-start-btn:hover {
  background: #0099ff;
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.5);
}

.tutorial-card.completed .tutorial-start-btn {
  background: var(--bg-panel);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.tutorial-card.completed .tutorial-start-btn:hover {
  background: var(--bg-panel-hover);
  border-color: var(--accent-green);
  color: var(--text-primary);
  box-shadow: none;
}

/* FAQ Section */
.help-faq {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--bg-panel-hover);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-blue);
  border-radius: 8px;
  padding: 16px;
}

.faq-item h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: var(--accent-blue);
}

.faq-item p {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.faq-item p:last-child {
  margin-bottom: 0;
}

.faq-item ul {
  margin: 8px 0 0 0;
  padding-left: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.faq-item li {
  margin: 4px 0;
}

.help-error {
  color: var(--accent-red);
  text-align: center;
  padding: 40px;
  font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .tutorial-tooltip {
    max-width: 90vw;
    left: 5vw !important;
    right: 5vw !important;
  }

  .tutorials-list {
    grid-template-columns: 1fr;
  }

  .help-tabs {
    flex-wrap: wrap;
  }

  #help-modal .modal-content {
    max-width: 95vw;
  }
}
