/* DualAssemblyViewer Component Styles */

/* Main container */
.dualAssemblyViewer {
  margin: var(--spacing-lg) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background-elevated);
  box-shadow: var(--shadow-sm);
}

/* Header styles */
.header {
  display: flex;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.title {
  flex: 1;
  margin: 0;
  padding: var(--spacing-md);
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  border-right: 1px solid var(--color-border);
}

.title:last-child {
  border-right: none;
}

/* Assembly panel layout */
.assembliesContainer {
  display: flex;
  max-height: 1000px;
}

.assemblyPanel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.separator {
  width: 1px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* Common monospace elements */
.columnHeaders,
.assemblyContainer {
  font-family:
    "SF Mono", "Monaco", "Cascadia Code", "Roboto Mono", "Consolas",
    "Courier New", monospace;
}

/* Column headers */
.columnHeaders {
  display: flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-background);
  border-bottom: 2px solid var(--color-border);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  position: sticky;
  top: 0;
  z-index: 2;
}

.headerInsn {
  text-align: center;
  margin-right: var(--spacing-sm);
  flex-shrink: 0;
}

.headerInsn {
  min-width: 40px;
}

.headerAsm {
  flex-grow: 1;
  text-align: left;
}

/* Assembly container and scrollbar */
.assemblyContainer {
  flex: 1;
  overflow-y: auto;
  background: var(--color-background-input);
}

.assemblyContainer::-webkit-scrollbar {
  width: 8px;
}

.assemblyContainer::-webkit-scrollbar-track {
  background: var(--color-background);
  border-radius: var(--radius-sm);
}

.assemblyContainer::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-sm);
}

.assemblyContainer::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-light);
}

.assemblyContainer:focus-within {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* Assembly line base styles */
.assemblyLine {
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 0.8rem;
  line-height: 1.4;
  min-height: 1.6rem;
  transition: background-color var(--transition-fast);
}

.assemblyLine::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background-color var(--transition-normal);
}

.assemblyLine:last-child {
  border-bottom: none;
}

.assemblyLine:hover {
  background: var(--color-background-elevated);
}

.assemblyLine:hover::before {
  background: var(--color-primary);
}

/* Line number styles */
.lineNumber {
  color: var(--color-text-muted);
  user-select: none;
  text-align: right;
  flex-shrink: 0;
}

.lineNumber {
  min-width: 40px;
  margin-right: var(--spacing-md);
}

.lineContent {
  flex-grow: 1;
  white-space: pre;
}

/* Assembly line state modifiers */
.assemblyLine.highlighted {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
}

.assemblyLine.highlighted .lineNumber {
  color: var(--color-text-on-primary);
  opacity: 0.8;
}

.assemblyLine.emptyLine {
  background: var(--color-background-subtle);
  opacity: 0.3;
}

.assemblyLine.emptyLine:hover {
  background: var(--color-background-subtle);
}

.assemblyLine.contextLine {
  opacity: 0.6;
}

.assemblyLine.contextLine:hover {
  opacity: 0.8;
}

.assemblyLine.contextLine:hover::before {
  background: var(--color-border-light);
}

.emptyLine .lineNumber,
.emptyLine .lineContent {
  color: transparent;
}

.contextLine .lineNumber,
.contextLine .lineContent {
  color: var(--color-text-muted);
}

/* Line type indicators */
.identicalLine::before {
  background: #4caf50;
}

.differentLine::before {
  background: #ff9800;
}

/* Diff styling */
.opcode {
  font-weight: 600;
}

.arguments,
.argument {
  color: var(--color-text);
}

.branchDest {
  font-style: italic;
}

.diffOpcode,
.diffArguments,
.diffBranchDest {
  padding: 0.1em 0.2em;
  border-radius: var(--radius-sm);
}

.diffOpcode {
  color: #f44336;
  font-weight: 700;
}

.diffArguments {
  color: #f57700;
}

.diffBranchDest {
  color: #1976d2;
}

/* Responsive design */
@media (max-width: 1024px) {
  .assembliesContainer {
    flex-direction: column;
    max-height: 800px;
  }

  .separator {
    width: auto;
    height: 1px;
  }

  .header {
    flex-direction: column;
  }

  .title {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .title:last-child {
    border-bottom: none;
  }

  .assemblyPanel {
    min-height: 200px;
  }

  .columnHeaders {
    font-size: 0.65rem;
  }

  .headerInsn {
    min-width: 35px;
  }
}

@media (max-width: 768px) {
  .dualAssemblyViewer {
    margin: var(--spacing-md) 0;
  }

  .title {
    padding: var(--spacing-sm);
    font-size: 0.9rem;
  }

  .assemblyLine {
    font-size: 0.75rem;
    padding: var(--spacing-xs);
  }

  .assemblyPanel {
    min-height: 150px;
  }

  .columnHeaders {
    padding: var(--spacing-xs);
    font-size: 0.6rem;
  }

  .headerInsn {
    min-width: 30px;
  }

  .lineNumber {
    min-width: 35px;
  }

  .lineContent {
    font-size: 0.75rem;
  }
}
