/* Claude MPM Dashboard Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 15px;
    padding-bottom: 20px; /* Increased space for footer with more breathing room */
}

/* Sessions Tab Styles */
.sessions-container {
    padding: 15px;
}

.sessions-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* System Tab Styles */
.system-dashboard {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.system-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.system-section h3 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 18px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.system-grid {
    display: grid;
    gap: 15px;
}

.system-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
}

.system-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.system-metric:last-child {
    border-bottom: none;
}

.system-label {
    color: #718096;
    font-size: 14px;
    font-weight: 500;
}

.system-value {
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Monaco', 'Consolas', monospace;
}

.system-value.error {
    color: #f56565;
}

.system-value.warning {
    color: #ed8936;
}

.system-value.success {
    color: #48bb78;
}

.event-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.event-stat-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-stat-type {
    color: #4a5568;
    font-size: 13px;
    font-weight: 500;
}

.event-stat-count {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Session Card Styles */
.session-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.session-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.session-card.active {
    border-left-color: #48bb78;
    background: linear-gradient(to right, #f0fff4, white);
}

.session-card.completed {
    border-left-color: #cbd5e0;
    opacity: 0.8;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.session-id {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: #718096;
}

.session-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.session-status.active {
    background: #c6f6d5;
    color: #22543d;
}

.session-status.completed {
    background: #e2e8f0;
    color: #4a5568;
}

.session-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.session-metric {
    text-align: center;
}

.session-metric-value {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.session-metric-label {
    font-size: 11px;
    color: #a0aec0;
    text-transform: uppercase;
}

/* Footer Styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    color: #e2e8f0;
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.footer-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-label {
    color: #94a3b8;
    font-weight: 500;
}

/* Analysis status in footer */
#footer-analysis-container {
    display: flex;
    align-items: center;
}

.analysis-progress {
    color: #3b82f6;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    display: inline-block;
}

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

.footer-value {
    color: #e2e8f0;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
}

.footer-divider {
    color: #475569;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 15px 15px;
    margin-bottom: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.header h1 {
    color: #4a5568;
    font-size: 20px;
    margin: 0;
    font-weight: 600;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
}

.header-row:first-child {
    justify-content: space-between;
}

.header-row + .header-row {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Control Styles */
.connection-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Main Controls Row */
.main-controls {
    justify-content: space-between;
}

.connection-toggle {
    display: flex;
    align-items: center;
}

/* Connection Controls Row */
.connection-controls-row {
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    border-top: 1px solid transparent;
}

.connection-controls-row.show {
    max-height: 80px;
    opacity: 1;
    padding-top: 12px;
    padding-bottom: 12px;
    margin-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    max-width: 400px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.session-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.working-dir-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.working-dir-display {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.working-dir-path {
    font-family: monospace;
    font-size: 12px;
    color: #2d3748;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.working-dir-path:hover {
    color: #3182ce;
    text-decoration: underline;
}

/* Directory Viewer Overlay Styles */
.directory-viewer-overlay {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    z-index: 1001;
    overflow: hidden;
}

.directory-viewer-content {
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.directory-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

.directory-viewer-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.directory-viewer-header .close-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #718096;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.directory-viewer-header .close-btn:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.directory-viewer-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 300px;
}

.directory-viewer-body .file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 12px;
}

.directory-viewer-body .file-item:hover {
    background: #f8f9fa;
}

.directory-viewer-body .file-item.directory-item:hover {
    background: #e6fffa;
}

.directory-viewer-body .file-icon {
    min-width: 16px;
    font-size: 14px;
}

.directory-viewer-body .file-name {
    flex: 1;
    font-family: monospace;
    color: #2d3748;
    word-break: break-all;
}

.directory-viewer-body .file-type {
    font-size: 10px;
    color: #718096;
    text-transform: uppercase;
}

.directory-viewer-body .no-files,
.directory-viewer-body .loading-indicator {
    text-align: center;
    color: #718096;
    padding: 20px;
    font-style: italic;
}

.directory-viewer-body .directory-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px;
    color: #e53e3e;
    background: #fed7d7;
    border-radius: 4px;
    margin: 8px;
}

.directory-viewer-footer {
    padding: 8px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #718096;
    text-align: center;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}

.session-select {
    width: 300px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 11px;
}

label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

.info-group {
    display: flex;
    gap: 6px;
    margin-left: auto;
    font-size: 12px;
    color: #718096;
    background: #f7fafc;
    padding: 6px 6px;
    border-radius: 6px;
}

.info-group span {
    white-space: nowrap;
}

.info-separator {
    color: #cbd5e0;
}

/* Status Badge Styles */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.status-connected {
    background: #d4f8e8;
    color: #22543d;
}

.status-disconnected {
    background: #fed7d7;
    color: #742a2a;
}

.status-connecting {
    background: #feebc8;
    color: #7b341e;
}

/* Status classes for tools and operations */
.status-success {
    background: #c6f6d5;
    color: #22543d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.status-pending {
    background: #f3f4f6;
    color: #4b5563;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* Agent confidence levels */
.agent-confidence {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.agent-confidence.definitive {
    background: #c6f6d5;
    color: #22543d;
}

.agent-confidence.high {
    background: #bee3f8;
    color: #1a365d;
}

.agent-confidence.medium {
    background: #feebc8;
    color: #7b341e;
}

.agent-confidence.low,
.agent-confidence.default,
.agent-confidence.unknown {
    background: #e2e8f0;
    color: #4a5568;
}

/* Agent type styling */
.agent-type {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #edf2f7;
    color: #4a5568;
    font-weight: 500;
}

/* Tool status styling */
.tool-status {
    font-size: 11px;
    font-weight: 500;
}

/* Metrics Widget */
.metrics-widget {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f7fafc;
    padding: 8px 8px;
    border-radius: 8px;
}

.metric-mini {
    text-align: center;
}

.metric-mini-value {
    font-size: 16px;
    font-weight: bold;
    color: #4299e1;
    line-height: 1.2;
}

.metric-mini-label {
    font-size: 10px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.connection-info {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #718096;
}

.connection-info span {
    white-space: nowrap;
}

/* Form Controls */
input, select, button {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s;
}

#port-input {
    width: 50px;
    text-align: center;
}

#search-input {
    flex: 1;
    min-width: 150px;
}

input:focus, select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Button Styles */
button {
    background: #4299e1;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 6px 14px;
    font-size: 12px;
    white-space: nowrap;
}

button:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #718096;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-success {
    background: #48bb78;
}

.btn-success:hover {
    background: #38a169;
}

/* Events Container */
.events-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: calc(100vh - 230px); /* Adjusted for increased padding and footer clearance */
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 5px;
    margin-bottom: 0;
    border-bottom: 2px solid #e2e8f0;
}

.tab-filters {
    padding: 10px 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 5px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-filters input {
    flex: 1;
    min-width: 200px;
}

.tab-filters select {
    min-width: 120px;
}

.tab-filters label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

.tab-button {
    display: inline-block;
    padding: 10px 10px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #475569;
    background: rgba(0, 0, 0, 0.02);
}

/* BULLETPROOF TAB STYLING - High specificity to prevent conflicts */
.tab-button.active {
    color: #3b82f6 !important;
    border-bottom-color: #3b82f6 !important;
    border-bottom-width: 2px !important;
    border-bottom-style: solid !important;
}

/* Ensure inactive tabs are definitely inactive */
.tab-button:not(.active) {
    color: #64748b !important;
    border-bottom-color: transparent !important;
}

/* Fix for Activity tab text displaying vertically - ensure horizontal text */
.tab-button[data-tab="activity"] {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    transform: none !important;
}

.tab-content {
    flex: 1;
    display: none !important; /* Force hide by default */
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

/* BULLETPROOF: Only show active tab content */
.tab-content.active {
    display: flex !important;
    flex-direction: column !important;
}

/* Extra defensive rule: Hide ALL non-active tab content */
.tab-content:not(.active) {
    display: none !important;
    visibility: hidden !important;
}

/* Split Container Layout */
.split-container {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

.module-viewer {
    width: 40%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8f9fa;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    max-height: 100%;
}

.events-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8f9fa;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    max-height: 100%;
}

/* Module Viewer */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.module-header h4 {
    margin: 0;
    font-size: 14px;
    color: #4a5568;
    font-weight: 600;
}

/* Updated layout for module viewer - single scrollable pane */
.module-panes {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    max-height: 100%;
}

.module-data-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    max-height: 100%;
}

.module-json-pane {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 80px;
    max-height: 120px;
    border-top: 1px solid #e2e8f0;
}

.module-data-header,
.module-json-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 8px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
    font-size: 12px;
}

.module-data-header h5,
.module-json-header h5 {
    margin: 0;
    font-size: 12px;
    color: #4a5568;
    font-weight: 600;
}

.module-data-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: white;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

.module-data-content::-webkit-scrollbar {
    width: 6px;
}

.module-data-content::-webkit-scrollbar-track {
    background: #f7fafc;
}

.module-data-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.module-data-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.module-json-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: #f8fafc;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    height: 100%;
    min-height: 0;
}

/* Contextual Header */
.contextual-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 8px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.contextual-header-text {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    height: 100%;
    min-height: 0;
}

.module-json-content {
    background: #f8fafc;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
}

/* Legacy support - remove old module-content class */
.module-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: white;
    height: 100%;
    min-height: 0;
}

.module-empty {
    text-align: center;
    color: #718096;
    padding: 40px;
    font-style: italic;
}

.module-hint {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 8px;
}

/* Events List */
.events-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    background: white;
    height: 100%;
    min-height: 0;
}

/* Other List Containers */
.agents-list,
.tools-list,
.files-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    background: white;
    height: 100%;
    min-height: 0;
}

.no-events,
.no-agents,
.no-tools,
.no-files {
    text-align: center;
    color: #718096;
    padding: 40px;
    font-style: italic;
}

/* Event Items */
.event-item {
    background: white;
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #4299e1;
    cursor: pointer;
    transition: all 0.2s;
}

/* Single-row event items */
.event-item.single-row {
    padding: 8px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
}

.event-single-row-content {
    font-size: 13px;
    color: #2d3748;
    line-height: 1.4;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    word-break: break-all;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-content-main {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
}

.event-timestamp {
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    margin-left: auto;
    font-weight: 500;
}

/* Other Item Types */
.agent-item,
.tool-item,
.file-item {
    background: white;
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #4299e1;
    cursor: pointer;
    transition: all 0.2s;
}

.agent-item:hover,
.tool-item:hover,
.file-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.event-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.event-item.single-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.event-item.selected {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding-left: 16px;
    box-shadow: 0 2px 12px rgba(33, 150, 243, 0.2);
}

/* Selected state for all card types - unified styling */
.event-item.selected,
.agent-item.selected,
.tool-item.selected,
.file-item.selected {
    background: #e3f2fd !important;
    border-left: 4px solid #2196f3 !important;
    box-shadow: 0 2px 12px rgba(33, 150, 243, 0.2) !important;
    transform: translateX(4px) !important;
}

/* Single-row selected state */
.event-item.single-row.selected {
    background: #e3f2fd !important;
    border-left: 4px solid #2196f3 !important;
    box-shadow: 0 2px 12px rgba(33, 150, 243, 0.2) !important;
    transform: translateX(4px) !important;
}

.event-item .event-data strong {
    color: #475569;
    font-weight: 600;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.event-type {
    font-weight: 600;
    color: #2d3748;
}

.event-timestamp {
    font-size: 12px;
    color: #718096;
}

.event-data {
    font-size: 14px;
    color: #4a5568;
    margin-top: 5px;
}

/* Event Type Colors */
.event-session {
    background: white;
    border-left-color: #48bb78;
}

.event-claude {
    background: white;
    border-left-color: #ed8936;
}

.event-agent {
    background: white;
    border-left-color: #9f7aea;
}

.event-hook {
    background: white;
    border-left-color: #38b2ac;
}

.event-todo {
    background: white;
    border-left-color: #e53e3e;
}

.event-memory {
    background: white;
    border-left-color: #d69e2e;
}

.event-log {
    background: white;
    border-left-color: #718096;
}

/* File Path Display */
.file-path {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    color: #2d3748;
    word-break: break-all;
}

.file-agent {
    font-size: 12px;
    color: #718096;
    margin-left: 8px;
    font-style: italic;
}

/* Event Class Sections */
.event-class-section {
    margin-bottom: 20px;
}

.event-class-header {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 6px;
    border-left: 4px solid #4299e1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-class-icon {
    font-size: 16px;
}

/* Event Detail Cards */
.event-detail-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}

.event-detail-header {
    background: #f7fafc;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-detail-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 13px;
}

.event-detail-time {
    font-size: 11px;
    color: #718096;
}

.event-detail-content {
    padding: 12px;
}

.event-property {
    display: flex;
    margin-bottom: 6px;
    font-size: 12px;
}

.event-property:last-child {
    margin-bottom: 0;
}

.event-property-key {
    font-weight: 600;
    color: #4a5568;
    margin-right: 8px;
    min-width: 80px;
}

.event-property-value {
    color: #2d3748;
    word-wrap: break-word;
    flex: 1;
}

/* JSON Display */
.json-section {
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.json-header {
    margin-bottom: 10px;
}

.json-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

/* Collapsible JSON Section */
.collapsible-json-section {
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    padding-top: 0;
}

.json-toggle-header {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    margin-bottom: 0;
    user-select: none;
    position: relative;
}

/* Sticky toggle active state - shows when JSON is expanded globally */
.json-toggle-header[aria-expanded="true"] {
    background: linear-gradient(135deg, #e6f3ff 0%, #d4e9ff 100%);
    border-color: #4299e1;
}

.json-toggle-header[aria-expanded="true"] .json-toggle-text::after {
    content: ' (Sticky)';
    font-size: 11px;
    color: #4299e1;
    font-weight: normal;
    opacity: 0.8;
}

.json-toggle-header:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.json-toggle-header[aria-expanded="true"]:hover {
    background: linear-gradient(135deg, #d4e9ff 0%, #b8dcff 100%);
}

.json-toggle-header:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.json-toggle-header:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

.json-toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

.json-toggle-text::before {
    content: '🔍';
    font-size: 16px;
}

.json-toggle-arrow {
    font-size: 14px;
    font-weight: bold;
    color: #4a5568;
    transition: transform 0.2s ease;
}

.json-content-collapsible {
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.json-content-collapsible[aria-hidden="false"] {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.json-display {
    background: #f8fafc;
    border-radius: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #1e293b;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
    border: none;
    position: relative;
}

.json-display pre {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Copy button for JSON content */
.json-display::before {
    content: '📋';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.json-display:hover::before {
    opacity: 1;
}

/* Structured Data View */
.structured-view-section {
    margin-bottom: 20px;
}

.structured-view-header {
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.structured-view-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

.structured-data {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
}

/* AST Data Viewer Items */
.ast-data-viewer-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    background: white;
    margin-bottom: 2px;
    border-radius: 4px;
}

.ast-data-viewer-item:hover {
    background: #f8fafc;
}

.ast-data-viewer-item:last-child {
    border-bottom: none;
}

.ast-data-viewer-item.selected {
    background: #ebf8ff;
    border-left: 3px solid #3182ce;
}

.ast-data-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.ast-data-item-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ast-data-item-type {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #4a5568;
    text-transform: uppercase;
    font-weight: 500;
}

.ast-data-item-type.class { background: #fed7d7; color: #c53030; }
.ast-data-item-type.function { background: #c6f6d5; color: #2f855a; }
.ast-data-item-type.method { background: #bee3f8; color: #2b6cb0; }
.ast-data-item-type.variable { background: #feebc8; color: #c05621; }
.ast-data-item-type.import { background: #e9d8fd; color: #6b46c1; }

.ast-data-item-details {
    font-size: 12px;
    color: #718096;
    line-height: 1.4;
}

.ast-data-item-line {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #f7fafc;
    padding: 2px 4px;
    border-radius: 3px;
    margin-right: 8px;
}

.ast-data-item-complexity {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ast-complexity-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
}

.ast-complexity-indicator.low { background: #48bb78; }
.ast-complexity-indicator.medium { background: #ed8936; }
.ast-complexity-indicator.high { background: #e53e3e; }

.ast-data-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #a0aec0;
    text-align: center;
    padding: 20px;
}

.ast-placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.ast-placeholder-text {
    font-size: 14px;
    line-height: 1.5;
}

/* Hierarchical Source Viewer */
.source-viewer {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    background: #f8fafc;
    border-radius: 6px;
    overflow: hidden;
}

.source-viewer-header {
    background: #e2e8f0;
    padding: 8px 12px;
    border-bottom: 1px solid #cbd5e0;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.source-viewer-controls {
    display: flex;
    gap: 4px;
}

.source-control-btn {
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    color: #718096;
    transition: all 0.2s;
}

.source-control-btn:hover {
    background: #cbd5e0;
    color: #4a5568;
}

.source-viewer-content {
    max-height: 600px;
    overflow-y: auto;
    background: white;
}

/* Source Lines */
.source-line {
    display: flex;
    align-items: flex-start;
    padding: 2px 0;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.source-line:hover {
    background: #f7fafc;
}

.source-line.highlighted {
    background: #ebf8ff;
    border-left-color: #3182ce;
}

.source-line.collapsible {
    cursor: pointer;
}

.source-line.collapsible:hover {
    background: #edf2f7;
}

.line-number {
    width: 40px;
    text-align: right;
    color: #a0aec0;
    padding-right: 8px;
    user-select: none;
    flex-shrink: 0;
}

.line-content {
    flex: 1;
    padding-right: 12px;
    white-space: pre;
    overflow-x: auto;
}

.collapse-indicator {
    width: 16px;
    text-align: center;
    color: #718096;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.collapse-indicator:hover {
    color: #4a5568;
}

.collapse-indicator.expanded::before {
    content: '▼';
}

.collapse-indicator.collapsed::before {
    content: '▶';
}

.collapse-indicator.none::before {
    content: '';
}

/* Collapsed Content */
.collapsed-content {
    display: none;
}

.collapsed-placeholder {
    color: #a0aec0;
    font-style: italic;
    padding-left: 16px;
}

/* Syntax Highlighting */
.source-line .keyword {
    color: #805ad5;
    font-weight: 600;
}

.source-line .string {
    color: #38a169;
}

.source-line .comment {
    color: #718096;
    font-style: italic;
}

.source-line .function-def {
    color: #3182ce;
    font-weight: 600;
}

.source-line .class-def {
    color: #d69e2e;
    font-weight: 600;
}

.source-line .decorator {
    color: #805ad5;
}

/* AST Integration */
.source-line.ast-element {
    position: relative;
}

.source-line.ast-element::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #48bb78;
}

.source-line.ast-element.selected::after {
    background: #3182ce;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.3);
}

.structured-field {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #4a5568;
}

.structured-field:last-child {
    margin-bottom: 0;
}

.structured-field strong {
    color: #2d3748;
    font-weight: 600;
    margin-right: 8px;
}

/* Todo Checklist */
.todo-checklist {
    margin-top: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
}

.todo-checklist-header {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.todo-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

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

.todo-status {
    font-size: 14px;
    line-height: 1.4;
    min-width: 16px;
    display: inline-block;
}

.todo-content {
    flex: 1;
    font-size: 12px;
    line-height: 1.4;
    color: #4a5568;
    word-wrap: break-word;
}

.todo-completed .todo-content {
    color: #68d391;
    text-decoration: line-through;
}

.todo-in-progress .todo-content {
    color: #4299e1;
    font-weight: 500;
}

.todo-pending .todo-content {
    color: #4a5568;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 12px;
    width: 80%;
    max-width: 800px;
    max-height: 80%;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Code Display */
pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.4;
}

/* Git Diff Modal Styles */
.git-diff-modal {
    z-index: 1001; /* Higher than regular modals */
}

.modal-content.git-diff-content {
    width: 95vw;
    height: 95vh;
    max-width: none;
    max-height: none;
    margin: 2.5vh auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.git-diff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
    min-height: 60px;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.git-diff-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.git-diff-icon {
    font-size: 24px;
}

/* Styles for tracked/untracked file indicators */
.git-diff-icon.tracked-file {
    opacity: 1;
    filter: none;
}

.git-diff-icon.untracked-file {
    opacity: 0.8;
    position: relative;
}

.git-diff-icon.untracked-file:hover {
    opacity: 1;
}

/* Add visual emphasis for untracked files */
.git-diff-icon.untracked-file::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 3px;
    pointer-events: none;
}

.git-diff-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-left: 20px;
}

.git-diff-file-path {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    word-break: break-all;
}

.git-diff-timestamp {
    font-size: 12px;
    color: #718096;
}

.git-diff-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.git-diff-close:hover {
    background: #fed7d7;
    color: #e53e3e;
}

.git-diff-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important for flexbox scrolling */
    position: relative; /* Establish positioning context */
}

.git-diff-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
    color: #4a5568;
    font-size: 14px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.git-diff-error {
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.error-icon {
    font-size: 48px;
}

.error-message {
    font-size: 16px;
    color: #e53e3e;
    font-weight: 500;
    margin-bottom: 8px;
}

.error-suggestions {
    background: #fef5e7;
    border: 1px solid #f6e05e;
    border-radius: 6px;
    padding: 16px;
    color: #744210;
    font-size: 14px;
    max-width: 500px;
}

.error-suggestions h4 {
    margin: 0 0 8px 0;
    color: #744210;
    font-size: 14px;
}

.error-suggestions ul {
    margin: 0;
    padding-left: 20px;
}

.error-suggestions li {
    margin-bottom: 4px;
}

.git-diff-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important for flexbox scrolling */
    height: 100%;
    max-height: calc(100% - 80px); /* Account for header */
}

.git-diff-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #f7fafc;
    flex-shrink: 0; /* Prevent toolbar from shrinking */
    border-bottom: 1px solid #e2e8f0;
}

.git-diff-info {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #4a5568;
    font-family: 'Monaco', 'Consolas', monospace;
}

.commit-hash {
    color: #805ad5;
    font-weight: 600;
}

.diff-method {
    color: #38a169;
}

.git-diff-actions {
    display: flex;
    gap: 8px;
}

.git-diff-copy {
    background: #4299e1;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.git-diff-copy:hover {
    background: #3182ce;
}

.git-diff-scroll-wrapper {
    flex: 1;
    overflow: auto !important;
    overflow-y: scroll !important;
    min-height: 0;
    position: relative;
    height: 100%;
    max-height: calc(100vh - 300px); /* Account for header, toolbar, margins */
}

.git-diff-display {
    margin: 0;
    background: #1a202c;
    color: #e2e8f0;
    padding: 0;
    border-radius: 0;
    overflow: visible;
    font-family: 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    min-height: min-content;
}

.git-diff-code {
    display: block;
    padding: 20px;
    margin: 0;
    white-space: pre;
    overflow-wrap: normal;
    color: #e2e8f0;
}

/* Git diff syntax highlighting */
.git-diff-code .diff-header {
    color: #fbb6ce;
    font-weight: bold;
}

.git-diff-code .diff-meta {
    color: #bee3f8;
}

.git-diff-code .diff-addition {
    background-color: rgba(72, 187, 120, 0.2);
    color: #68d391;
}

.git-diff-code .diff-deletion {
    background-color: rgba(245, 101, 101, 0.2);
    color: #fc8181;
}

.git-diff-code .diff-context {
    color: #e2e8f0;
}

/* Git Diff Button Styles */
.git-diff-action {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
}

.git-diff-button {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(66, 153, 225, 0.3);
}

.git-diff-button:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.4);
}

.git-diff-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(66, 153, 225, 0.3);
}


button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #a0aec0;
}

button:disabled:hover {
    transform: none;
    background: #a0aec0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .split-container {
        flex-direction: column;
    }

    .module-viewer {
        width: 100%;
        height: 250px;
    }

    /* Single-row content adjustments for smaller screens */
    .event-single-row-content {
        font-size: 12px;
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        padding-bottom: 15px;
    }

    .header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .filter-group {
        max-width: none;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* File Viewer Modal Styles */
.file-viewer-modal {
    z-index: 1001; /* Higher than regular modals */
}

.modal-content.file-viewer-content {
    width: 95vw;
    height: 95vh;
    max-width: none;
    max-height: none;
    margin: 2.5vh auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.file-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
    min-height: 60px;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.file-viewer-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.file-viewer-icon {
    font-size: 24px;
}

.file-viewer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-left: 20px;
}

.file-viewer-file-path {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    word-break: break-all;
}

.file-viewer-file-size {
    font-size: 12px;
    color: #718096;
}

.file-viewer-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-viewer-close:hover {
    background: #fed7d7;
    color: #e53e3e;
}

.file-viewer-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important for flexbox scrolling */
    position: relative; /* Establish positioning context */
}

.file-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
    color: #4a5568;
    font-size: 14px;
}

.file-viewer-error {
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.file-viewer-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important for flexbox scrolling */
    height: 100%;
    max-height: calc(100% - 80px); /* Account for header */
}

.file-viewer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #f7fafc;
    flex-shrink: 0; /* Prevent toolbar from shrinking */
    border-bottom: 1px solid #e2e8f0;
}

.file-viewer-info {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #4a5568;
    font-family: 'Monaco', 'Consolas', monospace;
}

.file-extension {
    color: #805ad5;
    font-weight: 600;
}

.file-encoding {
    color: #38a169;
    font-weight: 600;
}

.file-viewer-actions {
    display: flex;
    gap: 8px;
}

.file-content-copy {
    background: #4299e1;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-content-copy:hover {
    background: #3182ce;
}

.file-viewer-scroll-wrapper {
    flex: 1;
    overflow: auto !important;
    overflow-y: scroll !important;
    min-height: 0;
    position: relative;
    height: 100%;
    max-height: calc(100vh - 300px); /* Account for header, toolbar, margins */
}

.file-content-display {
    margin: 0;
    background: #1a202c;
    color: #e2e8f0;
    padding: 0;
    border-radius: 0;
    overflow: visible;
    font-family: 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    min-height: min-content;
}

.file-content-code {
    display: block;
    padding: 20px;
    margin: 0;
    white-space: pre;
    overflow-wrap: normal;
    color: #e2e8f0;
}

/* File content syntax highlighting - Prism.js integration */
.file-content-display code[class*="language-"],
.file-content-display pre[class*="language-"] {
    color: #e2e8f0;
    background: none;
    font-family: 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}

/* Prism line numbers integration */
.file-content-display .line-numbers-rows {
    border-right: 1px solid #44475a;
    padding-right: 0.5em;
}

.file-content-display .line-numbers .line-numbers-rows > span:before {
    color: #6272a4;
}

/* File content syntax highlighting - fallback colors */
.file-content-code .keyword {
    color: #ff79c6;
    font-weight: 600;
}

/* Search Viewer Modal Styles */
.search-viewer-modal {
    z-index: 1001; /* Higher than regular modals */
}

.modal-content.search-viewer-content {
    width: 80vw;
    height: 80vh;
    max-width: 1200px;
    max-height: 800px;
    margin: 10vh auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.search-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
    min-height: 60px;
    flex-shrink: 0;
}

.search-viewer-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.search-viewer-icon {
    font-size: 24px;
}

.search-viewer-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-viewer-close:hover {
    background: #fed7d7;
    color: #e53e3e;
}

.search-viewer-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    gap: 20px;
}

.search-params-section,
.search-results-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
}

.search-params-section h3,
.search-results-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.search-params-display {
    background: #1a202c;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre;
}

.search-results-display {
    max-height: 400px;
    overflow-y: auto;
}

.search-results-text,
.search-results-json {
    background: #1a202c;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-results-list li {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.search-results-list li pre {
    margin: 0;
    background: #1a202c;
    color: #e2e8f0;
    padding: 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    overflow-x: auto;
}

/* Button for viewing search details */
.btn-view-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-view-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.search-view-action {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.file-content-code .comment {
    color: #6272a4;
    font-style: italic;
}

.file-content-code .string {
    color: #f1fa8c;
}

.file-content-code .number,
.source-line .number {
    color: #bd93f9;
}

.file-content-code .property {
    color: #50fa7b;
}

.file-content-code .value {
    color: #8be9fd;
}

/* JSON-specific syntax highlighting */
.file-content-code .json-key,
.source-line .json-key {
    color: #8be9fd;
    font-weight: 600;
}

.file-content-code .literal,
.source-line .literal {
    color: #ff79c6;
    font-weight: 600;
}

.file-content-code .selector {
    color: #ff79c6;
}

.file-content-code .tag {
    color: #ff79c6;
}

.file-content-code .attribute {
    color: #50fa7b;
}

.file-content-code .header {
    color: #ff79c6;
    font-weight: bold;
}

.file-content-code .header-text {
    color: #f8f8f2;
    font-weight: normal;
}

.file-content-code .bold {
    color: #f8f8f2;
    font-weight: bold;
}

.file-content-code .italic {
    color: #f8f8f2;
    font-style: italic;
}

.file-content-code .code {
    background: rgba(68, 71, 90, 0.5);
    color: #f1fa8c;
    padding: 2px 4px;
    border-radius: 3px;
}

.file-content-code .list-marker {
    color: #ff79c6;
}

.file-content-code .line-number {
    color: #6272a4;
    user-select: none;
    margin-right: 1em;
    border-right: 1px solid #44475a;
    padding-right: 0.5em;
    display: inline-block;
    min-width: 3em;
    text-align: right;
}

/* Git Tracking Control Styles */
.git-track-status {
    margin-top: 8px;
    font-size: 14px;
}

.untracked-file-notice,
.tracked-file-notice,
.tracking-file-notice,
.tracking-error-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.untracked-file-notice {
    background: #fef5e7;
    border: 1px solid #f6e05e;
    color: #744210;
}

.tracked-file-notice {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
}

.tracking-file-notice {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    color: #2c5282;
}

.tracking-error-notice {
    background: #fed7d7;
    border: 1px solid #fc8181;
    color: #742a2a;
}

.track-file-button {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.track-file-button:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.4);
}

.track-file-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
}

.untracked-icon,
.tracked-icon,
.loading-icon,
.error-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.untracked-text,
.tracked-text,
.loading-text,
.error-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.git-icon {
    font-size: 14px;
}

/* File viewer icon styling */
.file-viewer-icon {
    transition: all 0.2s ease;
}

.file-viewer-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Enhanced File Operations Styles */
.single-file-header {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-left: 4px solid #4299e1;
    border-radius: 6px 6px 0 0;
}

.file-type-badge {
    background: #e2e8f0;
    color: #4a5568;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clickable-file-path {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.clickable-file-path:hover {
    background: #bee3f8;
    color: #2b6cb0;
    transform: translateX(2px);
}

.file-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.single-file-actions {
    margin-top: 16px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.file-action-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.file-action-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.file-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(66, 153, 225, 0.3);
}

.file-action-btn.primary-action {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.2);
}

.file-action-btn.primary-action:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    box-shadow: 0 4px 16px rgba(66, 153, 225, 0.4);
}

.inline-preview-btn {
    background: #48bb78;
    border: 1px solid #38a169;
}

.inline-preview-btn:hover {
    background: #38a169;
    border-color: #2f855a;
}

/* Inline Preview Styles */
.inline-preview-container {
    margin-top: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
        margin-top: 16px;
    }
}

.inline-preview-header {
    background: #f7fafc;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.preview-label {
    color: #4a5568;
    font-weight: 600;
}

.preview-file {
    color: #2d3748;
    font-family: 'Monaco', 'Consolas', monospace;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 3px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inline-preview-content {
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    background: #fafafa;
}

.preview-note {
    color: #718096;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 6px;
}

.inline-preview-loading {
    padding: 20px;
    text-align: center;
    color: #4a5568;
    font-style: italic;
}

.inline-preview-error {
    padding: 12px;
    background: #fed7d7;
    color: #c53030;
    border-radius: 4px;
    font-size: 12px;
}

/* File Icon Enhancements */
.unified-viewer-header h6 {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Enhanced File Type Icons */
.unified-viewer-header .file-type-badge {
    margin-left: auto;
}

/* File Path Click Animation */
.clickable-file-path {
    position: relative;
}

.clickable-file-path::before {
    content: '👁️';
    position: absolute;
    right: -20px;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.clickable-file-path:hover::before {
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .file-actions {
        flex-direction: column;
    }
    
    .file-action-btn {
        justify-content: center;
        width: 100%;
    }
    
    .single-file-actions {
        padding: 8px;
    }
    
    .inline-preview-content {
        font-size: 11px;
        padding: 8px;
    }
}

/* Hover Effects for File Operations */
.unified-viewer-content:hover .clickable-file-path {
    background: rgba(190, 227, 248, 0.3);
}

.single-file-header:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
}

/* Accessibility */
.file-action-btn:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

.clickable-file-path:focus {
    outline: 2px solid #4299e1;
    outline-offset: 1px;
}

/* Agent-specific view styles */
.agent-overview-section,
.agent-prompt-section,
.agent-todos-section,
.agent-tools-section {
    margin-bottom: 20px;
}

.agent-prompt {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 6px;
    padding: 10px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.agent-todos-section .todo-checklist {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.agent-todos-section .todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.agent-todos-section .todo-item:last-child {
    border-bottom: none;
}

.agent-todos-section .todo-timestamp {
    font-size: 11px;
    color: #64748b;
    margin-left: auto;
    font-family: 'Monaco', 'Consolas', monospace;
}

.tools-list {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.tool-call-item {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.tool-call-item:last-child {
    border-bottom: none;
}

.tool-call-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.tool-name {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.tool-phase {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.tool-phase.pre_tool {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.tool-phase.post_tool {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.tool-timestamp {
    font-size: 11px;
    color: #64748b;
    font-family: 'Monaco', 'Consolas', monospace;
    margin-left: auto;
}

.tool-success.success {
    color: #059669;
    font-weight: bold;
}

.tool-success.failed {
    color: #dc2626;
    font-weight: bold;
}

.tool-call-details {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: #64748b;
    margin-left: 24px;
}

/* Consolidated Tool Status Styles */
.tool-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
}

.tool-status-indicator.status-success {
    background: #dcfce7;
    color: #166534;
}

.tool-status-indicator.status-failed {
    background: #fef2f2;
    color: #dc2626;
}

.tool-status-indicator.status-blocked {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.tool-status-indicator.status-running {
    background: #e0f2fe;
    color: #0369a1;
}

.tool-completed {
    font-style: italic;
    color: #64748b;
}

.tool-agent {
    font-size: 11px;
    font-weight: 500;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-target {
    font-family: 'Monaco', 'Consolas', monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
}

.tool-duration {
    font-family: 'Monaco', 'Consolas', monospace;
    color: #7c3aed;
}

/* Tool Result Section Styles */
.tool-result-section {
    margin-top: 16px;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.tool-result-content {
    margin-top: 12px;
}

.tool-result-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 12px;
}

.tool-result-status.tool-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.tool-result-status.tool-failure {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tool-result-status.tool-blocked {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.tool-result-status.tool-running {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.tool-result-icon {
    font-size: 16px;
}

.tool-result-text {
    font-weight: 600;
}

.tool-exit-code {
    margin-left: auto;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.tool-result-output,
.tool-result-error,
.tool-result-other {
    margin-bottom: 12px;
}

.tool-result-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.tool-result-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.tool-result-preview.error-preview {
    background: #fef2f2;
    border-color: #fecaca;
}

.tool-result-preview pre {
    margin: 0;
    font-family: 'Monaco', 'Consolas', 'Menlo', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.tool-result-meta {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    font-style: italic;
}

/* Clickable File Path Styles */
.clickable-file-path {
    color: #3b82f6;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Monaco', 'Consolas', 'Menlo', monospace;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    padding: 2px 6px;
    transition: all 0.2s ease;
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.clickable-file-path:hover {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    text-decoration: underline;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.clickable-file-path:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.2);
}

/* Special styling for file path in file-path-display context */
.file-path-display .clickable-file-path {
    font-size: 14px;
    padding: 4px 8px;
    margin-left: 8px;
}

/* Ensure clickable file paths stand out in event property values */
.event-property-value .clickable-file-path {
    margin: 0;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.event-property-value .clickable-file-path:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
}

/* Inline Edit Diff Viewer Styles */
.inline-edit-diff-viewer {
    margin-top: 8px;
    border-top: 1px solid #e2e8f0;
    background: #f8f9fa;
}

.diff-toggle-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
    font-size: 12px;
    color: #4a5568;
}

.diff-toggle-header:hover {
    background: #e2e8f0;
}

.diff-toggle-icon {
    font-size: 14px;
}

.diff-toggle-text {
    flex: 1;
    font-weight: 500;
}

.diff-toggle-arrow {
    font-size: 10px;
    color: #718096;
    transition: transform 0.2s;
}

.diff-content-container {
    border-top: 1px solid #e2e8f0;
    background: white;
}

.edit-diff-section {
    padding: 8px;
}

.edit-diff-header {
    font-size: 11px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 4px;
}

.diff-container {
    font-family: 'Monaco', 'Consolas', 'Menlo', monospace;
    font-size: 11px;
    line-height: 1.4;
    background: #1a202c;
    border-radius: 4px;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

.diff-line {
    padding: 2px 8px;
    white-space: pre;
    word-break: break-all;
}

.diff-line.diff-added {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.diff-line.diff-removed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.diff-line.diff-unchanged {
    color: #9ca3af;
    background: transparent;
}

/* Event item adjustments to accommodate diff viewers */
.event-item.single-row {
    flex-direction: column;
    align-items: stretch;
}

.event-single-row-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
}

/* Responsive adjustments for diff viewers */
@media (max-width: 768px) {
    .diff-container {
        font-size: 10px;
        max-height: 150px;
    }

    .inline-edit-diff-viewer {
        margin-left: -12px;
        margin-right: -12px;
    }

    .directory-viewer-overlay {
        left: 10px !important;
        right: 10px !important;
        min-width: auto !important;
        max-width: none !important;
    }
}


/* Version Display Styles */
.version-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
}

.version-display:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.version-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.version-label {
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.version-value {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 11px;
    color: #4ade80;
}

.version-separator {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 5px;
}

/* Monitor version special styling */
.monitor-version .version-value {
    color: #60a5fa;
}

/* Version Modal Styles */
.version-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.version-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.version-modal-content h3 {
    margin-bottom: 16px;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
}

.version-modal-content pre {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 16px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
    margin-bottom: 16px;
    overflow-x: auto;
}

.version-modal-content button {
    background: #4299e1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.version-modal-content button:hover {
    background: #3182ce;
}

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

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

/* Responsive adjustments for version display */
@media (max-width: 1200px) {
    .version-display {
        margin-left: 10px;
        font-size: 11px;
    }
    
    .version-label {
        display: none;
    }
    
    .version-separator {
        margin: 0 3px;
    }
}

@media (max-width: 768px) {
    .version-display {
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 5px;
        margin-left: 0;
        background: rgba(0, 0, 0, 0.5);
    }
}

/* Agent Hierarchy Tree Styles */
.agent-hierarchy {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: white;
    border-radius: 8px;
    padding: 12px;
}

.agent-hierarchy-empty {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
}

.agent-node {
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.agent-node-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.agent-node-header:hover {
    background: #edf2f7;
    transform: translateX(2px);
}

.agent-node-selected .agent-node-header {
    background: #e6f3ff;
    border-left-color: #4299e1;
}

/* Indentation for hierarchy levels */
.agent-node-level-0 {
    margin-left: 0;
}

.agent-node-level-1 {
    margin-left: 24px;
}

.agent-node-level-2 {
    margin-left: 48px;
}

.agent-node-level-3 {
    margin-left: 72px;
}

/* Node elements */
.agent-node-expand {
    width: 16px;
    font-size: 10px;
    color: #718096;
    flex-shrink: 0;
}

.agent-node-icon {
    font-size: 18px;
    margin: 0 8px;
    flex-shrink: 0;
}

.agent-node-name {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
    font-size: 14px;
}

.agent-node-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.agent-event-count {
    color: #718096;
    font-size: 12px;
    background: #f7fafc;
    padding: 2px 8px;
    border-radius: 12px;
}

.agent-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Status colors */
.agent-status-active .agent-status {
    background: #c6f6d5;
    color: #22543d;
}

.agent-status-completed .agent-status {
    background: #e2e8f0;
    color: #4a5568;
}

.agent-status-pending .agent-status {
    background: #fef5e7;
    color: #744210;
}

/* Implied/Inferred PM and Agent Styles */
.agent-status-inferred .agent-status {
    background: #f0e5ff;
    color: #6b46c1;
    font-style: italic;
}

.agent-node-implied .agent-node-header {
    border-left-style: dashed !important;
    opacity: 0.9;
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.05) 0%, rgba(107, 70, 193, 0.1) 100%);
}

.agent-node-implied.agent-node-level-0 .agent-node-header {
    border-left-color: #6b46c1;
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
}

.agent-node-implied .agent-node-name {
    font-style: italic;
}

.agent-node-implied .agent-node-icon {
    opacity: 0.8;
}

/* Tooltip styling for implied nodes */
.agent-node-implied[title]:hover::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 50px;
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-top: 4px;
}

/* PM node styling */
.agent-node-level-0 .agent-node-header {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left-width: 4px;
    border-left-color: #667eea;
    font-weight: 600;
}

.agent-node-level-0 .agent-node-name {
    font-size: 15px;
    color: #1a202c;
}

/* Node details */
.agent-node-details {
    margin: 4px 0 8px 44px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 12px;
    color: #4a5568;
    animation: slideDown 0.2s ease;
}

.agent-delegation-context {
    margin-bottom: 6px;
    line-height: 1.4;
}

.agent-delegation-context strong {
    color: #2d3748;
    font-weight: 600;
}

.agent-timing {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #718096;
    font-size: 11px;
}

.agent-duration {
    color: #4299e1;
    font-weight: 500;
}

/* Children container */
.agent-node-children {
    margin-top: 4px;
    border-left: 1px dashed #cbd5e0;
    margin-left: 20px;
    padding-left: 4px;
    animation: fadeIn 0.2s ease;
}

/* Hierarchy control buttons */
.hierarchy-controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.hierarchy-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #cbd5e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
    font-weight: 500;
}

.hierarchy-btn:hover {
    background: #f7fafc;
    border-color: #a0aec0;
    transform: translateY(-1px);
}

.hierarchy-btn:active {
    transform: translateY(0);
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .agent-node-level-1 {
        margin-left: 16px;
    }
    
    .agent-node-level-2 {
        margin-left: 32px;
    }
    
    .agent-node-level-3 {
        margin-left: 48px;
    }
    
    .agent-node-children {
        margin-left: 12px;
    }
    
    .agent-node-details {
        margin-left: 28px;
    }
}


/* Flat Agent View Styles */
.agent-events-flat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agent-event-item {
    background: white;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 4px;
    border-left: 4px solid #4299e1;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.agent-event-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    background: #f8fafc;
}

.agent-event-header {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
    align-items: center;
}

.agent-event-time {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 12px;
    color: #718096;
    background: #edf2f7;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

.agent-event-agent {
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-event-action {
    font-size: 13px;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 4px;
}

.agent-event-status {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.status-active {
    background: #c6f6d5;
    color: #22543d;
}

.status-completed {
    background: #bee3f8;
    color: #2c5282;
}

.status-error {
    background: #fed7d7;
    color: #742a2a;
}

.status-pending {
    background: #f3f4f6;
    color: #4b5563;
}

.agent-event-details {
    margin-top: 8px;
    padding-left: 16px;
    font-size: 12px;
    color: #4a5568;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    background: #f7fafc;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #cbd5e0;
}

/* Mobile responsive for flat view */
@media (max-width: 768px) {
    .agent-event-header {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .agent-event-time {
        justify-self: start;
        min-width: auto;
    }
    
    .agent-event-agent {
        font-size: 14px;
    }
    
    .agent-event-action {
        font-size: 12px;
    }
    
    .agent-event-status {
        justify-self: end;
    }
}

/* Unified Data Viewer Styles */
.unified-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.unified-viewer-header h6 {
    margin: 0;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.unified-viewer-timestamp {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 12px;
    color: #718096;
    background: #edf2f7;
    padding: 4px 8px;
    border-radius: 4px;
}

.unified-viewer-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.unified-viewer-count {
    font-size: 12px;
    color: #4a5568;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 3px;
}

.unified-viewer-content {
    color: #4a5568;
    line-height: 1.5;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.detail-label {
    font-weight: 600;
    color: #2d3748;
    min-width: 120px;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    word-break: break-word;
}

.detail-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.detail-section-title {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
    font-size: 14px;
}

/* Tool and parameter display */
.tools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
    border-left: 3px solid #cbd5e0;
}

.tool-icon {
    font-size: 14px;
}

.tool-name {
    font-weight: 500;
    flex: 1;
}

.tool-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.params-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.param-item {
    background: #f7fafc;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #cbd5e0;
}

.param-key {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    font-size: 13px;
}

.param-value {
    color: #4a5568;
}

.param-text-short {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 12px;
    background: #edf2f7;
    padding: 2px 4px;
    border-radius: 3px;
}

.param-text {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 12px;
    background: #edf2f7;
    padding: 8px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.param-text-long {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 12px;
    background: #edf2f7;
    padding: 8px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.param-json {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 11px;
    background: #1a202c;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.param-error {
    color: #e53e3e;
    font-style: italic;
}

/* Todo display */
.todo-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.status-count {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-count.completed {
    background: #c6f6d5;
    color: #22543d;
}

.status-count.in_progress {
    background: #fbb6ce;
    color: #702459;
}

.status-count.pending {
    background: #f3f4f6;
    color: #4b5563;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
    border-left: 3px solid #cbd5e0;
}

.todo-item.completed {
    border-left-color: #38a169;
    background: #f0fff4;
}

.todo-item.in_progress {
    border-left-color: #d53f8c;
    background: #fef5e7;
}

.todo-item.pending {
    border-left-color: #9ca3af;
    background: #f9fafb;
}

.todo-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.todo-content {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.todo-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: capitalize;
    font-weight: 500;
    flex-shrink: 0;
}

/* Instruction display */
.instruction-text {
    background: #f7fafc;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #4299e1;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* Operations display */
.operations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.operation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
    border-left: 3px solid #cbd5e0;
}

.operation-type {
    font-weight: 500;
    color: #2d3748;
}

.operation-timestamp {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 11px;
    color: #718096;
}

/* Hook details */
.prompt-text {
    background: #f7fafc;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #4299e1;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
}

/* Event data JSON display */
.event-data-json {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 11px;
    background: #1a202c;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* Tool result display */
.tool-result {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 11px;
    background: #1a202c;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* No data states */
.no-todos {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 20px;
}

.no-params {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .unified-viewer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .detail-label {
        min-width: auto;
    }
}
