/* src/styles/auditTrail.css - Reusable Audit Trail Styles */

.audit-trail-container {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  transition: var(--transition-fast);
}

.audit-trail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.audit-trail-header.clickable {
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  margin: -0.25rem;
  transition: var(--transition-fast);
}

.audit-trail-header.clickable:hover {
  background-color: var(--color-bg-tertiary);
}

.audit-trail-title {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.audit-icon {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.audit-icon-gradient {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.audit-icon h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
}

.audit-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stat-time {
  background-color: var(--color-accent);
}

.toggle-icon {
  transition: transform var(--transition-medium);
  color: var(--color-text-secondary);
}

.audit-trail-details {
  display: block;
  transition: all var(--transition-medium);
  overflow: hidden;
}

.audit-trail-details.collapsed {
  display: none;
}

.audit-summary {
  background-color: var(--color-bg-tertiary);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.summary-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-stat {
  text-align: center;
}

.summary-value {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.summary-value.success {
  color: var(--color-accent);
}

.summary-value.warning {
  color: var(--color-warning);
}

.summary-label {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
}

.insights-section {
  margin-top: 0.75rem;
}

.insights-header {
  font-size: 0.6875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.insights-header.success {
  color: var(--color-accent);
}

.insights-header.warning {
  color: var(--color-warning);
}

.insights-list {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.625rem;
  line-height: 1.4;
}

.insights-list li {
  margin-bottom: 0.25rem;
}

.audit-process-flow {
  display: grid;
  gap: 1rem;
}

.phase-group {
  position: relative;
}

.phase-group:not(.last-phase)::after {
  content: '';
  position: absolute;
  left: 13px;
  bottom: -8px;
  width: 2px;
  height: 16px;
  background: linear-gradient(to bottom, var(--color-border) 0%, transparent 100%);
}


.phase-icon {
  font-size: 1rem;
}

.phase-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.phase-divider {
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}

.phase-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.confidence-bar {
  width: 48px;
  height: 8px;
  background-color: var(--color-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.confidence-text {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  min-width: 28px;
}

.phase-entries {
  margin-left: 1.5rem;
  display: grid;
  gap: 0.5rem;
}

.audit-entry {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  transition: var(--transition-fast);
}

.audit-entry:hover {
  background-color: var(--color-bg-secondary);
}

.entry-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.entry-action {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.confidence-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.confidence-value {
  min-width: 28px;
  text-align: right;
}

.processing-time {
  min-width: 40px;
  text-align: right;
}

.entry-details {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.detail-item {
  margin-bottom: 0.25rem;
  word-break: break-word;
}

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

.technical-toggle {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.technical-toggle-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  transition: var(--transition-fast);
}

.technical-toggle-btn:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
}

.technical-details {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
  transition: all var(--transition-medium);
}

.technical-details.collapsed {
  display: none;
}

.technical-entry {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-size: 0.75rem;
}

.technical-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.technical-phase {
  font-weight: 600;
  color: var(--color-primary);
}

.technical-time {
  color: var(--color-text-secondary);
}

.technical-content {
  display: grid;
  gap: 0.375rem;
}

.technical-row {
  color: var(--color-text-secondary);
  word-break: break-word;
}

/* Responsive Design */
@media (width <= 768px) {
  .audit-stats {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .phase-divider {
    display: none;
  }

  .entry-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .technical-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}