/* Initiator Chain styles using CSS variables from App.module.css */

.chainContainer {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-md);
}

.chainHeader {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--color-primary);
}

.chainTitle {
  color: var(--color-text-highlight);
  font-size: var(--font-size-lg);
  font-weight: bold;
  margin: 0 0 var(--spacing-xs) 0;
}

.chainDescription {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: 0;
}

.noChain {
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  padding: var(--spacing-lg);
  background: var(--color-bg-light);
  border-radius: var(--radius-md);
}

/* Chain tree structure */
.chainTree {
  position: relative;
}

.chainNodeContainer {
  position: relative;
}

.chainNode {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  transition: all 0.2s ease;
}

.chainNode.selected .nodeContent {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}

.chainNode.selected .nodeUrl,
.chainNode.selected .nodeInfo {
  color: white;
}

.chainNode.selected .resourceType,
.chainNode.selected .initiatorType {
  color: rgba(255, 255, 255, 0.9);
}

/* Connection lines */
.nodeConnector {
  position: relative;
  width: 20px;
  height: 24px;
  flex-shrink: 0;
}

.verticalLine {
  position: absolute;
  left: -10px;
  top: -12px;
  width: 1px;
  height: 24px;
  background: var(--color-border);
}

.horizontalLine {
  position: absolute;
  left: -10px;
  top: 12px;
  width: 20px;
  height: 1px;
  background: var(--color-border);
}

/* Node content */
.nodeContent {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  flex: 1;
  transition: all 0.2s ease;
}

.nodeContent:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
}

.nodeIcon {
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.nodeDetails {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.nodeUrl {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nodeInfo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xs);
}

.resourceType {
  color: var(--color-primary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.initiatorType {
  color: var(--color-text-muted);
  font-style: italic;
}

.selectedIndicator {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Responsive design */
@media (max-width: 768px) {
  .chainContainer {
    padding: var(--spacing-md);
  }
  
  .chainNode {
    margin-left: 0 !important;
  }
  
  .nodeConnector {
    display: none;
  }
  
  .nodeContent {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }
  
  .nodeInfo {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }
  
  .selectedIndicator {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .chainHeader {
    margin-bottom: var(--spacing-md);
  }
  
  .nodeDetails {
    gap: 2px;
  }
  
  .nodeUrl {
    font-size: var(--font-size-sm);
  }
}