/* ============================================
   Slip Compare - Tool Page Styles
   White theme with orange/red accents
   ============================================ */

.tool-page {
    background: var(--bg-primary);
}

.tool-main {
    min-height: calc(100vh - 80px);
    padding: calc(80px + var(--space-2xl)) var(--space-xl) var(--space-2xl);
}

.tool-container {
    max-width: 1400px;
    margin: 0 auto;
}

.tool-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.tool-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Comparison Area */
.comparison-area {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.input-panel {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: border-color var(--transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.input-panel:focus-within {
    border-color: var(--accent-primary);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.panel-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Upload Zone */
.upload-zone {
    position: relative;
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    margin-bottom: var(--space-md);
    background: var(--bg-secondary);
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
}

.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
    transform: scale(1.01);
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    margin-bottom: var(--space-md);
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--accent-primary);
}

.upload-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

.upload-text strong {
    color: var(--accent-primary);
}

.supported-formats {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.format-tag {
    font-size: 0.7rem;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

/* File Info */
.file-info {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--accent-glow);
    border: 1px solid rgba(26, 86, 168, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.file-info.active {
    display: flex;
}

.file-details {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.file-icon {
    font-size: 1.25rem;
}

.file-name {
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.remove-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

.remove-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--removed);
}

/* Loading State */
.loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent-glow);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    display: none;
    padding: var(--space-md);
    background: var(--removed-bg);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-md);
    color: var(--removed);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.error-message.active {
    display: block;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: var(--space-md) 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.divider span {
    padding: 0 var(--space-md);
}

/* Textarea with line numbers */
.textarea-wrapper {
    position: relative;
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    height: 220px;
    max-height: 220px;
}

.textarea-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.line-numbers {
    min-width: 40px;
    padding: var(--space-md) var(--space-sm);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border-subtle);
    text-align: right;
    font-family: var(--font-display);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    user-select: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.line-numbers::-webkit-scrollbar {
    display: none;
}

.line-numbers div {
    height: 1.6em;
}

.input-panel textarea {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    padding: var(--space-md);
    color: #1e293b;
    font-family: var(--font-display);
    font-size: 0.9rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    white-space: pre-wrap;
    overflow-y: auto;
}

.input-panel textarea::placeholder {
    color: var(--text-muted);
}

/* Panel Divider with Swap Button */
.panel-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.swap-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
    transform: rotate(180deg);
}

.swap-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    transition: stroke var(--transition-fast);
}

.swap-btn:hover svg {
    stroke: var(--accent-primary);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

/* Results Section */
.results-section {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    animation: fadeIn 0.4s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.results-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-stats {
    display: flex;
    gap: var(--space-lg);
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 500;
}

.stat-badge.additions {
    background: var(--added-bg);
    color: var(--added);
}

.stat-badge.deletions {
    background: var(--removed-bg);
    color: var(--removed);
}

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

.stat-badge.additions .stat-dot {
    background: var(--added);
}

.stat-badge.deletions .stat-dot {
    background: var(--removed);
}

/* Diff View */
.diff-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.diff-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.diff-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.diff-panel-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.diff-panel-badge {
    font-size: 0.7rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.added-badge {
    background: var(--added-bg);
    color: var(--added);
}

.removed-badge {
    background: var(--removed-bg);
    color: var(--removed);
}

.diff-content {
    padding: 0;
    max-height: 500px;
    overflow-y: auto;
    font-family: var(--font-display);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
    counter-reset: line;
}

.diff-content p {
    margin-bottom: 1em;
}

.diff-line-wrapper {
    display: flex;
    min-height: 1.7em;
}

.diff-line-wrapper:hover {
    background: rgba(0, 0, 0, 0.03);
}

.line-number {
    min-width: 45px;
    padding: 2px 10px 2px 10px;
    text-align: right;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    user-select: none;
    flex-shrink: 0;
}

.line-content {
    flex: 1;
    padding: 2px 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

.line-content.added {
    background: var(--added-bg);
}

.line-content.removed {
    background: var(--removed-bg);
}

.line-content.added .diff-line.added {
    background: transparent;
}

.line-content.removed .diff-line.removed {
    background: transparent;
}

/* Excel cell reference styling */
.diff-content .cell-ref {
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(26, 86, 168, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-right: 2px;
}

/* Compare Button Loading State */
#compareBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
    transition: all 0.2s ease;
}

#compareBtn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none !important;
}

/* Loading Overlay */
.compare-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9998;
    justify-content: center;
    align-items: center;
}

.compare-loading-overlay.active {
    display: flex;
}

.compare-loading-box {
    background: white;
    padding: 40px 60px;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: loadingBoxPop 0.3s ease;
}

@keyframes loadingBoxPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.compare-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: compareSpin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes compareSpin {
    to { transform: rotate(360deg); }
}

.compare-loading-box p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ============================================
   Chatbot Widget Styles
   ============================================ */

.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-display);
}

.chatbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(234, 88, 12, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(234, 88, 12, 0.5);
}

.chatbot-toggle .chat-icon {
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.chatbot-toggle .close-icon {
    position: absolute;
    opacity: 0;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.chatbot-widget.open .chatbot-toggle .chat-icon {
    opacity: 0;
    transform: scale(0.5);
}

.chatbot-widget.open .chatbot-toggle .close-icon {
    opacity: 1;
    transform: scale(1);
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-widget.open .chatbot-window {
    display: flex;
    animation: chatSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Header */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-title span:first-child {
    font-size: 1.3rem;
}

.chatbot-title span:last-child {
    font-weight: 600;
    font-size: 1rem;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 2px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-clear,
.chatbot-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-clear:hover,
.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.chatbot-messages {
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 320px;
    max-height: 320px;
    min-height: 320px;
    background: #f9fafb;
    scroll-behavior: smooth;
}

/* Custom scrollbar for chat messages */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.chatbot-messages .bot-msg,
.chatbot-messages .user-msg {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chatbot-messages .bot-msg {
    background: #ffffff;
    border-radius: 18px 18px 18px 4px;
    align-self: flex-start;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.chatbot-messages .user-msg {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    align-self: flex-end;
}

.chatbot-messages .bot-msg p,
.chatbot-messages .user-msg p {
    margin: 0;
}

/* Typing Indicator */
.chatbot-messages .typing {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px 18px 18px 4px;
    align-self: flex-start;
}

.chatbot-messages .typing span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.chatbot-messages .typing span:nth-child(1) { animation-delay: 0s; }
.chatbot-messages .typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-messages .typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Chat Input */
.chatbot-input-area {
    display: flex;
    gap: 10px;
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.chatbot-input-area textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    resize: none;
    outline: none;
    background: #f9fafb;
    color: #111827;
    max-height: 80px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chatbot-input-area textarea:focus {
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
    background: #ffffff;
}

.chatbot-input-area textarea::placeholder {
    color: #9ca3af;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-window {
        width: calc(100vw - 40px);
        right: 0;
        bottom: 65px;
        max-width: 360px;
    }
    
    .chatbot-toggle {
        width: 52px;
        height: 52px;
    }
    
    .chatbot-messages {
        height: 280px;
    }
}

.diff-line {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin: 1px 0;
    display: inline;
}

.diff-line.added {
    background: var(--added-bg);
    color: var(--added);
}

.diff-line.removed {
    background: var(--removed-bg);
    color: var(--removed);
    text-decoration: line-through;
}

.unchanged {
    color: var(--text-primary);
}

/* Changes List */
.changes-list {
    margin-bottom: var(--space-xl);
}

.changes-list h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.change-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border-left: 3px solid;
}

.change-item.addition {
    border-left-color: var(--added);
}

.change-item.deletion {
    border-left-color: var(--removed);
}

.change-item-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.change-item.addition .change-item-header {
    color: var(--added);
}

.change-item.deletion .change-item-header {
    color: var(--removed);
}

.change-item-content {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* No Differences */
.no-diff {
    text-align: center;
    padding: var(--space-3xl);
}

.no-diff-icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-md);
}

.no-diff p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: var(--radius-sm);
}

.legend-color.added {
    background: var(--added-bg);
    border: 1px solid var(--added);
}

.legend-color.removed {
    background: var(--removed-bg);
    border: 1px solid var(--removed);
}

/* Responsive */
@media (max-width: 1024px) {
    .comparison-area {
        grid-template-columns: 1fr;
    }
    
    .panel-divider {
        padding: var(--space-md) 0;
    }
    
    .swap-btn {
        transform: rotate(90deg);
    }
    
    .swap-btn:hover {
        transform: rotate(270deg);
    }
    
    .diff-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tool-main {
        padding: calc(70px + var(--space-lg)) var(--space-md) var(--space-lg);
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-stats {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ============================================
   NEW FEATURES - Draftable-Style Enhancements
   ============================================ */

/* FEATURE 5: Summary Header */
.summary-header {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border-subtle);
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.summary-stat.total {
    border-left: 3px solid var(--accent-primary);
}

.summary-stat.additions {
    border-left: 3px solid var(--added);
}

.summary-stat.deletions {
    border-left: 3px solid var(--removed);
}

.summary-icon {
    font-size: 1.1rem;
    font-weight: 700;
}

.summary-stat.additions .summary-icon {
    color: var(--added);
}

.summary-stat.deletions .summary-icon {
    color: var(--removed);
}

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

.summary-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Results Toolbar */
.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.view-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.5);
}

.view-btn.active {
    background: white;
    color: var(--accent-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-btn svg {
    flex-shrink: 0;
}

/* FEATURE 2: Change Navigation */
.change-navigation {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subtle);
    background: white;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-glow);
}

.nav-display {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
}

/* FEATURE 3: Export Button */
.export-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.export-btn svg {
    flex-shrink: 0;
}

/* Results Content Wrapper (with sidebar) */
.results-content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* FEATURE 1: Change List Panel (Sidebar) */
.change-list-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: fit-content;
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.change-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: white;
    border-bottom: 1px solid var(--border-subtle);
}

.change-list-title {
    font-weight: 600;
    color: var(--text-primary);
}

.change-list-count {
    background: var(--accent-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.change-list-items {
    overflow-y: auto;
    flex: 1;
    padding: var(--space-sm);
}

.change-list-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
    border: 1px solid transparent;
}

.change-list-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.change-list-item.change-item-active {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.15);
}

.change-list-item.addition {
    border-left: 3px solid var(--added);
}

.change-list-item.deletion {
    border-left: 3px solid var(--removed);
}

.change-list-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.change-list-badge.addition {
    background: var(--added-bg);
    color: var(--added);
}

.change-list-badge.deletion {
    background: var(--removed-bg);
    color: var(--removed);
}

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

.change-list-type {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.change-list-item.addition .change-list-type {
    color: var(--added);
}

.change-list-item.deletion .change-list-type {
    color: var(--removed);
}

.change-list-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.change-list-empty {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

.change-list-empty .empty-icon {
    font-size: 2rem;
    color: var(--added);
    margin-bottom: var(--space-sm);
}

/* Results Main Area */
.results-main {
    flex: 1;
    min-width: 0;
}

/* Diff View adjustments */
.diff-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* FEATURE 4: Redline View */
.redline-view {
    display: none;
}

.redline-panel {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.redline-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.redline-panel-title {
    font-weight: 600;
    color: var(--text-primary);
}

.redline-legend {
    display: flex;
    gap: var(--space-lg);
}

.redline-legend .legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.redline-legend .legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.redline-legend .legend-color.deleted {
    background: var(--removed-bg);
    border: 1px solid var(--removed);
}

.redline-legend .legend-color.inserted {
    background: var(--added-bg);
    border: 1px solid var(--added);
}

.redline-content {
    padding: var(--space-xl);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
}

.redline-deleted {
    background-color: var(--removed-bg);
    color: var(--removed);
    text-decoration: line-through;
    padding: 1px 2px;
    border-radius: 2px;
}

.redline-inserted {
    background-color: var(--added-bg);
    color: var(--added);
    padding: 1px 2px;
    border-radius: 2px;
}

/* Active change highlight */
.change-highlight-active {
    animation: highlightPulse 0.5s ease-out;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.4);
    border-radius: 2px;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.6);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.4);
    }
}

/* Responsive adjustments for new features */
@media (max-width: 1200px) {
    .results-content-wrapper {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 1024px) {
    .results-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .change-list-panel {
        max-height: 300px;
    }
    
    .diff-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .summary-header {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-md);
    }
    
    .results-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-toggle {
        justify-content: center;
    }
    
    .change-navigation {
        justify-content: center;
    }
    
    .export-btn {
        width: 100%;
        justify-content: center;
    }
    
    .change-list-panel {
        max-height: 250px;
    }
}

