/* STEM Embedding Animation Styles */
.stem-demo-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.stem-flow {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  padding-bottom: 10px;
}

.stem-input-box {
  background: #f0f7ff;
  border: 2px solid #4b6cb7;
  border-radius: 8px;
  padding: 15px;
  width: 100%;
  max-width: 500px;
  font-size: 13px;
  line-height: 1.5;
  color: #333;
  transition: all 0.8s ease;
  position: relative;
  margin-bottom: 25px;
}

.stem-input-box::after {
  content: "✓ Input text stays the same";
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #274c9b;
  font-style: italic;
  font-weight: 700;
  white-space: nowrap;
  background: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(39, 76, 155, 0.15);
}

.stem-process {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

.stem-token {
  background: #e8f0fe;
  border: 2px solid #4b6cb7;
  border-radius: 6px;
  padding: 10px 15px;
  font-weight: 600;
  color: #2a63b2;
  position: relative;
  transition: all 0.6s ease;
}

@keyframes pulse-change {
  0%, 100% { 
    transform: scale(1);
  }
  50% { 
    transform: scale(1.05);
  }
}

.stem-arrow {
  font-size: 24px;
  color: #4b6cb7;
  animation: arrow-pulse 1.5s ease-in-out infinite;
}

@keyframes arrow-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(5px); }
}

.stem-output-box {
  background: #f0f7ff;
  border: 2px solid #4b6cb7;
  border-radius: 8px;
  padding: 15px;
  width: 100%;
  max-width: 500px;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  min-height: 120px;
  transition: all 0.8s ease;
}

.stem-output-box.changing {
  animation: output-change 3s ease-in-out infinite;
}

.stem-output-box.spain-mode {
  background: #fffbf0;
  border-color: #ffc107;
}

.stem-output-box.germany-mode {
  background: #f0fdf4;
  border-color: #22c55e;
}

@keyframes output-change {
  0%, 100% { 
    transform: scale(1);
  }
  50% { 
    transform: scale(1.02);
  }
}

.stem-output-text {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.stem-output-text.fade-out {
  opacity: 0;
}

.stem-label {
  font-size: 11px;
  color: #666;
  text-align: center;
  margin-top: 5px;
  font-style: italic;
}

.stem-switch-indicator {
  display: inline-block;
  padding: 5px 10px;
  background: #4b6cb7;
  color: white;
  border-radius: 4px;
  font-size: 11px;
  margin-top: 10px;
  animation: indicator-pulse 2s ease-in-out infinite;
  transition: all 0.6s ease;
}

/* FFN Layer Visualization */
.stem-ffn-visualization {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 25px 0;
  padding: 20px;
  position: relative;
}

.stem-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stem-bar {
  width: 80px;
  height: 50px;
  background: rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease;
  opacity: 0.5;
}

.stem-bar.active {
  background: rgba(255, 193, 7, 0.25);
  border-color: #ffc107;
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.stem-bar#stem-bar-germany {
  width: 100px;
  height: 60px;
}

.stem-bar#stem-bar-germany.active {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(21, 128, 61, 0.8);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.3);
}

.stem-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

.stem-bar.active .stem-bar-label {
  color: #111;
  font-weight: 700;
}

.stem-bar-arrow {
  color: rgba(0, 0, 0, 0.2);
  transition: all 0.5s ease;
  opacity: 0.3;
}

.stem-bar-arrow.active {
  color: #ffc107;
  opacity: 1;
}

.stem-bar-arrow#arrow-germany.active {
  color: rgba(21, 128, 61, 0.9);
}

.stem-ffn-box {
  width: 200px;
  height: 120px;
  background: #ffffff;
  border: 3px solid #4b6cb7;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(75, 108, 183, 0.15);
  position: relative;
}

.stem-ffn-label {
  font-size: 14px;
  font-weight: 700;
  color: #4b6cb7;
  text-align: center;
}

@keyframes indicator-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

