/* Diff Checker Styles */

.diff-container {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  gap: 1rem;
}

.diff-input-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  flex: 0 0 40%;
  min-height: 0;
}

.diff-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.diff-result-card {
  flex: 1;
  min-height: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.panel-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.header-buttons {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.btn-small {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: white;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-small:hover {
  background: #f1f5f9;
}

/* Input textareas */
.diff-textarea {
  width: 100%;
  flex: 1;
  padding: 1rem;
  border: none;
  font-size: 0.8125rem;
  font-family: 'Courier New', monospace;
  resize: none;
  line-height: 1.6;
  outline: none;
}

/* Diff result */
.diff-result {
  flex: 1;
  overflow: auto;
}

.diff-empty {
  padding: 2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.diff-identical {
  padding: 2rem;
  text-align: center;
  color: var(--success-color);
  font-size: 0.875rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Side-by-side table */
.diff-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.diff-row {
  border-bottom: 1px solid #f1f5f9;
}

.diff-num {
  width: 40px;
  text-align: right;
  padding: 0 0.5rem;
  color: #94a3b8;
  user-select: none;
  vertical-align: top;
  white-space: nowrap;
}

.diff-num-old {
  border-right: 1px solid var(--border-color);
}

.diff-num-new {
  border-left: 2px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.diff-content {
  padding: 0 0.75rem;
  vertical-align: top;
  white-space: pre;
  overflow-x: auto;
}

/* Equal rows */
.diff-row-equal {
  background: transparent;
}

/* Pure removal: left side red, right side empty */
.diff-row-remove .diff-num-old,
.diff-row-remove .diff-content-old {
  background-color: #fee2e2;
}

.diff-row-remove .diff-num-old {
  color: #991b1b;
}

.diff-row-remove .diff-content-new,
.diff-row-remove .diff-num-new {
  background-color: #fafafa;
}

/* Pure addition: left side empty, right side green */
.diff-row-add .diff-num-new,
.diff-row-add .diff-content-new {
  background-color: #dcfce7;
}

.diff-row-add .diff-num-new {
  color: #166534;
}

.diff-row-add .diff-content-old,
.diff-row-add .diff-num-old {
  background-color: #fafafa;
}

/* Change rows: light tint on both sides */
.diff-row-change .diff-num-old,
.diff-row-change .diff-content-old {
  background-color: #fee2e2;
}

.diff-row-change .diff-num-old {
  color: #991b1b;
}

.diff-row-change .diff-num-new,
.diff-row-change .diff-content-new {
  background-color: #dcfce7;
}

.diff-row-change .diff-num-new {
  color: #166534;
}

/* Word-level highlights (darker tint within changed lines) */
.diff-word-del {
  background-color: #fca5a5;
  border-radius: 2px;
}

.diff-word-add {
  background-color: #86efac;
  border-radius: 2px;
}

/* Stats */
.diff-stats {
  font-size: 0.75rem;
  color: var(--text-light);
}

.diff-stats .stat-add {
  color: #166534;
  font-weight: 600;
}

.diff-stats .stat-remove {
  color: #991b1b;
  font-weight: 600;
}

.diff-stats .stat-change {
  color: #9333ea;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .diff-container {
    height: auto;
  }

  .diff-input-layout {
    grid-template-columns: 1fr;
    flex: none;
  }

  .diff-textarea {
    min-height: 120px;
  }

  .diff-result-card {
    min-height: 300px;
  }
}
