/* Add CSS variables for theming */
:root {
    --bg-color: #f5f5f5;
    --bg-content: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    --hover-bg: #f0f0f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --code-bg: #f1f3f5;
    --section-bg: #f8f9fa;
}

.dark-mode {
    --bg-color: #1a1a1a;
    --bg-content: #2d2d2d;
    --text-color: #e0e0e0;
    --border-color: #404040;
    --hover-bg: #3d3d3d;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --code-bg: #363636;
    --section-bg: #363636;
}

/* Update existing styles to use variables */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 20px;
    background: var(--bg-color);
    color: var(--text-color);
}

.context-container {
    background: var(--bg-content);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
    position: relative;
}

.context-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.context-id {
    font-family: monospace;
    color: #666;
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.5px;
}

.status-running {
    background: #ffc107;
    /* Yellow */
}

.status-complete {
    background: #28a745;
    /* Green */
}

.status-error {
    background: #dc3545;
    /* Red */
}

.status-cancelled {
    background: #6c757d;
    /* Gray */
}

.event-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    border-left: 2px solid #e9ecef;
    margin-left: 20px;
}

.event,
.context-container {
    margin-left: 20px;
    padding-left: 20px;
    position: relative;
}

.event:before,
.context-container:before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    height: 100%;
    border-left: 2px solid #e9ecef;
}

.event {
    padding: 10px;
    margin: 5px 0;
    background: var(--section-bg);
    border-radius: 4px;
}

.event-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
    cursor: pointer;
}

.event-timestamp {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
}

.event-type {
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 3px;
    background: #e9ecef;
    color: #495057;
    font-size: 0.9em;
}

.event-data {
    margin-top: 8px;
    font-family: monospace;
    font-size: 0.9em;
}

.event-data-label {
    color: #666;
    font-size: 0.85em;
    margin-bottom: 4px;
}

pre {
    background: var(--code-bg);
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-color);
}

.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9em;
}

.connection-status.connected {
    background: #d4edda;
    color: #155724;
}

.connection-status.disconnected {
    background: #f8d7da;
    color: #721c24;
}

.collapse-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: #666;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.collapse-button:hover {
    background: #f0f0f0;
    border-radius: 4px;
}

.collapse-icon {
    transition: transform 0.2s;
    font-size: 0.8em;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.context-content.collapsed,
.event-content.collapsed {
    display: none;
}

.settings-panel {
    background: var(--bg-content);
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 20px;
    align-items: center;
}

.action-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.action-button:hover {
    background: #0056b3;
}

.json-key {
    color: #d63384;
}

.json-string {
    color: #198754;
}

.json-number {
    color: #0d6efd;
}

.json-boolean {
    color: #dc3545;
}

.json-null {
    color: #6c757d;
}

.copy-button {
    float: right;
    padding: 4px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.copy-button:hover {
    opacity: 1;
}

.retry-button {
    float: right;
    padding: 4px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.event,
.context-header {
    position: relative;
}

.event-content {
    margin-right: 30px;
    /* Make room for copy button */
}

.context {
    position: relative;
}

.context-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.context-id-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-section {
    margin: 10px 0;
    padding: 10px;
    background: var(--section-bg);
    border-radius: 4px;
}

.context-section:has(> .section-header:has(+ pre)) {
    background-color: rgba(40, 167, 69, 0.08);
    border-left: 3px solid #28a745;
}

.context-section:has(> .section-header:has(+ pre)) pre {
    background-color: rgba(40, 167, 69, 0.04);
}

.context-section.highlight {
    background-color: rgba(255, 193, 7, 0.2) !important;
    border-left: 3px solid #ffc107 !important;
}

.context-section.highlight pre {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.section-header {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1em;
    font-weight: 600;
}

.contexts>.context-container {
    border-left: none;
    margin-left: 0;
}

.contexts>.context-container:before {
    display: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.section-header:hover {
    background-color: #f0f0f0;
}

.event-header {
    display: grid;
    grid-template-columns: 20px auto 1fr;
    gap: 12px;
}

.event-timestamp {
    text-align: right;
    color: #666;
}

.connection-pill {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    width: fit-content;
    margin: 0 auto;
}

.connection-pill.connection-connected {
    background: #28a745;
    color: white;
}

.connection-pill.connection-disconnected {
    background: #dc3545;
    color: white;
}

.connection-pill.connection-error {
    background: #ffc107;
    color: #000;
}

.connection-pill.connection-connecting {
    background: #ffc107;
    color: #000;
}

.context-name {
    color: #495057;
    font-weight: 500;
    margin: 0 12px;
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.9em;
}

.search-input {
    justify-self: center;
    width: 400px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
}

.event.highlight {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

.event.highlight .event-data pre {
    background-color: #fff8e6;
}

.tool-name {
    font-weight: 500;
    color: #495057;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 8px;
}

.search-highlight {
    background-color: #ffeb3b;
    padding: 2px;
    border-radius: 2px;
    margin: -2px;
}

.error-section {
    background-color: #ffebee;
    border-left: 3px solid #dc3545;
}

.error-section.highlight {
    background-color: #fff3cd;
    border-left: 3px solid #dc3545;
}

.error-content {
    color: #dc3545;
    background-color: #fff5f5;
}

.error-section.highlight .error-content {
    background-color: #fff8e6;
}

.view-toggle {
    background: white;
    padding: 4px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    position: relative;
    margin-top: 16px;
}

.view-toggle button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    color: #6c757d;
    background: transparent;
    position: relative;
    z-index: 1;
    transition: color 0.3s;
}

.view-toggle button.active {
    color: #495057;
}

.view-toggle button:first-child.active~button:last-child {
    color: #6c757d;
}

.view-toggle:before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 50%;
    bottom: 4px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.view-toggle button:last-child.active~.view-toggle:before {
    transform: translateX(100%);
}

.app-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    padding: 20px;
    min-height: 100vh;
}

.left-column {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.connection-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.settings-button:hover {
    opacity: 1;
    background: #f0f0f0;
}

.connection-settings {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 12px;
    margin-top: -10px;
}

.settings-group {
    background: var(--section-bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.settings-group label {
    font-size: 0.85em;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.port-input-group {
    display: flex;
    gap: 8px;
}

.port-input {
    width: 100px;
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
}

.reconnect-button {
    padding: 4px 8px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.reconnect-button:hover {
    background: #218838;
}

.view-toggle {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f0f0f0;
    padding: 8px;
    border-radius: 4px;
}

.view-toggle button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    background: transparent;
    text-align: left;
}

.view-toggle button.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.search-input {
    width: 400px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .left-column {
        position: static;
        margin-bottom: 20px;
    }

    .search-input {
        width: 100%;
    }
}

/* Add these new styles */

.global-settings-button {
    top: 20px;
    right: 20px;
    z-index: 1000;
    /* background: white; */
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    transition: all 0.3s;
    color: white;
}

.global-settings-button:hover {
    transform: rotate(30deg);
}

/* Connection status colors for the button background */
.global-settings-button.connection-connected {
    background-color: #28a745;
}

.global-settings-button.connection-disconnected {
    background-color: #dc3545;
}

.global-settings-button.connection-connecting,
.global-settings-button.connection-error {
    background-color: #ffc107;
    color: #000;
}

.settings-panel-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.settings-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.floating-settings-panel {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    width: 300px;
    background: var(--bg-content);
    padding: 20px;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 999;
    overflow-y: auto;
}

.floating-settings-panel.active {
    transform: translateX(0);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.settings-header h3 {
    margin: 0;
    color: #333;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-button:hover {
    background: #f0f0f0;
}

.connection-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.host-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    .floating-settings-panel {
        width: 100%;
    }

    .settings-panel-overlay.active {
        background: white;
    }

    .global-settings-button {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }
}

/* Adjust main content padding */
.main-content {
    padding: 76px 80px 20px 80px;
    transition: padding 0.3s;
}

.main-content.with-tools {
    padding-left: 320px;
}

.connection-buttons {
    display: flex;
    gap: 8px;
}

.reconnect-button,
.disconnect-button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.reconnect-button {
    background: #28a745;
    color: white;
}

.reconnect-button:hover:not(:disabled) {
    background: #218838;
}

.disconnect-button {
    background: #dc3545;
    color: white;
}

.disconnect-button:hover:not(:disabled) {
    background: #c82333;
}

.reconnect-button:disabled,
.disconnect-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.connection-input-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.95em;
    background: var(--bg-content);
    transition: border-color 0.2s;
    color: var(--text-color);
}

.connection-input-group input:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .25);
}

.view-toggle {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
}

.view-toggle button {
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s;
}

.view-toggle button:last-child {
    margin-bottom: 0;
}

.view-toggle button:hover:not(.active) {
    background: #e9ecef;
}

.view-toggle button.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, .25);
}

.connection-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.connection-buttons button {
    flex: 1;
    padding: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.global-tools-button {
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    overflow: hidden;
}

.global-tools-button .button-icon,
.global-tools-button .button-icon-hover {
    position: absolute;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.global-tools-button .button-icon {
    opacity: 1;
}

.global-tools-button .button-icon-hover {
    opacity: 0;
}

.global-tools-button:hover .button-icon {
    opacity: 0;
}

.global-tools-button:hover .button-icon-hover {
    opacity: 1;
}

.tools-panel {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 300px;
    background: var(--bg-color);
    padding: 20px;
    box-shadow: 2px 0 8px var(--shadow-color);
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 999;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tools-panel.active {
    transform: translateX(0);
}

.tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.tools-header h3 {
    margin: 0;
    color: #333;
}

.tools-content {
    flex: 1;
    overflow-y: auto;
}

/* Update main content transitions */
.main-content {
    transition: padding 0.3s;
}

.main-content.with-tools {
    padding-left: 320px;
}

/* Update media queries */
@media (max-width: 768px) {
    .global-settings-button {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }

    .global-tools-button {
        top: 10px;
        left: 10px;
        width: 35px;
        height: 35px;
    }

    .main-content.with-tools {
        padding-left: 20px;
    }
}

/* Theme toggle button styles */
.theme-button {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9em;
    background: var(--bg-content);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.theme-button:hover {
    background: var(--hover-bg);
}

/* Update JSON syntax highlighting for dark mode */
.dark-mode .json-key {
    color: #ff79c6;
}

.dark-mode .json-string {
    color: #50fa7b;
}

.dark-mode .json-number {
    color: #bd93f9;
}

.dark-mode .json-boolean {
    color: #ff5555;
}

.dark-mode .json-null {
    color: #8be9fd;
}

/* Update error section for dark mode */
.dark-mode .error-section {
    background-color: rgba(220, 53, 69, 0.1);
}

.dark-mode .error-content {
    background-color: rgba(220, 53, 69, 0.05);
}

.dark-mode .error-section.highlight {
    background-color: rgba(255, 193, 7, 0.1);
}

/* Update event highlighting for dark mode */
.dark-mode .event.highlight,
.dark-mode .context-section.highlight {
    background-color: rgba(255, 193, 7, 0.1);
}

/* Update search input for dark mode */
.dark-mode .search-input {
    background: var(--bg-content);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Update view toggle for dark mode */
.dark-mode .view-toggle {
    /* background: var(--bg-content); */
    border: 1px solid var(--border-color);
}

.dark-mode .view-toggle button {
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.dark-mode .view-toggle button:hover:not(.active) {
    background: var(--hover-bg);
}

.dark-mode .view-toggle button.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Update tools button and panel for dark mode */
.dark-mode .global-tools-button {
    background: var(--bg-content);
    color: var(--text-color);
}

.dark-mode .tools-header h3 {
    color: var(--text-color);
}

/* Update tool name and event type backgrounds */
.dark-mode .tool-name,
.dark-mode .event-type {
    background: var(--section-bg);
    color: var(--text-color);
}

/* Update context sections for dark mode */
.dark-mode .context-section {
    background: var(--section-bg);
}

/* Update error section title */
.dark-mode .section-header {
    color: var(--text-color);
}

/* Update event backgrounds */
.dark-mode .event {
    background: var(--section-bg);
}

/* Update borders and dividers */
.dark-mode .context-header {
    border-bottom-color: var(--border-color);
}

.dark-mode .tools-header {
    border-bottom-color: var(--border-color);
}

/* Update close button in dark mode */
.dark-mode .close-button {
    color: var(--text-color);
}

.dark-mode .close-button:hover {
    background: var(--hover-bg);
}

/* Fix header hover states in dark mode */
.dark-mode .section-header:hover {
    background-color: var(--hover-bg);
}

.dark-mode .collapse-button:hover {
    background: var(--hover-bg);
}

/* Dark mode output */
.dark-mode .context-section:has(> .section-header:has(+ pre)) {
    background-color: rgba(40, 167, 69, 0.15);
    border-left: 3px solid #2fd655;
}

.dark-mode .context-section:has(> .section-header:has(+ pre)) pre {
    background-color: rgba(40, 167, 69, 0.08);
}

/* Keep the highlight behavior for search matches */
.context-section.highlight {
    background-color: rgba(255, 193, 7, 0.2) !important;
    border-left: 3px solid #ffc107 !important;
}

.context-section.highlight pre {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.dark-mode .context-section.highlight {
    background-color: rgba(255, 193, 7, 0.15) !important;
    border-left: 3px solid #ffc107 !important;
}

.dark-mode .context-section.highlight pre {
    background-color: rgba(255, 193, 7, 0.08) !important;
}

/* Add these styles at the end of the file */

.tool-view {
    padding: 20px;
    margin: 0 20px;
}

.tool-title {
    font-size: 2em;
    margin-bottom: 20px;
    color: var(--text-color);
}

.tool-section {
    background: var(--bg-content);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.section-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.section-header h3,
.section-header h4 {
    margin: 0;
    color: var(--text-color);
}

.expand-icon {
    font-size: 1.2em;
    color: var(--text-color);
}

.section-content {
    padding: 20px;
}

.tool-description {
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 20px;
    color: var(--text-color);
}

.arguments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.argument-card {
    background: var(--section-bg);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

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

.argument-name {
    font-weight: bold;
    color: var(--text-color);
}

.argument-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.argument-badge.required {
    background-color: #dc3545;
    color: white;
}

.argument-badge.optional {
    background-color: #6c757d;
    color: white;
}

.argument-type {
    color: #0d6efd;
    font-family: monospace;
    margin-bottom: 8px;
}

.argument-description {
    color: var(--text-color);
    margin-bottom: 8px;
}

.argument-default {
    font-family: monospace;
    color: #198754;
    font-size: 0.9em;
}

.examples-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.example-card {
    background: var(--section-bg);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.example-description {
    margin-bottom: 10px;
    color: var(--text-color);
}

.example-code {
    background: var(--code-bg);
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    margin-bottom: 10px;
}

.example-output {
    margin-top: 10px;
}

.example-output pre {
    margin-top: 5px;
    background: var(--code-bg);
    padding: 10px;
    border-radius: 4px;
}

.example-explanation {
    margin-top: 10px;
    font-style: italic;
    color: var(--text-color);
}

.triggers-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trigger-card {
    background: var(--section-bg);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

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

.trigger-id {
    font-family: monospace;
    color: var(--text-color);
}

.trigger-timestamp {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.trigger-output pre,
.trigger-error pre {
    margin: 0;
    background: var(--code-bg);
    padding: 10px;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.trigger-error pre {
    color: #dc3545;
}

.no-triggers {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.tool-button {
    text-align: left;
    padding: 10px 15px;
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.95em;
    transition: all 0.2s;
}

.tool-button:hover {
    background: var(--hover-bg);
}

.tool-button.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.dark-mode .tool-button.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.back-button {
    padding: 8px 16px;
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1em;
    transition: all 0.2s;
}

.back-button:hover {
    background: var(--hover-bg);
}

.dark-mode .back-button:hover {
    background: var(--hover-bg);
}

/* DataView Component Styles */
.data-store-section {
    background: var(--bg-content);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    margin-bottom: 20px;
    width: 100%;
    overflow: hidden;
}

.data-store-content {
    padding: 16px;
}

.data-store-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.data-store-table thead {
    background: var(--section-bg);
}

.data-store-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.data-store-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.data-store-table .key-cell {
    width: 200px;
    font-weight: 500;
    color: var(--text-color);
}

.data-store-table .value-cell {
    font-family: monospace;
}

.data-store-table .value-cell pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--code-bg);
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.data-store-table tr:last-child td {
    border-bottom: none;
}

/* Section Header Styles */
.data-store-section .section-header {
    padding: 15px 20px;
    background: var(--section-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-color);
}

.data-store-section .expand-icon {
    font-size: 1.2em;
    color: var(--text-color);
    opacity: 0.7;
}

.data-store-section .section-header:hover {
    background: var(--hover-bg);
}

.data-store-section .section-header:hover .expand-icon {
    opacity: 1;
}

.header-bar {
    background: #1a1a1a;
    color: white;
    padding: 0 24px;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 56px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    margin: 0 auto;
}

.header-bar h1 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e0e0e0;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
    /* Add margin to separate from title */
}

/* Button styles */
.global-tools-button,
.global-settings-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: #e0e0e0;
    transition: all 0.2s;
    padding: 0;
}

.global-tools-button:hover,
.global-settings-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
}

.button-icon,
.button-icon-hover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.global-settings-button.connection-connecting,
.global-settings-button.connection-error {
    color: #ffc107;
}

/* Media queries */
@media (max-width: 768px) {
    .header-bar {
        padding: 0 16px;
    }

    .header-content {
        gap: 12px;
    }

    .global-tools-button,
    .global-settings-button {
        width: 32px;
        height: 32px;
        font-size: 1em;
    }
}

/* Execution Form Styles */
.execution-section {
    margin: 20px 0;
}

.execution-form {
    width: 100%;
}

.execution-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.execution-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.execution-field label {
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.required-star {
    color: #dc3545;
    font-weight: bold;
}

.input-wrapper {
    width: 100%;
}

.execution-input,
.execution-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95em;
    background: var(--bg-content);
    color: var(--text-color);
    transition: all 0.2s;
}

.execution-input:focus,
.execution-textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .25);
}

.execution-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Boolean Toggle Switch */
.boolean-input {
    display: flex;
    align-items: center;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #0d6efd;
}

input:focus+.slider {
    box-shadow: 0 0 1px #0d6efd;
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.execution-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.execute-button {
    padding: 10px 24px;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.execute-button:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
}

.execute-button:active {
    transform: translateY(0);
}

/* Dark mode adjustments */
.dark-mode .execution-input,
.dark-mode .execution-textarea {
    background: var(--bg-content);
    border-color: var(--border-color);
}

.dark-mode .slider {
    background-color: #4a4a4a;
}

.dark-mode .slider:before {
    background-color: #e0e0e0;
}

.dark-mode input:checked+.slider {
    background-color: #0d6efd;
}

/* LLM View Styles */
.llm-view {
    padding: 20px;
    margin: 0 20px;
}

.llm-title {
    font-size: 2em;
    margin-bottom: 20px;
    color: var(--text-color);
}

.llm-section {
    background: var(--bg-content);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.prompt-field {
    margin-bottom: 20px;
}

.prompt-textarea {
    box-sizing: border-box;
    width: 100%;
    height: 96px;
    max-height: 192px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    line-height: 1.5;
    background: var(--bg-content);
    color: var(--text-color);
    resize: none;
    transition: all 0.2s;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Stylized scrollbar for Webkit browsers */
.prompt-textarea::-webkit-scrollbar {
    width: 8px;
}

.prompt-textarea::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.prompt-textarea::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.prompt-textarea::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Stylized scrollbar for Firefox */
.prompt-textarea {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-color);
}

.prompt-textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .25);
}

.executions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.execution-card {
    background: var(--section-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

.execution-timestamp {
    color: #6c757d;
    font-size: 0.9em;
}

.execution-id {
    font-family: monospace;
    color: var(--text-color);
}

.execution-prompt,
.execution-response {
    margin-top: 15px;
}

.execution-prompt h4,
.execution-response h4 {
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.execution-prompt pre,
.execution-response pre {
    background: var(--code-bg);
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.95em;
    line-height: 1.5;
}

.no-executions {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-style: italic;
}

/* Dark mode adjustments */
.dark-mode .prompt-textarea {
    background: var(--bg-content);
    border-color: var(--border-color);
}

.dark-mode .execution-card {
    border-color: var(--border-color);
}