/* Narrative Loading Animation Styles */
.narrative-loading-container {
  width: 100%;
  margin-top: 20px;
  padding: 0;
}

/* Step Widget */
.narrative-step-widget {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInSlide 0.5s ease forwards;
}

@keyframes fadeInSlide {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.narrative-step-widget.in-progress {
  background: rgba(59, 130, 246, 0.03);
  border-color: rgba(59, 130, 246, 0.2);
}

.narrative-step-widget.completed {
  background: rgba(16, 185, 129, 0.03);
  border-color: rgba(16, 185, 129, 0.2);
}

/* Step Header */
.narrative-step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.step-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.narrative-step-widget.in-progress .step-icon {
  background: rgba(59, 130, 246, 0.1);
}

.narrative-step-widget.completed .step-icon {
  background: rgba(16, 185, 129, 0.1);
}

.step-icon img {
  width: 20px;
  height: 20px;
  opacity: 0.8;
  filter: brightness(0) saturate(100%) invert(100%);
}

.step-icon svg {
  width: 20px;
  height: 20px;
  stroke: rgba(255, 255, 255, 0.6);
}

.step-info {
  flex: 1;
}

.step-source {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
}

.step-message {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.step-count {
  font-size: 24px;
  font-weight: 700;
  color: rgba(59, 130, 246, 0.8);
  min-width: 60px;
  text-align: right;
}

.narrative-step-widget.completed .step-count {
  color: rgba(16, 185, 129, 0.8);
}

/* Progress Bar */
.narrative-step-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-bar-container {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  border-radius: 3px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.narrative-step-widget.completed .progress-bar {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-percentage {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  min-width: 45px;
  text-align: right;
}

/* Step Details */
.narrative-step-details {
  display: flex;
  gap: 24px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-top: 12px;
}

.detail-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.sentiment-bullish {
  color: #10b981 !important;
}

.sentiment-neutral {
  color: #f59e0b !important;
}

.sentiment-mixed {
  color: #8b5cf6 !important;
}

/* Overall Progress */
.narrative-overall-container {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
}

.narrative-overall-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.narrative-overall-title {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.narrative-overall-percentage {
  font-size: 18px;
  font-weight: 600;
  color: #3b82f6;
}

.narrative-overall-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.narrative-overall-progress {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Animations */
.narrative-step-widget {
  animation-delay: calc(var(--step-index) * 0.1s);
}

/* Activity Details */
.step-activity-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.activity-detail-item {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 4px 8px;
  transition: all 0.2s ease;
}

.activity-detail-item:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Graph Visualization */
.narrative-mini-graph {
  width: 100%;
  height: 60px;
  margin-top: 12px;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  overflow: hidden;
}

.narrative-mini-graph canvas {
  width: 100%;
  height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
  .narrative-step-header {
    flex-wrap: wrap;
  }
  
  .step-count {
    width: 100%;
    text-align: left;
    margin-top: 8px;
    font-size: 20px;
  }
  
  .narrative-step-details {
    flex-direction: column;
    gap: 12px;
  }
}