/**
 * Styles for result display components
 * Used by resultDisplay.js for displaying audio metadata and expandable sections
 */

/* Clickable metadata elements */
.metadata-expandable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.metadata-expandable:hover {
  color: var(--btn-hover);
}

/* Clickable index display */
.index-clickable {
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.index-clickable:hover {
  background: rgba(40, 46, 61, 0.9);
  border-color: var(--accent);
}

/* Expanded metadata view - scrollable container for full text */
.metadata-expanded {
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 12px;
  background: rgba(36, 26, 20, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  max-height: 150px;
  overflow-y: auto;
  overflow-x: auto;
  word-break: break-all;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  white-space: pre-wrap;
  color: var(--text-dim);
  box-shadow: var(--shadow-sm);
}

/* Result component styles (from result.html) */
#result {
  margin-top: 24px;
  display: none;
}

#indexDisplay {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 12px;
  background: rgba(36, 26, 20, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

#positionInfo {
  margin: 16px 0;
  padding: 12px;
  background: rgba(36, 26, 20, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

#positionDisplay {
  margin-top: 8px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.position-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.position-row {
  display: flex;
  gap: 16px;
  min-width: 0;
}

.position-field {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.position-field strong {
  flex-shrink: 0;
  color: var(--text);
}

.position-value {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.position-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn-find-in-library {
  font-size: 13px;
  padding: 6px 14px;
}

#metadata {
  display: none;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(36, 26, 20, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

#coverImg {
  width: 128px;
  height: 128px;
  float: left;
  margin-right: 16px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}

.metadata-content {
  overflow: hidden;
}

.metadata-content > div {
  margin-bottom: 8px;
  color: var(--text-dim);
}

.metadata-content strong {
  color: var(--text);
  margin-right: 8px;
}

.metadata-clearfix {
  clear: both;
}

.audio-actions .play-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.similar-tracks-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* WaveSurfer.js waveform visualization container */
#waveformContainer {
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 0;
  background: rgba(15, 11, 8, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  height: 190px;
  cursor: pointer;
}

/* Override WaveSurfer.js default styles */
#waveformContainer wave {
  overflow: hidden !important;
}

.similar-tracks-status {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.similar-tracks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.similar-track-item {
  margin: 0;
}

.similar-track-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 14px;
}

.similar-track-index {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  color: var(--accent);
}

.similar-track-name {
  font-size: 13px;
  color: var(--text-dim);
}

#waveformDuration {
  display: none;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
  opacity: 0.75;
  margin: 0 2px 10px;
}
