/**
 * Conversation Stages Panel - MiTerrenoMX Light Theme
 */

.conversation-stages-panel {
  position: static;
  width: 280px;
  background: #fff;
  border-left: 1px solid #E8D5B8;
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

.stages-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #E8D5B8;
}

.stages-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #3D1F08;
  margin: 0;
  font-family: 'Playfair Display', serif;
}

.stages-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #8B7355;
  transition: color 0.2s;
  display: none;
}

.stages-toggle-btn:hover {
  color: #3D1F08;
}

.stages-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stage-item {
  position: relative;
  padding-left: 32px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

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

.stage-item::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 24px;
  width: 2px;
  height: calc(100% + 4px);
  background: #E8D5B8;
}

.stage-item:last-child::before {
  display: none;
}

.stage-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #E8D5B8;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1;
}

.stage-item.completed .stage-indicator {
  border-color: #8B4513;
  background: #8B4513;
}

.stage-item.active .stage-indicator {
  border-color: #C4783A;
  background: #C4783A;
  box-shadow: 0 0 0 4px rgba(196, 120, 58, 0.2);
  animation: pulse 2s infinite;
}

.stage-item.completed .stage-indicator::after {
  content: '\2713';
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

.stage-item.active .stage-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}

.stage-content {
  padding-top: 2px;
}

.stage-name {
  font-size: 12px;
  font-weight: 500;
  color: #8B7355;
  margin-bottom: 2px;
  transition: color 0.3s ease;
  font-family: 'DM Sans', sans-serif;
}

.stage-item.active .stage-name {
  color: #C4783A;
  font-weight: 600;
}

.stage-item.completed .stage-name {
  color: #8B4513;
}

.stage-description {
  font-size: 11px;
  color: #8B7355;
  line-height: 1.4;
  display: none;
  font-family: 'DM Sans', sans-serif;
}

.stage-item.active .stage-description {
  display: block;
  color: #5C2D0A;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(196, 120, 58, 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(196, 120, 58, 0.1);
  }
}

/* Scrollbar */
.conversation-stages-panel::-webkit-scrollbar {
  width: 4px;
}
.conversation-stages-panel::-webkit-scrollbar-track {
  background: transparent;
}
.conversation-stages-panel::-webkit-scrollbar-thumb {
  background: #E8D5B8;
  border-radius: 2px;
}

/* Responsive */
@media (max-width: 1200px) {
  .conversation-stages-panel {
    width: 220px;
  }
  .stage-item {
    margin-bottom: 16px;
  }
}

@media (max-width: 768px) {
  .conversation-stages-panel {
    display: none;
  }
}

/* Mobile stage indicator (prev / current / next) shown next to the agent name */
.mobile-stage-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid #E8D5B8;
  white-space: nowrap;
  overflow: hidden;
}

.mobile-stage-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E8D5B8;
}

.mobile-stage-dot-prev {
  background: #8B4513;
  opacity: 0.5;
}

.mobile-stage-dot-next {
  background: #E8D5B8;
}

.mobile-stage-current {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.mobile-stage-dot-current {
  width: 8px;
  height: 8px;
  background: #C4783A;
  box-shadow: 0 0 0 3px rgba(196, 120, 58, 0.2);
}

.mobile-stage-current-label {
  font-size: 11px;
  font-weight: 600;
  color: #C4783A;
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

@media (min-width: 992px) {
  .mobile-stage-indicator {
    display: none !important;
  }
}
