/* ========================================
   OVERLAY COMPONENT STYLES
   Full-screen overlay panels (replaces dialogs)
   ======================================== */

/* Base Overlay */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.overlay.visible {
    display: block;
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.overlay-container {
    position: absolute;
    inset: 5%;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.overlay-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-header);
    margin: 0;
}

.overlay-header .close-button {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.overlay-header .close-button:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.overlay-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.overlay-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.overlay-footer .footer-right-buttons {
    display: flex;
    gap: 8px;
}

/* Share Status Label */
.share-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.share-status .share-icon {
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.share-status .share-icon:hover {
    background: var(--bg-card);
}

.share-status .share-label {
    color: var(--text-muted);
}

.share-status .share-url {
    color: var(--accent);
    text-decoration: none;
}

.share-status .share-url:hover {
    text-decoration: underline;
}

.share-status .btn-link {
    padding: 2px 6px;
    color: var(--text-muted);
    font-size: 14px;
}

.share-status .btn-link:hover {
    color: var(--text-primary);
}

/* Overlay Loading State */
.overlay-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    flex: 1;
}

.overlay-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.overlay-loading p {
    color: var(--text-primary);
    font-size: 14px;
    margin: 0;
}

.overlay-loading .progress-text {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}


/* ========================================
   QUALITY TEST TWO-PANEL LAYOUT
   ======================================== */
.quality-panels {
    display: none;
    flex: 1;
    overflow: hidden;
}

.quality-panels.visible {
    display: grid;
    grid-template-columns: 350px 1fr;
}

.quality-list-panel,
.quality-detail-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0; /* Task 13: Prevent grid items from overflowing and squishing siblings */
}

.quality-list-panel {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
}

.quality-detail-panel {
    background: var(--bg-primary);
}

.quality-list-panel .panel-header,
.quality-detail-panel .panel-header {
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.quality-list-panel .panel-header h2,
.quality-detail-panel .panel-header h2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-header);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-controls {
    padding: 12px 16px 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.quality-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.quality-stats .stat-item {
    text-align: center;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.quality-stats .stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.quality-stats .stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}

.quality-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quality-filter label {
    font-size: 12px;
    color: var(--text-secondary);
}

.quality-filter select {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.quality-list-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 12px 12px;
}

.quality-detail-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Results List Items */
.quality-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quality-result-item {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quality-result-item:hover {
    border-color: var(--accent);
}

.quality-result-item.selected {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.quality-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-result-header .response-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    margin-right: 10px;
    accent-color: var(--accent);
}

.quality-result-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}

.quality-result-scores {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Quality Badge Styles */
.quality-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    width: 70px;
    display: inline-block;
    text-align: center;
}

.quality-badge.strong {
    background: #10b981;
    color: white;
}

.quality-badge.average {
    background: #f59e0b;
    color: white;
}

.quality-badge.weak {
    background: #ef4444;
    color: white;
}

/* Quality Dropdown Styles (Task #33) */
.quality-dropdown {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    width: 90px;
    display: inline-block;
    text-align: left;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px;
    padding-right: 24px;
}

.quality-dropdown.strong {
    background-color: #10b981;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8l-4-4h8z'/%3E%3C/svg%3E");
    color: white;
}

.quality-dropdown.average {
    background-color: #f59e0b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8l-4-4h8z'/%3E%3C/svg%3E");
    color: white;
}

.quality-dropdown.weak {
    background-color: #ef4444;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8l-4-4h8z'/%3E%3C/svg%3E");
    color: white;
}

.quality-dropdown:hover {
    opacity: 0.9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.quality-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Dropdown option styling */
.quality-dropdown option {
    background: white;
    color: #1f2937;
    font-weight: 600;
    padding: 8px;
}

/* Detail Panel Content */
.quality-detail-content {
    height: 100%;
}

.quality-detail-content .empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
}

.quality-detail-content .detail-loaded {
    padding: 4px;
}

.quality-detail-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-header);
    margin: 0 0 12px 0;
}

.quality-detail-content h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 8px 0;
}

.quality-detail-content h5 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 12px 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Detail Content Styles */
.quality-response-text {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Editable Response Styles (Task #33) */
.quality-response-text.editable-response {
    cursor: text;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
}

.quality-response-text.editable-response:hover {
    border-color: var(--accent);
    background: var(--bg-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}

.quality-response-text.editable-response:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Visual indicator that field is editable */
.quality-response-text.editable-response::after {
    content: '✎';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.quality-response-text.editable-response:hover::after,
.quality-response-text.editable-response:focus::after {
    opacity: 0.6;
}


/* Panel scrollbar styling */
.panel-content {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.panel-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    .quality-response-text {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    .quality-detail-content h5,
    .quality-detail-content h6 {
        color: var(--text-primary) !important;
    }
}

/* ========================================================================
   Quality Editor Slide-out
   ======================================================================== */

/* Container and visibility */
.quality-editor-slideout {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
}

.quality-editor-slideout.closing {
    pointer-events: none;
}

/* Backdrop overlay */
.quality-editor-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    animation: fadeIn 300ms ease-out;
}

.quality-editor-slideout.closing .quality-editor-backdrop {
    animation: fadeOut 300ms ease-out;
}

/* Slide-out panel */
.quality-editor-container {
    position: relative;
    width: 600px;
    max-width: 100%;
    background: var(--bg-primary);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideInRight 300ms ease-out;
    z-index: 1;
}

.quality-editor-slideout.closing .quality-editor-container {
    animation: slideOutRight 300ms ease-out;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Header */
.quality-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.quality-editor-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.quality-editor-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.quality-editor-header .close-button {
    font-size: 32px;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    margin: -4px -4px 0 16px;
    flex-shrink: 0;
}

/* Body */
.quality-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Form styling */
#quality-editor-form fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

#quality-editor-form fieldset:last-of-type {
    margin-bottom: 0;
}

#quality-editor-form legend {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-group .field-note {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input[readonly] {
    background: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group textarea.textarea-medium {
    min-height: 100px;
    resize: vertical;
}

.form-group textarea.textarea-large {
    min-height: 200px;
    resize: vertical;
}

/* Feedback indicator badge */
.feedback-indicator {
    display: inline-block;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    margin-left: 8px;
    padding: 2px 6px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 3px;
}


/* Footer */
.quality-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

#quality-editor-save-btn .btn-spinner {
    display: none;
}

#quality-editor-save-btn.saving .btn-text {
    display: none;
}

#quality-editor-save-btn.saving .btn-spinner {
    display: inline;
}

/* Messages */
#quality-editor-error,
#quality-editor-success {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
}

#quality-editor-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

#quality-editor-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3a3;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .quality-editor-container {
        width: 60vw;
    }
}

@media (max-width: 900px) {
    .quality-editor-container {
        width: 80vw;
    }
}

@media (max-width: 600px) {
    .quality-editor-container {
        width: 100vw;
    }

    .quality-editor-header {
        padding: 16px;
    }

    .quality-editor-body {
        padding: 16px;
    }

    .quality-editor-footer {
        padding: 16px;
        flex-direction: column;
    }

    .quality-editor-footer button {
        width: 100%;
    }
}

/* Dark mode compatibility */

[data-theme="dark"] #quality-editor-error {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.3);
    color: #ff8888;
}

[data-theme="dark"] #quality-editor-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #6ee7b7;
}

/* ========================================================================
   Diff View Component - Show old vs new field values
   ======================================================================== */

/* Diff View Container */
.diff-view-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.diff-view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.diff-view-header h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.diff-view-description {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.keyboard-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.keyboard-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
    line-height: 1.2;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.diff-view-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-primary);
}

.diff-view-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Empty state when no changes */
.diff-view-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.diff-view-empty h3 {
    font-size: 18px;
    margin: 0 0 12px 0;
    color: var(--text-secondary);
}

.diff-view-empty p {
    font-size: 14px;
    margin: 0;
}

/* Individual Diff Item */
.diff-item {
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.diff-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.diff-item.accepted {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
    animation: acceptPulse 0.4s ease-out;
}

.diff-item.rejected {
    border-color: var(--border);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

@keyframes acceptPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
    }
}

.diff-item-header {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diff-item-field-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.diff-item-field-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-primary);
    padding: 3px 8px;
    border-radius: 4px;
}

.diff-item-status {
    display: flex;
    gap: 8px;
}

.diff-status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    animation: slideInFromRight 0.3s ease-out;
}

.diff-status-badge.accepted {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.diff-status-badge.rejected {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.diff-item-body {
    padding: 20px;
}

/* OLD and NEW value sections */
.diff-value-container {
    margin-bottom: 16px;
}

.diff-value-container:last-of-type {
    margin-bottom: 0;
}

.diff-value-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diff-value-label.old {
    color: #64748b;
}

.diff-value-label.new {
    color: #f59e0b;
}

.diff-value-content {
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.diff-value-content.old {
    background: var(--bg-secondary);
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.8;
}

.diff-value-content.new {
    background: rgba(245, 158, 11, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-weight: 500;
}

/* Rationale section */
.diff-rationale {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
}

.diff-rationale-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #3b82f6;
    margin-bottom: 6px;
}

.diff-rationale-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

/* Action buttons */
.diff-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.btn-diff-accept,
.btn-diff-reject {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-diff-accept {
    background: #10b981;
    color: white;
}

.btn-diff-accept:hover:not(:disabled) {
    background: #059669;
}

.btn-diff-accept:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-diff-reject {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-diff-reject:hover:not(:disabled) {
    background: var(--bg-primary);
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Footer */
.diff-view-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.diff-view-summary {
    font-size: 13px;
    color: var(--text-secondary);
}

.diff-view-summary span {
    font-weight: 600;
    color: var(--text-primary);
}

.diff-view-actions {
    display: flex;
    gap: 12px;
}

/* Scrollbar styling for diff view */
.diff-view-body {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.diff-view-body::-webkit-scrollbar {
    width: 10px;
}

.diff-view-body::-webkit-scrollbar-track {
    background: transparent;
}

.diff-view-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

.diff-view-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .diff-item:hover {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    }

    .diff-item.accepted {
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    }

    .diff-value-content.old {
        background: var(--bg-primary);
        opacity: 0.6;
    }

    .diff-value-content.new {
        background: rgba(245, 158, 11, 0.15);
        border-color: rgba(245, 158, 11, 0.4);
    }

    .diff-rationale {
        background: rgba(59, 130, 246, 0.12);
        border-left-color: #60a5fa;
    }

    .diff-status-badge.accepted {
        background: rgba(16, 185, 129, 0.25);
        color: #34d399;
    }

    .diff-status-badge.rejected {
        background: rgba(148, 163, 184, 0.25);
        color: #94a3b8;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .diff-view-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .diff-view-header h2 {
        font-size: 18px;
    }

    .diff-view-header button {
        align-self: stretch;
        width: 100%;
    }

    .diff-view-body {
        padding: 12px;
    }

    .diff-item {
        margin-bottom: 16px;
    }

    .diff-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }

    .diff-item-body {
        padding: 16px;
    }

    .diff-item-actions {
        flex-direction: column;
    }

    .diff-item-actions button {
        width: 100%;
    }

    .diff-view-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 16px;
    }

    .diff-view-summary {
        text-align: center;
    }

    .diff-view-actions {
        width: 100%;
        flex-direction: column;
    }

    .diff-view-actions button {
        width: 100%;
    }
}

/* ========================================
   SAMPLE RESPONSES EDITOR
   Task 11: Persist AI-generated responses
   ======================================== */

.sample-response-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.sample-response-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sample-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sample-response-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.sample-response-quality {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.sample-response-quality.strong {
    background: rgba(34, 197, 94, 0.1);
    color: rgb(34, 197, 94);
}

.sample-response-quality.average {
    background: rgba(234, 179, 8, 0.1);
    color: rgb(234, 179, 8);
}

.sample-response-quality.weak {
    background: rgba(239, 68, 68, 0.1);
    color: rgb(239, 68, 68);
}

.sample-response-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    font-size: 13px;
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.sample-response-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.sample-response-textarea.edited {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.05);
}

.sample-response-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.sample-response-actions .btn {
    font-size: 11px;
    padding: 6px 12px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sample-response-item {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    .sample-response-item:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .sample-response-quality.strong {
        background: rgba(34, 197, 94, 0.2);
        color: rgb(74, 222, 128);
    }

    .sample-response-quality.average {
        background: rgba(234, 179, 8, 0.2);
        color: rgb(250, 204, 21);
    }

    .sample-response-quality.weak {
        background: rgba(239, 68, 68, 0.2);
        color: rgb(248, 113, 113);
    }
}
