/**
 * Schema Diff Mode Styles
 */

.diff-layout {
    display: grid;
    grid-template-columns: 200px 1fr 260px;
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: calc(100vh - 200px);
}

.diff-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    cursor: pointer;
}

.diff-options input {
    accent-color: #6366F1;
}

.stats-list dd.added {
    color: #059669;
}

.stats-list dd.removed {
    color: #DC2626;
}

.stats-list dd.changed {
    color: #D97706;
}

.stats-list dd.breaking {
    color: #DC2626;
    font-weight: 700;
}

.diff-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.action-btn {
    padding: 0.5rem;
    border: 1px solid var(--border-light, #E5E7EB);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #F3F4F6;
}

.action-btn.primary {
    background: #6366F1;
    color: white;
    border-color: #6366F1;
}

.action-btn.primary:hover {
    background: #4F46E5;
}

/* Main Diff Area */
.schema-main {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-light, #E5E7EB);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.diff-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-light, #E5E7EB);
    flex: 1;
    min-height: 200px;
}

.panel {
    background: white;
    display: flex;
    flex-direction: column;
}

.left-panel {
    border-right: 1px solid var(--border-light, #E5E7EB);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light, #E5E7EB);
    background: var(--paper-sand, #FDFBF7);
}

.panel-header h3 {
    margin: 0;
    font-size: 0.875rem;
}

.panel-header input[type="file"] {
    font-size: 0.6875rem;
    max-width: 120px;
}

.panel-body {
    flex: 1;
    display: flex;
}

.panel-body textarea {
    width: 100%;
    height: 100%;
    min-height: 150px;
    padding: 1rem;
    border: none;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    line-height: 1.5;
    resize: none;
}

/* Diff Results */
.diff-results {
    border-top: 1px solid var(--border-light, #E5E7EB);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light, #E5E7EB);
    background: var(--paper-sand, #FDFBF7);
}

.results-header h3 {
    margin: 0;
    font-size: 0.875rem;
}

.legend {
    display: flex;
    gap: 1rem;
    font-size: 0.6875rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.legend-item.added {
    color: #059669;
}

.legend-item.removed {
    color: #DC2626;
}

.legend-item.changed {
    color: #D97706;
}

#results-body {
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary, #6B7280);
}

.no-diff {
    text-align: center;
    padding: 1.5rem;
    color: #059669;
}

.diff-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.diff-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.diff-item.added {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
}

.diff-item.removed {
    background: #FEF2F2;
    border: 1px solid #FECACA;
}

.diff-item.changed {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
}

.diff-item.breaking {
    border-width: 2px;
}

.diff-item.added.breaking {
    border-color: #059669;
}

.diff-item.removed.breaking {
    border-color: #DC2626;
}

.diff-item.changed.breaking {
    border-color: #D97706;
}

.diff-item:hover {
    opacity: 0.9;
}

.diff-item.selected {
    box-shadow: 0 0 0 2px #6366F1;
}

.diff-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.diff-item.added .diff-icon {
    background: #059669;
    color: white;
}

.diff-item.removed .diff-icon {
    background: #DC2626;
    color: white;
}

.diff-item.changed .diff-icon {
    background: #D97706;
    color: white;
}

.diff-content {
    flex: 1;
    min-width: 0;
}

.diff-path {
    display: block;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    margin-bottom: 0.125rem;
}

.diff-item.added .diff-path { color: #059669; }
.diff-item.removed .diff-path { color: #DC2626; }
.diff-item.changed .diff-path { color: #D97706; }

.diff-summary {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-primary, #1F2937);
}

.breaking-badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    background: #DC2626;
    color: white;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Context Panel */
#change-detail {
    background: var(--paper-sand, #FDFBF7);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-light, #E5E7EB);
}

#change-detail.hidden {
    display: none;
}

#change-detail h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #6B7280);
    margin: 0 0 0.75rem 0;
}

.change-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.change-type.added {
    background: #D1FAE5;
    color: #065F46;
}

.change-type.removed {
    background: #FEE2E2;
    color: #DC2626;
}

.change-type.changed {
    background: #FEF3C7;
    color: #92400E;
}

#change-detail dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
    font-size: 0.8125rem;
}

#change-detail dt {
    color: var(--text-secondary, #6B7280);
}

#change-detail dd {
    margin: 0;
    word-break: break-word;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 1024px) {
    .diff-layout {
        grid-template-columns: 1fr;
    }

    .schema-sidebar,
    .schema-context {
        display: none;
    }

    .diff-panels {
        grid-template-columns: 1fr;
    }
}
