@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Orbitron:wght@400;500;600;700;800;900&display=swap');


/* Neon & Glassmorphism UI Styling */
:root {
    /* Core Colors */
    --bg-color: #050510;
    --glass-bg: rgba(15, 15, 25, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);

    /* Neon Palette */
    --neon-green: #39FF14;
    --neon-magenta: #FF00FF;
    --neon-purple: #9D00FF;
    --neon-lime: #CCFF00;
    --neon-red: #FF0033;
    --neon-cyan: #00F0FF;
    --neon-yellow: #FFFF00;
    --neon-orange: #FF6600;

    /* Text */
    --text-main: #ffffff;
    --text-dim: #a0a0b0;

    /* Spacing */
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;

    /* Effects */
    --blur-amount: 12px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --neon-glow: 0 0 10px rgba(57, 255, 20, 0.3);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 50% 50%, rgba(20, 20, 40, 0.5) 0%, transparent 100%);
    color: var(--text-main);
    font-family: 'Orbitron', 'Inter', 'Segoe UI', sans-serif;
    /* Using Orbitron everywhere for full cyberpunk aesthetic */
    -webkit-font-smoothing: antialiased;
}
/* --- Layout Containers --- */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
#canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
/* --- Top Info Bar --- */
#info-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-bottom: 1px solid var(--glass-border);
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    z-index: 100;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-lg);
}
#info-bar span {
    display: flex;
    align-items: center;
    color: var(--text-dim);
}
#info-bar span strong,
#info-bar span b {
    /* Catching any bold tags */
    color: var(--text-main);
    margin-left: 5px;
    font-weight: 600;
}
.toggle-render-btn {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    position: relative;
    z-index: 101;
    pointer-events: auto;
}
.toggle-render-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
    transform: scale(1.05);
}
.toggle-render-btn.rendering-disabled {
    border-color: rgba(255, 0, 51, 0.5);
    color: var(--neon-red);
}
.toggle-render-btn.rendering-disabled:hover {
    border-color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 0, 51, 0.3);
}
/* --- Bottom Controls --- */
#controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-top: 1px solid var(--glass-border);
    z-index: 100;
    box-shadow: var(--shadow-lg);
}
#controls label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
/* Range Inputs */
input[type="range"] {
    -webkit-appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--neon-cyan);
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-cyan);
    transition: transform 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
/* Checkboxes */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}
input[type="checkbox"]:checked {
    background: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
}
input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    font-weight: bold;
}
/* Buttons */
button {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 16px; /* Larger for emoji visibility */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
}
#clearStorage {
    border-color: rgba(255, 0, 51, 0.3);
}
#clearStorage:hover {
    border-color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 0, 51, 0.3);
    color: var(--neon-red);
}
/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 60px; /* Start below the info-bar */
    right: 0;
    bottom: 80px; /* Leave space for controls */
    width: 340px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-left: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
}
.sidebar.collapsed {
    transform: translateX(100%);
}
.sidebar-header {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
}
.sidebar-header h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
/* Ensure agent sidebar content scrolls properly and doesn't overlap */
#agent-sidebar .sidebar-content {
    padding: 12px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
}
/* Sidebar Toggle */
.sidebar-toggle {
    position: fixed;
    top: 63px; /* Positioned below the info bar */
    right: 20px;
    z-index: 1100;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}
.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    transform: scale(1.05);
}
/* Move toggle button to appear within sidebar when expanded */
.sidebar:not(.collapsed) ~ .sidebar-toggle {
    right: 12px;
}
/* Agent Details Sidebar - Higher z-index to appear above main sidebar */
#agent-sidebar {
    z-index: 1200; /* Higher than main sidebar (1000) and sidebar toggle (1100) */
    width: 400px; /* Wider to accommodate 3-column grid with more breathing room */
    max-width: 90vw; /* Responsive on small screens */
}
/* Ensure agent sidebar content scrolls properly and doesn't overlap */
#agent-sidebar .sidebar-content {
    padding: 12px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
#agent-sidebar .sidebar-close-btn {
    z-index: 1300; /* Ensure close button is above everything */
}
#agent-sidebar:not(.collapsed) {
    z-index: 1200; /* Ensure agent sidebar stays above main sidebar when open */
}
/* Hide main sidebar toggle when agent sidebar is open */
#agent-sidebar:not(.collapsed) ~ #sidebar-toggle {
    display: none !important;
}
/* Agent Details Sidebar Styles */
.agent-details .agent-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.agent-details .agent-type-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.agent-details .agent-generation {
    font-size: 9px;
    color: var(--text-dim);
    font-weight: 500;
}
.agent-details .stats-section {
    margin-bottom: 14px;
    break-inside: avoid;
}
.agent-details .stats-section h4 {
    color: var(--neon-cyan);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 6px 0;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 2px;
}
.agent-details .agent-stats-grid.compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}
.agent-details .agent-stats-grid.compact .stat-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 5px 6px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 32px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}
/* Special handling for stats with bars (like energy) - keep vertical layout */
.agent-details .agent-stats-grid.compact .stat-item.has-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 5px 6px;
    min-height: 40px;
    grid-column: span 3; /* Energy bar spans full width */
}
.agent-details .agent-stats-grid.compact .stat-label {
    font-size: 8px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-bottom: 2px;
    line-height: 1.2;
}
.agent-details .agent-stats-grid.compact .stat-value {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-main);
    text-align: left;
    flex-shrink: 1;
    line-height: 1.3;
    word-break: break-all;
    width: 100%;
    overflow-wrap: break-word;
    hyphens: auto;
}
/* Special styling for stats with bars */
.agent-details .agent-stats-grid.compact .stat-item.has-bar .stat-label {
    margin-bottom: 2px;
}
.agent-details .agent-stats-grid.compact .stat-item.has-bar .stat-value {
    text-align: left;
    margin-top: 2px;
}
.agent-details .agent-stats-grid.compact .stat-bar-container {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 2px 0;
    overflow: hidden;
}
.agent-details .agent-stats-grid.compact .stat-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
    border-radius: 2px;
    transition: width 0.3s ease;
}
.agent-details .nn-viz-container {
    margin-top: 6px;
}
.agent-details .nn-viz-container canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 280px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-close-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1300;
}
.sidebar-close-btn:hover {
    color: var(--neon-red);
    background: rgba(255, 0, 51, 0.1);
}
.sidebar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.sidebar-save-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-save-btn:hover:not(:disabled) {
    color: var(--neon-green);
    background: rgba(57, 255, 20, 0.1);
}
.sidebar-save-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5 !important;
}
/* Metric Cards */
.metric-card,
.metric-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.metric-card:hover,
.metric-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.04);
}
.card-header,
.group-header {
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body,
.group-body {
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-dim);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.card-body div,
.group-body div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    min-height: 18px;
    flex-wrap: wrap;
    gap: 4px;
}
.card-body div:last-child,
.group-body div:last-child {
    margin-bottom: 0;
}
.card-body div.metric-divider,
.group-body div.metric-divider {
    margin: 0;
    min-height: 1px;
    height: 1px;
    display: block;
}
.card-body div strong,
.group-body div strong {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}
/* Card Variants */
.metric-card.critical {
    border-left: 3px solid var(--neon-red);
}
.metric-card.critical .card-header {
    color: var(--neon-red);
}
.metric-card.reproduction {
    border-left: 3px solid var(--neon-magenta);
}
.metric-card.reproduction .card-header {
    color: var(--neon-magenta);
}
.metric-card.navigation {
    border-left: 3px solid var(--neon-yellow);
}
.metric-card.navigation .card-header {
    color: var(--neon-yellow);
}
.metric-card.memory {
    border-left: 3px solid var(--neon-green);
}
.metric-card.memory .card-header {
    color: var(--neon-green);
}
.metric-card.performance {
    border-left: 3px solid var(--neon-cyan);
}
.metric-card.performance .card-header {
    color: var(--neon-cyan);
}
.metric-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0;
    padding: 0;
    border: none;
    width: 100%;
    flex-shrink: 0;
    min-height: 1px;
}
/* Typography Helpers */
.highlight-yellow {
    color: var(--neon-yellow);
    font-weight: 600;
}
.highlight-green {
    color: var(--neon-green);
    font-weight: 600;
}
.highlight-cyan {
    color: var(--neon-cyan);
    font-weight: 600;
}
.bold {
    font-weight: 700;
    color: var(--text-main);
}
.sub-text {
    font-size: 9px;
    opacity: 0.7;
    margin-left: 4px;
}
.warning-text {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
    font-size: 11px;
    color: var(--neon-orange);
    font-style: italic;
}
/* Specialization List */
.specialization-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.spec-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.spec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 5px currentColor;
}
/* --- Modals --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}
.modal h2 {
    color: var(--neon-cyan);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    text-transform: uppercase;
    letter-spacing: 2px;
}
.modal-body {
    color: var(--text-dim);
    line-height: 1.6;
}
.modal-body h3 {
    color: var(--text-main);
    margin: 20px 0 10px;
    font-size: 16px;
}
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover {
    color: var(--neon-red);
}
/* --- Loading Screen --- */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.loading-screen h1 {
    font-size: 48px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
    filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.3));
}
#loading-progress {
    width: 400px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}
#loading-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
    box-shadow: 0 0 20px var(--neon-cyan);
    transition: width 0.3s ease-out;
}
#loading-status {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
}
/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
/* Fullscreen UI hiding */
.fullscreen-hidden {
    transform: translateX(-100%) translateY(-100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: all 0.5s ease-in-out !important;
}
#info-bar.fullscreen-hidden {
    transform: translateY(-100%) !important;
}
#controls.fullscreen-hidden {
    transform: translateY(100%) !important;
}
#sidebar-toggle.fullscreen-hidden {
    transform: translateX(-100%) !important;
}
/* ============================================================================
   AI SUMMARY OVERLAY (Fullscreen Mode)
   ============================================================================ */
.ai-summary-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: auto;
}
.ai-summary-content {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(57, 255, 20, 0.1);
    animation: summary-slide-up 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    margin-bottom: 0;
}
@keyframes summary-slide-up {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    60% {
        transform: translateY(-5px);
        opacity: 0.9;
    }
    80% {
        transform: translateY(2px);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}
@keyframes summary-slide-down {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    40% {
        transform: translateY(-3px);
        opacity: 0.8;
    }
    100% {
        transform: translateY(50px);
        opacity: 0;
    }
}
.ai-summary-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--neon-green);
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
    letter-spacing: 1px;
}
.ai-summary-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    text-align: left;
    min-height: 40px;
    border-left: 3px solid var(--neon-green);
    padding-left: 16px;
    position: relative;
}
.ai-summary-text::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--neon-green), var(--neon-cyan));
    animation: typing-cursor 1s infinite;
}
@keyframes typing-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.ai-summary-text::after {
    content: '▊';
    animation: blink 1s infinite;
    color: var(--neon-green);
    font-weight: bold;
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .ai-summary-overlay {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .ai-summary-content {
        padding: 16px;
    }

    .ai-summary-header {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .ai-summary-text {
        font-size: 14px;
        padding-left: 16px;
    }
}
/* Genetic Diversity Modal */
.genetic-diversity-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.genetic-diversity-modal.visible {
    opacity: 1;
}
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 16, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow:
        var(--shadow-lg),
        0 0 40px rgba(57, 255, 20, 0.1);
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    animation: modal-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 16px;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.05), rgba(0, 240, 255, 0.05));
}
.modal-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 600;
    color: var(--neon-green);
    margin: 0;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 32px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1;
}
.modal-close:hover {
    color: var(--neon-red);
    background: rgba(255, 0, 51, 0.1);
    transform: scale(1.1);
}
.modal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.modal-delete-btn {
    background: rgba(255, 0, 51, 0.1);
    border: 1px solid rgba(255, 0, 51, 0.3);
    color: var(--neon-red);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-delete-btn:hover {
    background: rgba(255, 0, 51, 0.2);
    border-color: var(--neon-red);
    color: #ff6b6b;
    transform: scale(1.05);
}
.modal-body {
    padding: 24px 32px;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-green) rgba(255, 255, 255, 0.1);
}
.modal-body::-webkit-scrollbar {
    width: 8px;
}
.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(57, 255, 20, 0.3);
}
.gene-pool-summary {
    margin-bottom: 24px;
}
.summary-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.stat-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 120px;
}
.stat-label {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}
.stat-value {
    color: var(--neon-green);
    font-size: 20px;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
}
.gene-pool-table-container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}
.gene-pool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.gene-pool-table thead {
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.1), rgba(0, 240, 255, 0.1));
}
.gene-pool-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    border-bottom: 1px solid var(--glass-border);
}
.gene-pool-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    vertical-align: top;
}
.gene-pool-table tbody tr {
    transition: background-color 0.2s ease;
}
.gene-pool-table tbody tr:hover {
    background: rgba(57, 255, 20, 0.05);
}
.gene-id-cell {
    font-family: 'Orbitron', monospace;
    font-weight: 500;
    color: var(--neon-cyan);
    font-size: 13px;
}
.fitness-cell {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    color: var(--neon-green);
}
.specialization-cell {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
}
/* Validation Queue Styling */
.validation-queue-section {
    margin-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
}
.validation-queue-section h3 {
    color: var(--neon-cyan);
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 600;
}
.validation-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.validation-queue-table-container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}
.validation-queue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.validation-queue-table thead {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(57, 255, 20, 0.1));
}
.validation-queue-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    border-bottom: 1px solid var(--glass-border);
}
.validation-queue-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    vertical-align: top;
}
.validation-queue-table tbody tr {
    transition: background-color 0.2s ease;
}
.validation-queue-table tbody tr:hover {
    background: rgba(0, 240, 255, 0.05);
}
.status-cell {
    font-weight: 600;
    text-align: center;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-progress {
    background: rgba(255, 165, 0, 0.2);
    color: #FFA500;
    border: 1px solid rgba(255, 165, 0, 0.3);
}
.status-validated {
    background: rgba(57, 255, 20, 0.2);
    color: var(--neon-green);
    border: 1px solid rgba(57, 255, 20, 0.3);
}
.status-passed {
    background: rgba(57, 255, 20, 0.2);
    color: var(--neon-green);
    border: 1px solid rgba(57, 255, 20, 0.3);
}
.status-failed {
    background: rgba(255, 0, 0, 0.2);
    color: #FF6B6B;
    border: 1px solid rgba(255, 0, 0, 0.3);
}
.status-stuck {
    background: rgba(255, 0, 0, 0.3);
    color: #FF4444;
    border: 1px solid rgba(255, 0, 0, 0.5);
}
.no-data {
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
    padding: 40px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-height: 90vh;
    }

    .modal-header {
        padding: 20px 24px 12px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

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

    .summary-stats {
        gap: 16px;
    }

    .stat-item {
        min-width: 100px;
        padding: 10px 12px;
    }

    .stat-value {
        font-size: 16px;
    }

    .gene-pool-table th,
    .gene-pool-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .gene-id-cell {
        font-size: 11px;
    }
}
/* --- Compact Modal Styles --- */
.compact-modal .modal-body {
    padding: 15px 20px;
}
.compact-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid rgba(57, 255, 20, 0.2);
    border-radius: 6px;
    font-size: 13px;
}
.compact-summary-bar .summary-item {
    color: var(--text-main);
    white-space: nowrap;
}
.compact-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
}
.stat-row .stat-cell {
    flex: 1;
    color: var(--text-main);
}
.stat-row .stat-cell:first-child {
    font-weight: 600;
    color: var(--neon-cyan);
    min-width: 120px;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .compact-modal .modal-content {
        width: 95%;
        margin: 5px;
        max-height: 90vh;
    }

    .compact-summary-bar {
        flex-direction: column;
        gap: 6px;
        padding: 10px;
        font-size: 12px;
    }

    .stat-row {
        flex-direction: column;
        gap: 4px;
        padding: 6px 8px;
        font-size: 11px;
    }

    .stat-row .stat-cell:first-child {
        min-width: unset;
        font-weight: 500;
    }
}
/* --- Agent Details Modal --- */
.agent-details {
    max-width: 600px;
    background: rgba(10, 10, 20, 0.95);
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
}
.agent-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}
.agent-type-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}
.agent-generation {
    font-size: 14px;
    color: var(--text-dim);
}
.agent-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}
.stat-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.stat-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}
.stat-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}
.stat-bar {
    height: 100%;
    background: var(--neon-cyan);
    box-shadow: 0 0 5px var(--neon-cyan);
    transition: width 0.3s ease;
}
.stat-bar.health {
    background: var(--neon-green);
    box-shadow: 0 0 5px var(--neon-green);
}
.nn-viz-container {
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
#nn-viz-canvas {
    width: 100%;
    height: 100%;
}/* Toast Notification System Styles */

.toast-container {
    position: fixed;
    top: 80px;
    /* Below header */
    left: 20px;
    /* Changed from right to left to avoid sidebar */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 220px;
    max-width: 280px;
    padding: 10px;
    background: rgba(15, 15, 25, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    font-family: 'Orbitron', 'Inter', 'Segoe UI', sans-serif;
    /* Using Orbitron everywhere for full cyberpunk aesthetic */
    font-size: 13px;
    line-height: 1.3;
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    cursor: pointer;
}

.toast-pool-add {
    border-left: 3px solid var(--neon-cyan);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 240, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.toast-validation {
    border-left: 3px solid var(--neon-green);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(57, 255, 20, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 0 3px rgba(57, 255, 20, 0.1);
}

.toast-validation-failed {
    border-left: 3px solid var(--neon-red);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 57, 57, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 0 3px rgba(255, 57, 57, 0.1);
}

.toast:hover {
    background: rgba(20, 20, 35, 0.85);
    transform: translateX(0) scale(1.02);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 0 25px rgba(57, 255, 20, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.toast-score-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 2px 0;
    font-family: 'Courier New', monospace;
}

.toast-summary {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.toast-fitness {
    font-weight: 600;
    color: #CCFF00;
    text-shadow: 0 0 6px rgba(204, 255, 0, 0.5);
}

.toast-position {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.toast-replacement {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 100, 100, 0.2);
    font-size: 12px;
    color: #FF6666;
    text-shadow: 0 0 6px rgba(255, 100, 100, 0.3);
}

.toast-capacity {
    font-weight: 600;
    color: #FFD700;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

.toast-message {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: #ffffff;
}

.toast-gene-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    color: #CCFF00;
    text-shadow: 0 0 6px rgba(204, 255, 0, 0.5);
}

.toast-details {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.toast-avg {
    font-weight: 500;
    color: #FFD700;
    margin-top: 4px;
}

/* Animations */
@keyframes celebrate {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.3) rotate(-15deg);
    }

    50% {
        transform: scale(1.2) rotate(15deg);
    }

    75% {
        transform: scale(1.3) rotate(-10deg);
    }
}

@keyframes bounce-in {
    0% {
        transform: scale(0) rotate(-180deg);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes pulse-warning {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-hide {
    opacity: 0;
    transform: translateX(-100%);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
        top: 60px;
    }

    .toast {
        min-width: unset;
        max-width: unset;
        padding: 8px;
    }

    .toast-icon {
        font-size: 16px;
    }

    .toast-title {
        font-size: 14px;
    }
}