/* Project REX Investigation -- New Design System */

:root {
    --primary-bg: #000000;
    --secondary-bg: #101010;
    --tertiary-bg: #1A1A1A;
    --primary-text: #EAEAEA;
    --secondary-text: #A0A0A0;
    --accent-red: #FA2A00;
    --accent-red-hover: #D02200;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(250, 42, 0, 0.1);
    --success-color: #27ae60;
    --warning-color: #f39c12;
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--primary-bg);
    color: var(--primary-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0.75rem 2rem;
}

.nav-content {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-logo .project { color: #888; }
.nav-logo .rex { color: var(--accent-red); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu a {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.user-menu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-cta {
    background: var(--accent-red);
    color: white !important;
    padding: 0.625rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.9rem;
}

.nav-cta:hover {
    background: var(--accent-red-hover);
    transform: translateY(-1px);
}

/* Main Container */
.investigation-container {
    padding-top: 65px; /* Offset for fixed nav */
}

/* Sub-Header */
.investigation-header {
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 60px; /* Stick below main nav */
    z-index: 999;
}

.header-left .investigation-id {
    background: var(--tertiary-bg);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--secondary-text);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.investigation-status {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.initialized { background: var(--warning-color); }
.status-indicator.running { background: #3498db; }
.status-indicator.completed { background: var(--success-color); }
.status-indicator.failed { background: var(--accent-red); }
.status-indicator.paused { background: var(--warning-color); }
.status-indicator.stopping { background: var(--accent-red); }


.progress-bar {
    width: 200px;
    height: 4px;
    background: var(--tertiary-bg);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-red);
    width: 0%;
    transition: width 0.5s ease;
}

.header-right .header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background: var(--tertiary-bg);
    color: var(--primary-text);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:hover:not(:disabled) {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-red-hover);
    border-color: var(--accent-red-hover);
}

.btn-secondary {
    /* Default .btn style is now secondary */
}

.btn-warning { background-color: var(--warning-color); border-color: var(--warning-color); color: #000; }
.btn-warning:hover:not(:disabled) { 
    background-color: #e6b800; 
    border-color: #e6b800; 
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.btn-success { background-color: var(--success-color); border-color: var(--success-color); color: #fff; }
.btn-success:hover:not(:disabled) { 
    background-color: #218838; 
    border-color: #218838; 
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.btn-danger { background-color: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.btn-danger:hover:not(:disabled) { 
    background-color: #c82333; 
    border-color: #c82333; 
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Main Content Layout */
.investigation-content {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    padding-right: 56px; /* Space for collapsed agent panel handle */
    padding-bottom: 100px;
}

.left-panel, .right-panel {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
}

.left-panel { 
    flex-basis: 60%; 
    /* height: calc(100vh - 200px); Give it a proper height instead of fit-content */
    min-height: 500px; /* Ensure minimum height for graph visibility */
    height: fit-content;
}
.right-panel { 
    flex-basis: 38%;
    height: fit-content; 
}

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

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

/* Left Panel - Graph */
.graph-container {
    position: relative;
    height: 100%; /* Take full height of parent */
}

.graph-stats {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-shrink: 0;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-red);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chat Section in Left Panel - Specific Styling */
.left-panel .chat-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-bg);
    border-radius: var(--border-radius);
}

.left-panel .chat-section .panel-header {
    padding: 1rem;
    background: var(--tertiary-bg);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.left-panel .chat-section .chat-content {
    padding: 0;
}

.left-panel .chat-section .chat-messages {
    margin: 1rem;
    margin-bottom: 0.5rem;
    height: 250px; /* Slightly smaller height for left panel */
}

.left-panel .chat-section .chat-input-container {
    margin: 0 1rem 1rem 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.left-panel .chat-section .prompt-help {
    margin: 0 1rem 1rem 1rem;
    padding: 0.75rem;
    background: var(--tertiary-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.left-panel .chat-section #chatInput {
    flex: 1;
    margin: 0;
    min-height: 60px;
    max-height: 120px;
    resize: vertical;
}

.left-panel .chat-section #sendChatBtn {
    margin: 0;
    height: 60px;
    width: 60px;
    flex-shrink: 0;
}

/* Right Panel - Setup, Chat, Details */
.right-panel {
    overflow-y: auto;
}

.setup-section {
    padding: 1.5rem;
}

.setup-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem; /* Added space below header */
}

.setup-section, .chat-section, .details-section, .status-panel {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.setup-section:last-child, .chat-section:last-child, .details-section:last-child, .status-panel:last-child {
    border-bottom: none;
}

/* Form Elements */
textarea, input[type="text"], select {
    width: 100%;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    color: var(--primary-text);
    font-family: inherit;
}

textarea:focus, input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 10px var(--shadow-color);
}

.form-group {
    margin-bottom: 1.5rem; /* Added space below form group */
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-text);
}

.form-help-text {
    font-size: 0.875rem;
    color: var(--secondary-text);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
}

/* Enhanced Chat Interface - Matching Homepage Design */
.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--primary-bg);
    border-radius: var(--border-radius);
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease-out;
}

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 16px;
}

.message-content > div {
    flex: 1;
    min-width: 0; /* Allow content to shrink */
}

.message-content i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 16px;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--accent-red), #e02400);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message.assistant .message-content {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px 18px 18px 4px;
}

.message.system .message-content {
    background: rgba(250, 42, 0, 0.1);
    color: var(--accent-red);
    text-align: center;
    max-width: 100%;
    border-radius: 12px;
    justify-content: center;
    font-style: italic;
}

.message-content i {
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.message.user .message-content i {
    color: rgba(255, 255, 255, 0.9);
}

.message.assistant .message-content i {
    color: var(--accent-red);
}

.message-content span {
    line-height: 1.5;
    word-wrap: break-word;
    font-size: inherit;
}

/* Enhanced Loading State */
.message.chat-loading .message-content {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px 18px 18px 4px;
    padding: 1rem 1.25rem;
}

.loading-bubble {
    position: relative;
}

.loading-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.typing-indicator {
    display: flex;
    gap: 3px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

.loading-text {
    color: var(--secondary-text);
    font-size: 15px;
    font-style: italic;
}

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

/* Enhanced Chat Input */
.chat-input-container {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    font-size: 1rem;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-text);
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: all 0.3s ease;
}

#chatInput:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(250, 42, 0, 0.1);
}

#sendChatBtn {
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#sendChatBtn:hover:not(:disabled) {
    background: #e02400;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(250, 42, 0, 0.3);
}

#sendChatBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Evidence Citation Links */
.evidence-citation {
    color: var(--accent-red);
    text-decoration: underline;
    cursor: pointer;
    transition: all 0.2s ease;
}

.evidence-citation:hover {
    color: #e02400;
    text-decoration: none;
    background: rgba(250, 42, 0, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

/* Scrollbar Styling for Chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--tertiary-bg);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--secondary-text);
    border-radius: 3px;
    opacity: 0.5;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-text);
}

/* Responsive Chat Design */
@media (max-width: 768px) {
    .message-content {
        max-width: 90%;
        padding: 0.875rem 1rem;
        font-size: 16px;
    }
    
    .chat-messages {
        height: 250px;
        padding: 0.75rem;
    }
    
    #chatInput {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Agent Panel */
.agent-panel {
    position: fixed;
    right: 0;
    top: 121px; /* Below sub-header (60px nav + 61px sub-header) */
    height: calc(100vh - 121px);
    width: 320px;
    background: var(--secondary-bg);
    border-left: 1px solid var(--border-color);
    z-index: 101;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}

.agent-panel.collapsed {
    transform: translateY(calc(100% - 40px));
    cursor: pointer; /* Ensure cursor pointer on mobile too */
}

.agent-panel:not(.collapsed) {
    transform: translateY(0);
}

/* Hover effect for collapsed panel */
.agent-panel.collapsed:hover {
    background: linear-gradient(135deg, var(--tertiary-bg), #252525);
    box-shadow: -8px 0 20px rgba(0,0,0,0.4);
}

/* Only toggle header is clickable when expanded */
.agent-panel:not(.collapsed) .agent-panel-toggle {
    cursor: pointer;
}

/* Hover effect for toggle header when expanded */
.agent-panel:not(.collapsed) .agent-panel-toggle:hover {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.agent-panel-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--tertiary-bg), #1f1f1f);
    color: var(--primary-text);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    width: 100%;
}

.agent-panel-toggle span {
    transition: opacity 0.2s 0.1s ease;
    white-space: nowrap;
}

.agent-panel.collapsed .agent-panel-toggle span {
    opacity: 0;
    width: 0;
    transition: opacity 0.1s ease, width 0.2s ease;
}

.agent-panel-content {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Ensure content doesn't block clicks when collapsed */
    pointer-events: auto;
}

/* When collapsed, make content non-interactive to allow panel clicks to work */
.agent-panel.collapsed .agent-panel-content {
    pointer-events: none;
}

/* When expanded, restore normal pointer events */
.agent-panel:not(.collapsed) .agent-panel-content {
    pointer-events: auto;
}

.agent-panel-header {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.agent-summary {
    display: flex;
    justify-content: space-around;
    gap: 0.25rem;
}

.summary-stat {
    text-align: center;
}

.stat-info .stat-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-text);
    display: block;
    line-height: 1.1;
}

.stat-info .stat-label {
    font-size: 0.7rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    white-space: nowrap;
}

.agent-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Space between agent blocks */
}

.agent-log-block {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.agent-log-block:hover {
    border-color: var(--accent-red);
    background: rgba(42, 42, 42, 0.8);
}

.agent-log-block .strategy-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-log-block .strategy-header i {
    color: var(--accent-red);
    font-size: 14px;
}

.agent-log-block .agent-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.agent-log-block .agent-status.status-running {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.agent-log-block .agent-status.status-completed {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.agent-log-block .agent-status.status-failed {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.agent-log-block .agent-status.status-idle {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
    border: 1px solid rgba(149, 165, 166, 0.3);
}

.agent-log-block .current-task {
    color: var(--secondary-text);
    font-size: 13px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.agent-log-block .current-task i {
    color: var(--accent-red);
    margin-top: 2px;
    flex-shrink: 0;
}

.agent-log-block .progress-bar {
    background: var(--secondary-bg);
    border-radius: 4px;
    height: 20px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.agent-log-block .progress-fill {
    background: linear-gradient(90deg, var(--accent-red), #ff4444);
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.agent-log-block .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-text);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.agent-log-block .agent-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--secondary-text);
}

.agent-log-block .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.agent-log-block .stat-item i {
    color: var(--accent-red);
    font-size: 11px;
}

/* Remove old unused styles */
.agent-log-block > div {
    /* This rule is now handled by specific classes above */
}

.agent-log-block .log-strategy {
    /* This class is no longer used */
    display: none;
}

.no-agents {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-text);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.no-agents i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-red);
    opacity: 0.5;
}

.no-agents p {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-text);
    margin-bottom: 0.5rem;
}

.no-agents small {
    font-size: 0.9rem;
}

.agent-error {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--secondary-text);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.agent-error i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #e74c3c;
    opacity: 0.7;
}

.agent-error p {
    font-weight: 600;
    font-size: 1rem;
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.agent-error small {
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.agent-card:hover {
    border-color: var(--accent-red);
}

/* Vis.js Graph Customizations */
.graph-container .vis-network {
    background-color: var(--primary-bg);
}

.vis-network canvas {
    background-color: transparent;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-text);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    color: var(--secondary-text);
    text-shadow: none;
    opacity: 1;
}
.modal-close:hover {
    color: var(--primary-text);
}

/* Adjustments for new structure */
#statusPanel, #chatSection, #detailsSection {
    display: flex;
    flex-direction: column;
}
#chatSection .chat-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
#chatSection .chat-messages {
    flex-grow: 1;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(250, 42, 0, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(250, 42, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 42, 0, 0); }
}
.status-indicator.running { animation: pulse 1.5s infinite; background: var(--accent-red) }

/* Final adjustments for responsive layout */
@media (max-width: 1024px) {
    .investigation-content {
        flex-direction: column;
        height: auto;
        padding-right: unset;
    }
    .right-panel {
        overflow-y: visible;
    }
    .agent-panel {
        width: 100%;
        height: 50vh;
        bottom: 0;
        top: auto;
        border-left: none;
        border-top: 1px solid var(--border-color);
        transform: translateY(calc(100% - 40px));
    }
    .agent-panel.collapsed {
        transform: translateY(calc(100% - 40px));
        cursor: pointer; /* Ensure cursor pointer on mobile too */
    }
    .agent-panel:not(.collapsed) {
        transform: translateY(0);
    }
    /* Mobile: make content non-interactive when collapsed */
    .agent-panel.collapsed .agent-panel-content {
        pointer-events: none;
    }
    /* Mobile: restore normal pointer events when expanded */
    .agent-panel:not(.collapsed) .agent-panel-content {
        pointer-events: auto;
    }
    .agent-panel-toggle {
        /* Adjust toggle for bottom panel */
        transform: none;
        top: -40px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        cursor: pointer; /* Ensure toggle is clickable on mobile */
    }
    /* Order panels: graph (left) first, agent panel second, right-panel third */
    .left-panel { order: 1; }
    .agent-panel { order: 2; }
    .right-panel { order: 3; }

    /* Disable header clickability */
    .agent-panel-toggle {
        pointer-events: none;
        cursor: default;
    }
}

.prompt-help {
    margin-top: 0.5rem;
}

.prompt-help ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
    color: var(--secondary-text);
}

.prompt-help li {
    margin-bottom: 0.25rem;
}

.setup-section .btn-primary {
    padding: 0.75rem 1.5rem; /* Adjusted padding */
    font-size: 1rem;
    font-weight: 600;
}

/* Purpose Section */
.purpose-section {
    border-top: 1px solid var(--border-color);
    background-color: var(--tertiary-bg);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.purpose-section:hover {
    background-color: #2a2a2a;
}
.purpose-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}
.purpose-header i.fa-bullseye {
    color: var(--accent-red);
}
#investigationPurpose {
    height: 150px;
    overflow-y: auto;
    font-size: 1rem;
}
.purpose-label {
    font-weight: 600;
}
.purpose-preview {
    color: var(--secondary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}
.purpose-toggle {
    background: none;
    border: none;
    color: var(--secondary-text);
    cursor: pointer;
    transition: transform 0.3s ease;
}
.purpose-toggle.expanded {
    transform: rotate(180deg);
}
.purpose-content {
    padding: 1rem 1.5rem;
    background: var(--primary-bg);
    border-top: 1px solid var(--border-color);
    color: var(--primary-text);
}

/* Status Panel */
.status-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-limit-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(250, 42, 0, 0.1);
    color: var(--accent-red);
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(250, 42, 0, 0.2);
}

.time-limit-notice i {
    font-size: 0.75rem;
}

.status-panel .status-content {
    padding: 1.5rem;
}

.status-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.status-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-indicator-large {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator-large.initialized { background: var(--warning-color); }
.status-indicator-large.running { background: var(--accent-red); }
.status-indicator-large.completed { background: var(--success-color); }
.status-indicator-large.failed { background: #e74c3c; }
.status-indicator-large.paused { background: var(--warning-color); }

.status-phase {
    color: var(--primary-text);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-duration {
    color: var(--secondary-text);
    font-size: 1rem;
    font-weight: 500;
}

.status-duration strong {
    color: var(--accent-red);
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Monaco', 'Menlo', monospace;
    letter-spacing: 0.5px;
}

.progress-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
}

.progress-info > div {
    background: var(--tertiary-bg);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    text-align: center;
}

.progress-info strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-red);
    line-height: 1.2;
    text-transform: capitalize;
    word-break: break-all;
}

.progress-info span {
    font-size: 0.7rem;
    color: var(--secondary-text);
    text-transform: uppercase;
}

/* Details Section */
.details-section {
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.details-section .panel-header {
    flex-shrink: 0;
}

/* Hide close button when in empty state */
.details-section.empty-state .btn-close {
    display: none;
}

.btn-close {
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-close:hover {
    color: var(--primary-text);
}

.details-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.details-placeholder {
    text-align: center;
    color: var(--secondary-text);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.details-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-red);
    opacity: 0.4;
}

.details-placeholder p {
    font-size: 1rem;
    font-weight: 500;
}

.detail-item {
    margin-bottom: 1.25rem;
}

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

.detail-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-label i {
    color: var(--accent-red);
}

.detail-value {
    font-size: 1rem;
    color: var(--primary-text);
    padding: 0.75rem;
    background-color: var(--tertiary-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    word-wrap: break-word;
}

.detail-value a {
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 500;
}

.detail-value a:hover {
    text-decoration: underline;
}

.detail-value.confidence-value-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: none;
    border: none;
    padding: 0;
}

.confidence-bar-bg {
    flex-grow: 1;
    height: 8px;
    background-color: var(--tertiary-bg);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.confidence-bar-fill.confidence-high { background-color: var(--success-color); }
.confidence-bar-fill.confidence-medium { background-color: var(--warning-color); }
.confidence-bar-fill.confidence-low { background-color: var(--accent-red); }

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-tag {
    background-color: var(--tertiary-bg);
    color: var(--secondary-text);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Investigation Log */
.investigation-log {
    max-width: calc(100% - 40px);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    z-index: 100;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    /* Start with just the header visible */
    transform: translateY(calc(100% - 48px));
    /* Contain scrolling within this panel */
    overscroll-behavior: contain;
}

.investigation-log.collapsed {
    transform: translateY(calc(100% - 48px));
}

.investigation-log.expanded {
    transform: translateY(0);
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--tertiary-bg), #1f1f1f);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    height: 48px;
}

.log-header:hover {
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
}

.log-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--primary-text);
}

.log-title i {
    color: var(--accent-red);
    font-size: 1.1rem;
}

.log-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.log-badge {
    background: var(--accent-red);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

.log-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.log-toggle-btn {
    background: none !important;
    border: 1px solid var(--border-color) !important;
    color: var(--secondary-text) !important;
    padding: 0.375rem 0.5rem !important;
    transition: all 0.2s ease;
}

.log-toggle-btn:hover {
    color: var(--primary-text) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.log-toggle-btn i {
    transition: transform 0.3s ease;
}

.investigation-log.expanded .log-toggle-btn i {
    transform: rotate(180deg);
}

.log-body {
    flex-grow: 1;
    overflow: hidden;
    background: var(--primary-bg);
    transition: opacity 0.3s ease;
    /* Ensure this container properly contains scrolling */
    position: relative;
    height: 0; /* Allow flex-grow to determine height */
    min-height: 200px; /* Minimum height for usability */
}

.investigation-log.collapsed .log-body {
    opacity: 0;
    pointer-events: none;
}

.investigation-log.expanded .log-body {
    opacity: 1;
    pointer-events: auto;
}

.log-messages {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    padding: 1rem;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--primary-text);
    /* Ensure scroll events are captured within this container */
    overscroll-behavior: contain;
    /* Prevent scroll from bubbling to parent */
    touch-action: pan-y;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    background: var(--tertiary-bg);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.log-entry:hover {
    background: #2a2a2a;
    transform: translateX(2px);
}

.log-entry:last-child {
    margin-bottom: 0;
}

.log-timestamp {
    color: var(--secondary-text);
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 60px;
}

.log-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    flex-shrink: 0;
}

.log-level.success {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.log-level.error {
    background: rgba(250, 42, 0, 0.15);
    color: var(--accent-red);
    border-left-color: var(--accent-red);
}

.log-level.warning {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning-color);
    border-left-color: var(--warning-color);
}

.log-level.info {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    border-left-color: #3498db;
}

.log-entry.success { border-left-color: var(--success-color); }
.log-entry.error { border-left-color: var(--accent-red); }
.log-entry.warning { border-left-color: var(--warning-color); }
.log-entry.info { border-left-color: #3498db; }

.log-message {
    color: var(--primary-text);
    flex-grow: 1;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Log Minimized State */
.log-minimized {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 99;
    animation: slideInFromBottom 0.4s ease-out;
}

.log-minimized-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--primary-text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.log-minimized-btn:hover {
    background: var(--tertiary-bg);
    border-color: var(--accent-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.log-minimized-btn i {
    color: var(--accent-red);
    font-size: 1rem;
}

.log-minimized-btn span:first-of-type {
    color: var(--primary-text);
    font-weight: 600;
}

.log-minimized .log-badge {
    font-size: 0.6875rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
}

/* Empty State */
.log-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--secondary-text);
    text-align: center;
    height: 200px;
}

.log-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-red);
    opacity: 0.3;
}

.log-empty p {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--primary-text);
}

.log-empty small {
    font-size: 0.875rem;
    color: var(--secondary-text);
}

/* Scrollbar Styling */
.log-messages::-webkit-scrollbar {
    width: 6px;
}

.log-messages::-webkit-scrollbar-track {
    background: var(--tertiary-bg);
    border-radius: 3px;
}

.log-messages::-webkit-scrollbar-thumb {
    background: var(--secondary-text);
    border-radius: 3px;
    opacity: 0.5;
}

.log-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-text);
}

/* Animations */
@keyframes slideInFromBottom {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes logEntrySlideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.log-entry {
    animation: logEntrySlideIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .investigation-log {
        max-height: 50vh;
    }
    
    .log-header {
        padding: 0.5rem 1rem;
    }
    
    .log-title h3 {
        font-size: 0.9rem;
    }
    
    .log-messages {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .log-entry {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .log-timestamp {
        min-width: auto;
    }
    
    .log-minimized {
        bottom: 0.5rem;
        right: 0.5rem;
    }
    
    .log-minimized-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* REX Report Generation Modal Styles */

/* REX Modal Base Styles */
.rex-modal {
    font-family: var(--font-primary);
}

.rex-modal-content {
    background: #2a2a2a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}

.rex-modal-header {
    background: var(--tertiary-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rex-modal-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rex-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.rex-title-text h3 {
    margin: 0;
    color: var(--primary-text);
    font-size: 1.4rem;
    font-weight: 600;
}

.rex-subtitle {
    margin: 0;
    color: var(--secondary-text);
    font-size: 0.9rem;
    font-weight: 400;
}

.rex-modal-close {
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.rex-modal-close:hover {
    background: var(--tertiary-bg);
    color: var(--primary-text);
}

/* REX Modal Body */
.rex-modal-body {
    padding: 0;
}

.rex-conversation-area {
    padding: 2rem;
}

/* REX Speech Bubble */
.rex-speech-bubble {
    position: relative;
    margin-bottom: 2rem;
}

.speech-bubble-content {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
}

.speech-bubble-content p {
    margin: 0;
    color: var(--primary-text);
    line-height: 1.5;
}

.speech-bubble-content strong {
    color: var(--accent-red);
}

.speech-bubble-arrow {
    position: absolute;
    bottom: -8px;
    left: 2rem;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--border-color);
}

.speech-bubble-arrow::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: -7px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid var(--tertiary-bg);
}

/* User Input Section */
.user-input-section {
    margin-bottom: 2rem;
}

.rex-input-label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--primary-text);
    font-weight: 500;
    font-size: 1rem;
}

.rex-textarea {
    width: 100%;
    background: var(--primary-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: var(--primary-text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
}

.rex-textarea:focus {
    outline: none;
    border-color: var(--accent-red);
    background: var(--secondary-bg);
}

.rex-textarea::placeholder {
    color: var(--secondary-text);
    font-style: italic;
}

/* REX Suggestions */
.rex-input-help {
    margin-top: 1rem;
}

.rex-suggestions p {
    margin: 0 0 0.75rem 0;
    color: var(--primary-text);
    font-weight: 500;
    font-size: 0.9rem;
}

.suggestion-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.suggestion-btn {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--primary-text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
}

.suggestion-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
    transform: translateY(-1px);
}

/* Character Counter */
.character-counter {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--secondary-text);
}

/* REX Preferences */
.rex-preferences {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.preferences-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--primary-text);
    font-weight: 500;
}

.preferences-header i {
    color: var(--accent-red);
}

.preference-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preference-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 6px;
    transition: var(--transition);
}

.preference-item:hover {
    background: var(--tertiary-bg);
}

.preference-item input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-red);
}

.preference-content strong {
    display: block;
    color: var(--primary-text);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.preference-content span {
    color: var(--secondary-text);
    font-size: 0.85rem;
}

/* REX Loading States */
.rex-report-loading {
    padding: 3rem 2rem;
    text-align: center;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.rex-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.rex-avatar-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #FA2A00 0%, #e02400 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 16px rgba(250, 42, 0, 0.2);
    animation: pulse 2s infinite;
}

.rex-loading-text h4 {
    margin: 0 0 0.5rem 0;
    color: #FA2A00;
    font-size: 1.3rem;
    font-weight: 700;
}

.rex-loading-text p {
    margin: 0;
    color: #ccc;
    font-size: 1rem;
    line-height: 1.5;
}

.rex-progress-indicator {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.progress-dots {
    display: flex;
    gap: 0.5rem;
}

.progress-dots span {
    width: 12px;
    height: 12px;
    background: #FA2A00;
    border-radius: 50%;
    animation: pulseDot 1.5s ease-in-out infinite;
}

.progress-dots span:nth-child(2) { animation-delay: 0.3s; }
.progress-dots span:nth-child(3) { animation-delay: 0.6s; }

@keyframes pulseDot {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* REX Report Display */
.rex-report-display {
    border-top: 1px solid var(--border-color);
    background: var(--primary-bg);
}

.rex-report-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.rex-completion-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.rex-avatar-small {
    width: 32px;
    height: 32px;
    background: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.completion-text h4 {
    margin: 0;
    color: var(--primary-text);
    font-size: 1.1rem;
    font-weight: 600;
}

.completion-text p {
    margin: 0.25rem 0 0 0;
    color: var(--secondary-text);
    font-size: 0.85rem;
}

.rex-report-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.rex-inline-report-content {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--secondary-bg);
}

/* REX Modal Footer */
.rex-modal-footer {
    background: var(--tertiary-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    border-radius: 0 0 12px 12px;
}

/* REX Button Styles */
.rex-btn-primary {
    background: var(--accent-red);
    border: 1px solid var(--accent-red);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.rex-btn-primary:hover:not(:disabled) {
    background: var(--accent-red-hover);
    border-color: var(--accent-red-hover);
    transform: translateY(-1px);
}

.rex-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.rex-btn-secondary {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-text);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.rex-btn-secondary:hover:not(:disabled) {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .rex-modal-content {
        width: 98%;
        max-height: 95vh;
        margin: 1rem;
    }
    
    .rex-modal-header {
        padding: 1rem;
    }
    
    .rex-conversation-area {
        padding: 1.5rem;
    }
    
    .rex-modal-title {
        gap: 0.75rem;
    }
    
    .rex-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .rex-title-text h3 {
        font-size: 1.2rem;
    }
    
    .suggestion-buttons {
        grid-template-columns: 1fr;
    }
    
    .rex-report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .rex-report-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .rex-modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Specific styling for Ask REX for Report button */
#generate-report-btn {
    background-color:#1A1A1A !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

#generate-report-btn:hover:not(:disabled) {
    background-color: rgb(90, 90, 90) !important;
    border-color: rgb(90, 90, 90) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Modal styles for pause/resume dialogs */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal-overlay .modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-overlay .modal-header {
    background: #2a2a2a;
    padding: 20px;
    border-bottom: 1px solid #333;
    border-radius: 8px 8px 0 0;
}

.modal-overlay .modal-header h3 {
    margin: 0;
    color: #FA2A00;
    font-size: 1.3em;
    font-weight: 600;
}

.modal-overlay .modal-body {
    padding: 20px;
}

.modal-overlay .modal-body p {
    margin: 0 0 20px 0;
    color: #ccc;
    line-height: 1.5;
}

/* Continue/Resume/New Options */
.continue-options,
.resume-options,
.new-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.continue-options .btn,
.resume-options .btn,
.new-options .btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    text-align: left;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.continue-options .btn:hover,
.resume-options .btn:hover,
.new-options .btn:hover {
    background: #333;
    border-color: #FA2A00;
    transform: translateY(-1px);
}

.continue-options .btn.btn-primary,
.resume-options .btn.btn-primary,
.new-options .btn.btn-primary {
    background: #FA2A00;
    border-color: #FA2A00;
}

.continue-options .btn.btn-primary:hover,
.resume-options .btn.btn-primary:hover,
.new-options .btn.btn-primary:hover {
    background: #e02400;
    border-color: #e02400;
}

.continue-options .btn i,
.resume-options .btn i,
.new-options .btn i {
    margin-bottom: 6px;
    font-size: 16px;
}

.continue-options .btn small,
.resume-options .btn small,
.new-options .btn small {
    color: #aaa;
    font-size: 12px;
    margin-top: 4px;
    font-weight: normal;
}

/* Logs Modal Styles */
.logs-modal-content {
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
}

.logs-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: flex-end;
}

.logs-container {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    max-height: 60vh;
    overflow: hidden;
}

.logs-messages {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.logs-messages .log-entry {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid transparent;
}

.logs-messages .log-entry.info {
    background: rgba(52, 152, 219, 0.1);
    border-left-color: #3498db;
    color: #3498db;
}

.logs-messages .log-entry.success {
    background: rgba(46, 204, 113, 0.1);
    border-left-color: #2ecc71;
    color: #2ecc71;
}

.logs-messages .log-entry.warning {
    background: rgba(241, 196, 15, 0.1);
    border-left-color: #f1c40f;
    color: #f1c40f;
}

.logs-messages .log-entry.error {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: #e74c3c;
    color: #e74c3c;
}

.logs-messages .log-timestamp {
    color: #7f8c8d;
    font-size: 11px;
    margin-right: 8px;
}

.logs-messages .log-message {
    color: inherit;
}

.logs-messages .log-empty {
    text-align: center;
    color: #7f8c8d;
    padding: 40px 20px;
}

.logs-messages .log-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Enhanced Graph Controls */
.graph-controls {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(250, 42, 0, 0.05);
}

.graph-controls:hover {
    box-shadow: 0 4px 12px rgba(250, 42, 0, 0.1);
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(26, 26, 26, 0.8);
    border-radius: 12px 12px 0 0;
}

.controls-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls-title i {
    color: var(--accent-red);
    font-size: 14px;
}

.controls-reset-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--tertiary-bg);
    color: var(--secondary-text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.controls-reset-btn:hover {
    background: var(--secondary-bg);
    border-color: var(--accent-red);
    color: var(--primary-text);
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-text);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.control-group label i {
    color: var(--accent-red);
    font-size: 12px;
    width: 14px;
}

/* Text Filter Styles */
.text-filter-container {
    position: relative;
    display: flex;
    align-items: center;
}

.text-filter-input {
    width: 100%;
    padding: 10px 12px;
    padding-right: 35px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--tertiary-bg);
    color: var(--primary-text);
    transition: all 0.2s ease;
}

.text-filter-input:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(250, 42, 0, 0.1);
}

.text-filter-input.has-text {
    border-color: var(--success-color);
    background: var(--tertiary-bg);
}

.text-filter-clear {
    position: absolute;
    right: 8px;
    padding: 4px;
    border: none;
    background: none;
    color: var(--secondary-text);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.text-filter-clear:hover {
    background: var(--secondary-bg);
    color: var(--primary-text);
}

.filter-help-text {
    font-size: 11px;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.filter-help-text i {
    font-size: 10px;
}

/* Enhanced Filter Select */
.filter-select {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--tertiary-bg);
    color: var(--primary-text);
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(250, 42, 0, 0.1);
}

.filter-count {
    font-size: 11px;
    color: var(--secondary-text);
    margin-top: 2px;
    font-weight: 500;
}

/* Enhanced Confidence Control */
.confidence-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.confidence-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.confidence-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-red);
    cursor: pointer;
    border: 2px solid var(--tertiary-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.confidence-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-red);
    cursor: pointer;
    border: 2px solid var(--tertiary-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.confidence-value {
    min-width: 45px;
    font-weight: 600;
    color: var(--primary-text);
    background: var(--tertiary-bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.confidence-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--secondary-text);
    margin-top: 2px;
}

/* Visibility Controls */
.visibility-controls {
    display: flex;
    gap: 8px;
}

.visibility-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--tertiary-bg);
    color: var(--secondary-text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.visibility-btn:hover {
    background: var(--secondary-bg);
    border-color: var(--accent-red);
    color: var(--primary-text);
}

.visibility-btn.active {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.visibility-btn i {
    font-size: 10px;
}

/* Filter Summary */
.filter-summary {
    border-top: 1px solid var(--border-color);
    background: rgba(250, 42, 0, 0.05);
    border-radius: 0 0 12px 12px;
}

.filter-summary-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.filter-summary-text {
    font-size: 12px;
    color: var(--primary-text);
    font-weight: 500;
}

.filter-summary-clear {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    background: var(--tertiary-bg);
    color: var(--secondary-text);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-summary-clear:hover {
    background: var(--secondary-bg);
    border-color: var(--accent-red);
    color: var(--primary-text);
}

/* Mobile Responsive for Graph Controls */
@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .controls-header {
        padding: 12px 15px;
    }
    
    .controls-title {
        font-size: 14px;
    }
    
    .controls-reset-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .visibility-controls {
        flex-direction: column;
        gap: 6px;
    }
    
    .filter-summary-content {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        padding: 10px 15px;
    }
}

/* --- Modal Overlay Styles for Report Generation Modal --- */
.rex-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
}
.rex-modal-content, .rex-modal-content.large-modal {
    background: #111;
    border-radius: 12px;
    max-width: 95vw;
    max-height: 90vh;
    width: 600px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    overflow-y: auto;
    color: #fff;
    position: relative;
}
.rex-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10001;
}
@media (max-width: 700px) {
    .rex-modal-content, .rex-modal-content.large-modal {
        width: 98vw;
        padding: 1rem;
    }
}
/* Ensure modal overlays everything */
body > .rex-modal { z-index: 10000 !important; }

/* --- Redesigned Report Generation Modal Styles --- */
.rex-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    z-index: 10000;
    font-family: var(--font-primary);
}
.rex-modal-content, .rex-modal-content.large-modal {
    background: #181818;
    border-radius: 18px;
    max-width: 480px;
    width: 95vw;
    max-height: 92vh;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    overflow-y: auto;
    color: #fff;
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.rex-modal-header {
    background: #232323;
    border-radius: 18px 18px 0 0;
    padding: 2rem 2rem 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}
.rex-modal-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-text);
    letter-spacing: 0.5px;
}
.rex-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.2s;
}
.rex-modal-close:hover {
    color: var(--accent-red);
}
.rex-modal-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.report-form-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.form-group label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 0.25rem;
}
#reportPrompt {
    width: 100%;
    min-height: 90px;
    max-height: 200px;
    resize: vertical;
    background: #232323;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    padding: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
#reportPrompt:focus {
    border-color: var(--accent-red);
    outline: none;
}
.char-counter {
    font-size: 0.9rem;
    color: var(--secondary-text);
    text-align: right;
    margin-top: 0.25rem;
}
.rex-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}
#generateReportBtn {
    background: var(--accent-red);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#generateReportBtn:hover:not(:disabled) {
    background: var(--accent-red-hover);
    transform: translateY(-2px);
}
#cancelReportBtn {
    background: #232323;
    color: #fff;
    border: 1.5px solid var(--border-color);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
#cancelReportBtn:hover {
    background: #292929;
    border-color: var(--accent-red);
    color: var(--accent-red);
}
/* Loading and Report Display Areas */
.report-loading-area, .report-display-area {
    padding: 2rem 0 0 0;
}
.report-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
#downloadReportBtn, #printReportBtn, #newReportBtn {
    background: #232323;
    color: #fff;
    border: 1.5px solid var(--border-color);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#downloadReportBtn:hover, #printReportBtn:hover, #newReportBtn:hover {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--accent-red);
}
#reportContent {
    background: #181818;
    border-radius: 8px;
    padding: 1.5rem;
    color: #fff;
    font-size: 1rem;
    max-height: 40vh;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
@media (max-width: 600px) {
    .rex-modal-content, .rex-modal-content.large-modal {
        max-width: 99vw;
        padding: 0;
    }
    .rex-modal-header, .rex-modal-body {
        padding: 1rem;
    }
    .report-form-area, .report-loading-area, .report-display-area {
        padding: 1rem 0 0 0;
    }
    #reportContent {
        padding: 1rem;
    }
    .rex-modal-header h2 {
        font-size: 1.3rem;
    }
    #generateReportBtn, #cancelReportBtn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

/* Enhanced Strategy Display Styles */
.agent-log-block .strategy-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 0.25rem;
}

.agent-log-block .strategy-header i {
    color: var(--accent-red);
    width: 16px;
    text-align: center;
    font-size: 1rem;
}

.agent-log-block .strategy-priority {
    font-size: 0.75rem;
    color: var(--secondary-text);
    margin-left: 1.25rem;
    opacity: 0.8;
}

/* ==========================================
   INVESTIGATION TIMELINE STYLES - PROJECT REX DESIGN
   ========================================== */

.investigation-timeline {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Timeline Header */
.timeline-header {
    background: var(--tertiary-bg);
    color: var(--primary-text);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.timeline-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-text);
    display: inline;
    margin-left: 10px;
}

.timeline-header h3 i {
    font-size: 1rem;
    color: var(--accent-red);
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timeline-count {
    background: rgba(250, 42, 0, 0.1);
    color: var(--accent-red);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(250, 42, 0, 0.2);
}

.timeline-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-toggle:hover {
    background: var(--tertiary-bg);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.timeline-toggle i {
    transition: transform 0.3s ease;
}

.timeline-collapsed .timeline-toggle i {
    transform: rotate(180deg);
}

/* Timeline Container */
.timeline-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--secondary-bg);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.timeline-collapsed .timeline-container {
    display: none;
}

/* Custom Scrollbar for Timeline */
.timeline-container::-webkit-scrollbar {
    width: 6px;
}

.timeline-container::-webkit-scrollbar-track {
    background: var(--tertiary-bg);
    border-radius: 3px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: rgba(250, 42, 0, 0.3);
    border-radius: 3px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: rgba(250, 42, 0, 0.5);
}

/* Empty State */
.timeline-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--secondary-text);
}

.timeline-empty-state i {
    font-size: 3rem;
    color: var(--accent-red);
    margin-bottom: 1rem;
    display: block;
    opacity: 0.6;
}

.timeline-empty-state p {
    margin: 0;
    font-size: 1rem;
    color: var(--secondary-text);
    line-height: 1.5;
}

/* Timeline Entries */
.timeline-entry {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 2rem;
    animation: timelineEntryFadeIn 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.timeline-entry:last-child {
    margin-bottom: 0;
}

.timeline-entry.timeline-entry-new {
    animation: timelineEntrySlideIn 0.8s ease forwards;
}

@keyframes timelineEntryFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes timelineEntrySlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    50% {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: 0 0 20px rgba(250, 42, 0, 0.2);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: none;
    }
}

/* Timeline Marker */
.timeline-marker {
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--accent-red);
    border: 3px solid var(--secondary-bg);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--accent-red);
    z-index: 2;
}

.timeline-marker::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: 2px;
    height: 2rem;
    background: linear-gradient(to bottom, var(--accent-red), rgba(250, 42, 0, 0.2));
    z-index: 1;
}

.timeline-entry:last-child .timeline-marker::after {
    display: none;
}

/* Timeline Content */
.timeline-content {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.timeline-content:hover {
    border-color: rgba(250, 42, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.timeline-entry-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.timeline-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-text);
    line-height: 1.4;
    flex: 1;
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--accent-red);
    white-space: nowrap;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(250, 42, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(250, 42, 0, 0.2);
}

.timeline-time i {
    font-size: 0.7rem;
}

.timeline-summary {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--secondary-text);
    line-height: 1.6;
}

/* Key Developments */
.timeline-developments {
    margin-bottom: 1rem;
}

.developments-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-red);
}

.developments-header i {
    font-size: 0.75rem;
}

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

.development-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary-text);
    line-height: 1.5;
}

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

.development-item::before {
    content: '•';
    color: var(--accent-red);
    font-weight: bold;
    font-size: 1rem;
    line-height: 1;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* Timeline Stats */
.timeline-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.timeline-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--secondary-text);
}

.timeline-stat i {
    font-size: 0.75rem;
    color: var(--accent-red);
}

/* Evidence Count */
.evidence-count {
    font-weight: 600;
}

/* Confidence Trend */
.confidence-trend {
    font-weight: 500;
}

.confidence-trend.trend-increasing {
    color: var(--success-color);
}

.confidence-trend.trend-increasing i {
    color: var(--success-color);
}

.confidence-trend.trend-stable {
    color: var(--warning-color);
}

.confidence-trend.trend-stable i {
    color: var(--warning-color);
}

.confidence-trend.trend-decreasing {
    color: var(--accent-red);
}

.confidence-trend.trend-decreasing i {
    color: var(--accent-red);
}

.confidence-trend.trend-initial {
    color: var(--secondary-text);
}

.confidence-trend.trend-initial i {
    color: var(--secondary-text);
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .timeline-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .timeline-container {
        padding: 1rem;
        max-height: 400px;
    }
    
    .timeline-entry {
        padding-left: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .timeline-marker {
        width: 0.75rem;
        height: 0.75rem;
    }
    
    .timeline-content {
        padding: 1rem;
    }
    
    .timeline-entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .timeline-time {
        align-self: flex-end;
    }
    
    .timeline-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .timeline-header h3 {
        font-size: 1rem;
    }
    
    .timeline-title {
        font-size: 0.9rem;
    }
    
    .timeline-summary {
        font-size: 0.85rem;
    }
    
    .development-item {
        font-size: 0.8rem;
    }
    
    .timeline-container {
        max-height: 300px;
    }
    
    .timeline-empty-state {
        padding: 2rem 1rem;
    }
    
    .timeline-empty-state i {
        font-size: 2.5rem;
    }
    
    .timeline-stats {
        gap: 0.75rem;
    }
    
    .evidence-count {
        font-size: 0.75rem;
    }
}

/* Enhanced Chat Response Styling */
.message-content h3 {
    color: var(--primary-text);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.75rem 0 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.25rem;
}

.message-content h4 {
    color: var(--primary-text);
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0 0.25rem 0;
}

.message-content p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.message-content ul, .message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.message-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-red);
}

/* Structured Chat Response Components */
.message-content .evidence-summary {
    background: rgba(250, 42, 0, 0.1);
    border: 1px solid rgba(250, 42, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
}

.message-content .confidence-indicator {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent-red);
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 0 4px 4px 0;
}

.message-content .investigation-insight {
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
}

.message-content .next-steps {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
}

/* Confidence Level Indicators */
.message-content .confidence-high {
    color: var(--success-color);
    font-weight: 600;
}

.message-content .confidence-medium {
    color: var(--warning-color);
    font-weight: 600;
}

.message-content .confidence-low {
    color: var(--accent-red);
    font-weight: 600;
}

/* Evidence Type Indicators */
.message-content [class*="evidence-type-"] {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.1rem;
}

.message-content .evidence-type-name {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.message-content .evidence-type-email {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.message-content .evidence-type-phone {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.message-content .evidence-type-address {
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
}

.message-content .evidence-type-social {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.message-content .evidence-type-professional {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.message-content .evidence-type-company {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
}

/* Enhanced Evidence Citation Links */
.evidence-citation {
    color: var(--accent-red);
    text-decoration: underline;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    display: inline-block;
}

.evidence-citation:hover {
    color: #fff;
    background: var(--accent-red);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(250, 42, 0, 0.3);
}

/* Responsive Chat Response Styling */
@media (max-width: 768px) {
    .message-content .evidence-summary,
    .message-content .confidence-indicator,
    .message-content .investigation-insight,
    .message-content .next-steps {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }
    
    .message-content h3 {
        font-size: 1rem;
    }
    
    .message-content h4 {
        font-size: 0.9rem;
    }
}

/* Strategy Change Animations and Indicators */
.strategy-changing {
    animation: strategyPulse 1s ease-in-out;
    border: 1px solid var(--accent-red);
    border-radius: 4px;
    padding: 2px 4px;
}

@keyframes strategyPulse {
    0% { 
        background-color: transparent; 
        transform: scale(1);
    }
    50% { 
        background-color: rgba(250, 42, 0, 0.1); 
        transform: scale(1.05);
    }
    100% { 
        background-color: transparent; 
        transform: scale(1);
    }
}

.strategy-change-indicator {
    position: absolute;
    top: -8px;
    right: 8px;
    background: var(--accent-red);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 10;
    animation: strategyChangeSlideIn 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(250, 42, 0, 0.3);
}

.strategy-change-indicator i {
    margin-right: 4px;
    animation: spin 1s linear infinite;
}

@keyframes strategyChangeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Enhanced agent header positioning for change indicator */
.agent-header {
    position: relative;
}

/* Strategy element styling */
.agent-strategy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.strategy-icon {
    transition: all 0.3s ease;
}

.strategy-text {
    transition: all 0.3s ease;
}

/* Daily Usage Information */
.daily-usage-info {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.usage-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.usage-header i {
    color: var(--accent-red);
    font-size: 1.25rem;
}

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

.usage-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.usage-count, .usage-remaining {
    text-align: center;
    padding: 1rem;
    background: var(--tertiary-bg);
    border-radius: var(--border-radius);
    flex: 1;
}

.usage-count .count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-red);
}

.usage-count .limit {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary-text);
}

.usage-remaining .remaining {
    font-size: 2rem;
    font-weight: 700;
    color: var(--success-color);
}

.usage-count .label, .usage-remaining .label {
    display: block;
    font-size: 0.875rem;
    color: var(--secondary-text);
    margin-top: 0.25rem;
}

.usage-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--tertiary-bg);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    color: var(--secondary-text);
}

.usage-reset i {
    color: var(--warning-color);
}

@media (max-width: 768px) {
    .daily-usage-info {
        margin: 1rem;
        padding: 1rem;
    }
    
    .usage-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .usage-header h3 {
        font-size: 1rem;
    }
    
    .usage-count .count, .usage-remaining .remaining {
        font-size: 1.5rem;
    }
}

/* Message Container - System Messages */
.message-container {
    position: fixed;
    top: 125px; /* Below nav (60px) + header (65px) */
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    max-width: 600px;
    width: 90%;
    pointer-events: none; /* Allow clicks through container */
}

.message-container .message {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: messageSlideIn 0.3s ease-out;
    pointer-events: auto; /* Allow clicks on messages */
    backdrop-filter: blur(10px);
}

.message-container .message.info {
    border-left: 4px solid #3498db;
}

.message-container .message.success {
    border-left: 4px solid var(--success-color);
}

.message-container .message.error {
    border-left: 4px solid var(--accent-red);
}

.message-container .message.warning {
    border-left: 4px solid var(--warning-color);
}

.message-container .message i {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.message-container .message.info i {
    color: #3498db;
}

.message-container .message.success i {
    color: var(--success-color);
}

.message-container .message.error i {
    color: var(--accent-red);
}

.message-container .message.warning i {
    color: var(--warning-color);
}

.message-container .message span {
    flex: 1;
    color: var(--primary-text);
    font-size: 0.9rem;
    line-height: 1.4;
}

.message-container .message .close-btn {
    background: none;
    border: none;
    color: var(--secondary-text);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.message-container .message .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-text);
}

.message-container .message .close-btn i {
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .message-container {
        top: 115px; /* Adjust for mobile nav height */
        width: 95%;
        max-width: none;
    }
    
    .message-container .message {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .message-container .message i {
        font-size: 1rem;
    }
}

/* === Live Agent Panel Responsive Behaviour === */
/* Desktop (width >= 1025px): side-panel that slides horizontally */
@media (min-width: 1025px) {
    .agent-panel {
        top: 121px; /* unchanged */
        right: 0;
        height: calc(100vh - 121px);
        width: 340px;
    }
    .agent-panel.collapsed {
        /* Hide almost completely outside viewport, leave 40px handle */
        transform: translateX(calc(100% - 40px));
    }
}

/* Mobile / Tablet (width <= 1024px): always shown, stacked under sections */
@media (max-width: 1024px) {
    .agent-panel {
        position: relative;
        width: 100%;
        height: auto;
        top: 0;
        right: auto;
        transform: translateX(0) !important;
        border-left: none;
        border-top: 1px solid var(--border-color);
        box-shadow: none;
    }
    .agent-panel.collapsed {
        transform: none;
        cursor: default;
    }
}

/* Evidence List Styles */
.evidence-and-graph-container {
    display: flex;
    gap: 1rem;
    height: 100%;
    min-height: 400px;
}

.evidence-list-section {
    width: 350px;
    min-width: 300px;
    max-width: 400px;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.evidence-list-section.collapsed {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    overflow: hidden;
}

.evidence-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-primary);
    border-radius: 8px 8px 0 0;
    position: relative;
    z-index: 1;
}

.evidence-list-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.evidence-count-badge {
    background: var(--accent-red);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.evidence-list-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s ease;
    border-radius: 4px;
}

.evidence-list-toggle i {
    transition: transform 0.3s ease;
}

.evidence-list-toggle:hover {
    color: var(--primary-text);
    background: var(--background-secondary);
}

.evidence-list-section.collapsed .evidence-list-toggle i {
    transform: rotate(180deg);
}

.evidence-list-section.collapsed .evidence-list-header {
    justify-content: center;
    padding: 0.75rem;
}

.evidence-list-section.collapsed .evidence-list-header h4,
.evidence-list-section.collapsed .evidence-count-badge {
    display: none;
}

.evidence-list-content {
    flex: 1;
    padding: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.evidence-list-section.collapsed .evidence-list-content {
    display: none;
}

.evidence-search-container {
    position: relative;
    margin-bottom: 1rem;
}

.evidence-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-primary);
    color: var(--primary-text);
    font-size: 0.875rem;
    transition: border-color 0.3s ease;
}

.evidence-search-input:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(255, 75, 75, 0.1);
}

.evidence-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 3px;
    transition: color 0.3s ease;
}

.evidence-search-clear:hover {
    color: var(--primary-text);
}

.evidence-type-filter {
    margin-bottom: 1rem;
}

.evidence-type-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-primary);
    color: var(--primary-text);
    font-size: 0.875rem;
}

.evidence-items-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
    padding-top: 5px;
    max-height: 500px;
}

.evidence-items-container::-webkit-scrollbar {
    width: 6px;
}

.evidence-items-container::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 3px;
}

.evidence-items-container::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.evidence-items-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-text);
}

.evidence-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.evidence-empty-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.evidence-empty-state p {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.evidence-empty-state small {
    opacity: 0.7;
    line-height: 1.4;
}

.evidence-item {
    background: var(--background-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.evidence-item:hover {
    border-color: var(--accent-red);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.evidence-item.selected {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(255, 75, 75, 0.1);
    background: rgba(255, 75, 75, 0.02);
}

.evidence-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.evidence-item-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-red);
}

.evidence-item-type i {
    font-size: 1rem;
}

.evidence-item-confidence {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.evidence-item-confidence-bar {
    width: 30px;
    height: 6px;
    background: var(--background-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.evidence-item-confidence-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.evidence-item-confidence-fill.confidence-high {
    background: var(--success-color);
}

.evidence-item-confidence-fill.confidence-medium {
    background: var(--warning-color);
}

.evidence-item-confidence-fill.confidence-low {
    background: var(--accent-red);
}

.evidence-item-content {
    font-size: 0.875rem;
    color: var(--primary-text);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.evidence-item-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.evidence-item-source i {
    font-size: 0.75rem;
}

.evidence-item-source a {
    color: var(--text-muted);
    text-decoration: none;
}

.evidence-item-source a:hover {
    color: var(--accent-red);
}

.evidence-item-new {
    animation: evidenceItemSlideIn 0.3s ease;
}

@keyframes evidenceItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Graph container adjustments */
.graph-container {
    flex: 1;
    min-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-primary);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .evidence-and-graph-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .evidence-list-section {
        width: 100%;
        max-width: none;
        order: 2;
    }
    
    .evidence-list-section.collapsed {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: 60px;
        overflow: hidden;
    }
    
    .evidence-list-section.collapsed .evidence-list-header {
        justify-content: space-between;
        padding: 0.75rem;
    }
    
    .evidence-list-section.collapsed .evidence-list-header h4,
    .evidence-list-section.collapsed .evidence-count-badge {
        display: flex;
    }
    
    .evidence-list-header {
        padding: 0.75rem;
    }
    
    .evidence-list-content {
        padding: 0.75rem;
    }
    
    .evidence-item {
        padding: 0.75rem;
    }
    
    .graph-container {
        order: 1;
        min-height: 300px;
    }
}
