/* Theme and base styles */
@import './theme.css';

/* Atuin CSS for split-pane layout */
@import '../../../node_modules/atuin/dist/css/main.css';

/* Override Atuin styles for better integration */
.split-container .tab-buttons {
    display: flex;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    gap: 0.25rem;
}

.split-container .tab-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: none;
    background: transparent;
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.split-container .tab-btn:hover {
    background: var(--hover-bg);
}

.split-container .tab-btn.active {
    background: var(--accent-color);
    color: white;
}

.split-container .tab-content {
    display: none !important;
    padding: 1rem;
    height: calc(100% - 60px);
    overflow-y: auto;
}

.split-container .tab-content.active {
    display: block !important;
}


/* Component styles */
@import './components/tabs.css';
@import './console.css';
@import './tabs.css';

/* Atuin SPARQL Browser specific styles */
.file-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-input-container, .file-save-container {
    display: inline-block;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Syntax checker status styles */
#atuin-syntax-check .status-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

#atuin-syntax-check .status-icon.passed {
    background-color: #28a745;
}

#atuin-syntax-check .status-icon.pending {
    background-color: #ffc107;
}

#atuin-syntax-check .status-icon.error {
    background-color: #dc3545;
}

#atuin-syntax-check .status-icon.working {
    background-color: #17a2b8;
}

#atuin-syntax-check .status-icon.off {
    background-color: #6c757d;
}

/* Tab styling for Atuin split panes - higher specificity */
.split-pane .tab-bar {
    display: flex !important;
    border-bottom: 1px solid #ccc !important;
    margin-bottom: 4px !important;
    background: #f8f9fa;
    padding: 0;
}

.split-pane .tab {
    padding: 8px 16px !important;
    background: #f5f5f5 !important;
    border: 1px solid #ccc !important;
    border-bottom: none !important;
    cursor: pointer !important;
    margin-right: 2px !important;
    transition: all 0.2s !important;
    color: #333 !important;
    font-weight: 500 !important;
    border-radius: 4px 4px 0 0 !important;
}

.split-pane .tab:hover {
    background: #e8e8e8 !important;
    color: #000 !important;
}

.split-pane .tab.active {
    background: white !important;
    border-bottom: 1px solid white !important;
    position: relative !important;
    z-index: 1 !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

/* Split pane styling */
.split-pane {
    flex: 1;
    padding: 10px;
    overflow: auto;
}

/* Settings panel styling - override inline styles */
#settings-pane {
    padding: 10px !important;
    background: white !important;
    min-height: 200px !important;
    border: 1px solid #ddd !important;
}

#settings-pane[style*="display: block"] {
    display: block !important;
}

#view-pane[style*="display: block"] {
    display: block !important;
}

#settings-pane .settings-group {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
}

#settings-pane .settings-group h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

#settings-pane .setting-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

#settings-pane .setting-item label {
    min-width: 120px;
    font-weight: 500;
}

.split-divider {
    width: 5px;
    background: #ddd;
    cursor: col-resize;
    user-select: none;
}

.split-divider:hover {
    background: #bbb;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: calc(100vw - 4rem);
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    background-color: var(--content-bg);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Tab navigation */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tab-btn {
    background-color: var(--tabs-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background-color: var(--hover-bg);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Inner tabs */
.tabs-inner {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.tab-inner-btn {
    background: none;
    border: none;
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-inner-btn:hover {
    color: #495057;
}

.tab-inner-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* Tab content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.inner-tab-content {
    display: none;
}

.inner-tab-content.active {
    display: block;
}

/* Section headings */
h2 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

/* Form styles */
.api-form {
    background-color: var(--content-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.settings-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--content-bg);
    color: var(--text-color);
    transition: border-color 0.3s;
}

.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--content-bg);
    color: var(--text-color);
    transition: border-color 0.3s;
    min-height: 100px;
    resize: vertical;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus,
.settings-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input[type="range"] {
    width: 70%;
    vertical-align: middle;
}

.form-group span {
    display: inline-block;
    margin-left: 1rem;
    color: #6c757d;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.checkbox-group label {
    margin-bottom: 0;
}

.form-options {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.form-options .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

/* Graph options section */
.graph-options {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.graph-options .form-group {
    margin-bottom: 0;
}

/* Graph selector styles */
.graph-selector-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 600px;
}

.graph-selector-container select {
    flex: 1;
    min-width: 300px;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.graph-controls {
    display: flex;
    gap: 0.5rem;
}

.graph-controls .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    min-width: auto;
    border-radius: 4px;
    font-weight: 500;
}

.graph-controls .btn.secondary-btn {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.graph-controls .btn.secondary-btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.primary-btn:hover {
    background-color: var(--primary-dark);
}

.small-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    background-color: var(--tabs-bg);
    color: var(--text-color);
}

.small-btn:hover {
    background-color: var(--tabs-hover-bg);
}

.send-btn {
    background-color: var(--primary-color);
    color: white;
    border-radius: 0 0 4px 0;
    height: 100%;
}

.send-btn:hover {
    background-color: var(--primary-dark);
}

/* Results container */
.results-section {
    min-height: 200px;
    position: relative;
}

.results-container {
    position: relative;
}

.results-placeholder {
    text-align: center;
    color: #95a5a6;
    padding: 3rem 0;
}

.api-result {
    background-color: var(--content-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
}

.api-result.hidden {
    display: none !important;
}

.result-item {
    background-color: var(--content-bg);
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.result-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.result-title a:hover {
    color: #3498db;
}

.result-content {
    color: #555;
    margin-bottom: 0.8rem;
}

.result-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.result-meta-item {
    display: flex;
    justify-content: space-between;
}

.result-score {
    font-weight: bold;
}

.result-uri {
    font-size: 0.85rem;
    color: #5d6d7e;
    word-break: break-all;
    padding: 0.3rem 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.result-uri .uri-link {
    color: #2980b9;
    text-decoration: none;
    transition: color 0.2s;
}

.result-uri .uri-link:hover {
    color: #1a5276;
    text-decoration: underline;
}

.result-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Chat specific styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    background-color: var(--content-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.chat-welcome {
    text-align: center;
    padding: 2rem 0;
    color: #95a5a6;
}

.chat-message {
    margin-bottom: 1rem;
    max-width: 80%;
}

.chat-message.user {
    margin-left: auto;
    background-color: #3498db;
    color: white;
    border-radius: 8px 8px 0 8px;
    padding: 0.8rem 1rem;
}

.chat-message.assistant {
    margin-right: auto;
    background-color: #f8f9fa;
    border-radius: 8px 8px 8px 0;
    padding: 0.8rem 1rem;
}

.chat-input-form {
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    background-color: var(--content-bg);
}

.chat-input-container {
    display: flex;
    position: relative;
}

.chat-input-container textarea {
    flex: 1;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    background-color: var(--content-bg);
    color: var(--text-color);
    resize: none;
    min-height: 60px;
    max-height: 120px;
}

.chat-input-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-options {
    margin-bottom: 1rem;
}

/* Concept list */
.concepts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.concept-tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    font-size: 0.9rem;
}

/* Embedding preview */
.embedding-preview {
    margin-top: 1rem;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.embedding-preview code {
    display: block;
    margin: 0.5rem 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.embedding-preview button {
    margin-top: 0.5rem;
}

/* Loading indicator */
#loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease-out;
    opacity: 1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Error message */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Footer styles */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    color: #95a5a6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}


/* Responsive styles */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-options .form-group {
        width: 100%;
    }
    
    .chat-container {
        height: 400px;
    }
    
    .chat-message {
        max-width: 90%;
    }
    
    footer {
        flex-direction: column;
        gap: 1rem;
    }
}

/* TODO: Import Atuin CSS for RDF editing and visualization once webpack issues are resolved */

/* SPARQL Browser specific styles */
.sparql-tabs {
    margin: 1rem 0;
}

.sparql-tab-content {
    display: none;
    padding: 1rem 0;
}

.sparql-tab-content.active {
    display: block;
}

.query-controls {
    margin-bottom: 1rem;
}

.endpoint-select {
    min-width: 200px;
    margin-right: 0.5rem;
}

.query-editor-container {
    margin: 1rem 0;
}

.sparql-editor, .turtle-editor {
    width: 100%;
    min-height: 150px;
    font-family: 'Courier New', monospace;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75rem;
    resize: vertical;
}

.query-actions {
    margin: 1rem 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.query-options {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.query-results {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 200px;
    padding: 1rem;
    background: var(--content-bg);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.results-table th,
.results-table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

.results-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.rdf-graph-container {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 400px;
    background: var(--content-bg);
    position: relative;
}

.graph-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #666;
}

.graph-controls {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.graph-query-input,
.depth-input,
.limit-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.graph-query-input {
    flex: 1;
    min-width: 300px;
}

.depth-input,
.limit-input {
    width: 80px;
}

.graph-info {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.info-stats {
    display: flex;
    gap: 1rem;
}

.editor-controls {
    margin-bottom: 1rem;
}

.format-select {
    min-width: 120px;
}

.rdf-editor-container {
    margin: 1rem 0;
}

.editor-actions {
    margin: 1rem 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.upload-section {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.validation-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
}

.validation-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.validation-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.endpoints-section {
    margin: 1rem 0;
}

.add-endpoint-form {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.endpoint-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.endpoints-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 200px;
    padding: 1rem;
    background: white;
}

.endpoints-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: #666;
}

/* Atuin message container */
.atuin-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 1000;
}

/* Responsive design for SPARQL browser */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .query-actions {
        justify-content: flex-start;
    }
    
    .query-options {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .upload-section {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .graph-query-input {
        min-width: auto;
    }
}

/* MCP Client Styles */
.mcp-tabs {
    margin-top: 1rem;
}

.mcp-tab-content {
    display: none;
    padding: 1rem 0;
}

.mcp-tab-content.active {
    display: block;
}

/* Connection Status */
.connection-status {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #95a5a6;
}

.status-indicator.connected {
    background-color: #2ecc71;
}

.status-indicator.connecting {
    background-color: #f39c12;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

.status-indicator.error {
    background-color: #e74c3c;
}

.status-indicator.disconnected {
    background-color: #95a5a6;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.5; }
}

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.input-group input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
}

/* Server Info */
.server-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.server-info h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

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

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-weight: 600;
    color: #666;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #333;
    font-family: monospace;
    font-size: 0.9rem;
}

/* Tools, Resources, Prompts Lists */
.tools-list,
.resources-list,
.prompts-list {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    min-height: 300px;
}

.tool-item,
.resource-item,
.prompt-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fdfdfd;
}

.tool-item:last-child,
.resource-item:last-child,
.prompt-item:last-child {
    margin-bottom: 0;
}

.tool-item h4,
.resource-item h4,
.prompt-item h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.tool-item p,
.resource-item p,
.prompt-item p {
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.tool-schema,
.prompt-arguments {
    margin-top: 1rem;
}

.tool-schema strong,
.prompt-arguments strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 0.5rem;
}

.tool-schema pre,
.prompt-arguments pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 0.825rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    text-align: center;
}

/* Responsive design for MCP Client */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .connection-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Enhanced Chat Styles */
.chat-message {
    margin: 1rem 0;
    max-width: 85%;
    word-wrap: break-word;
}

.chat-message.user {
    align-self: flex-end;
    margin-left: auto;
    background: #007bff;
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 0.75rem 1rem;
}

.chat-message.assistant {
    align-self: flex-start;
    margin-right: auto;
    background: #f8f9fa;
    color: #333;
    border-radius: 18px 18px 18px 4px;
    padding: 0.75rem 1rem;
    border: 1px solid #e9ecef;
}

.chat-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-content {
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* MCP Tool Indicators */
.mcp-tools-used {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 8px;
    border-left: 3px solid #007bff;
}

.tools-header {
    font-weight: 600;
    color: #007bff;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.mcp-tool-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 0.25rem 0.25rem 0 0;
}

.tool-duration {
    opacity: 0.8;
    font-size: 0.7rem;
}

/* Search Results Display */
.search-results-used {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 8px;
    border-left: 3px solid #28a745;
}

.search-header {
    font-weight: 600;
    color: #28a745;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.search-result-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.result-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.result-content {
    color: #6c757d;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.result-score {
    color: #28a745;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Loading and Streaming States */
.message-loading {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.loading-dots {
    color: #6c757d;
    font-size: 1.2rem;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

.message-streaming {
    color: #007bff;
    font-family: monospace;
    margin-top: 0.5rem;
    animation: streamingBlink 1s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes streamingBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Chat Input Enhancements */
.chat-input-container textarea {
    resize: none;
    min-height: 44px;
    max-height: 200px;
    transition: height 0.2s ease;
}

.chat-options {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.provider-select {
    font-family: inherit;
}

/* Provider indicators */
.provider-select option[title*="MCP"] {
    background-color: #e3f2fd;
}

/* Enhanced chat container */
.chat-container {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-input-form {
    border-top: 1px solid #e9ecef;
    padding: 1rem;
    background: white;
}

/* Responsive chat design */
@media (max-width: 768px) {
    .chat-message {
        max-width: 95%;
    }
    
    .chat-options {
        padding: 0.5rem;
    }
    
    .chat-options .form-row {
        flex-direction: column;
    }
    
    .mcp-tool-indicator {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .search-result-item {
        padding: 0.4rem;
    }
}

/* Memory Visualization Styles */
.memory-viz-tabs {
    margin-top: 1rem;
}

.memory-graph-container, 
.memory-timeline-container, 
.memory-clusters-container {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    min-height: 400px;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.graph-placeholder, 
.timeline-placeholder, 
.clusters-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #7f8c8d;
    font-size: 1.1rem;
    background: #f8f9fa;
}

/* Graph Controls */
.graph-controls, 
.timeline-controls, 
.cluster-controls {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-group.inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.small-input {
    width: 80px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Graph Legend */
.graph-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.node-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

.node-color.user-memory {
    background: #3498db;
}

.node-color.assistant-memory {
    background: #2ecc71;
}

.node-color.concept-node {
    background: #f39c12;
}

/* Graph Info */
.graph-info, 
.timeline-details, 
.cluster-details {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.info-stats, 
.cluster-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.info-stats span, 
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.stat-label {
    color: #7f8c8d;
    font-weight: 500;
}

.stat-value {
    color: #2c3e50;
    font-weight: 600;
}

/* Memory Details Panel */
.memory-details-panel {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.5rem;
}

/* Advanced Search Styles */
.advanced-search-section {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 1.5rem;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.filter-group {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
}

.filter-group h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.search-input, 
.date-input, 
.filter-select, 
.preset-select, 
.period-select, 
.grouping-select, 
.cluster-method-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-select {
    min-height: 80px;
}

.search-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.memory-search-results {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    min-height: 200px;
    padding: 1rem;
}

.results-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    color: #7f8c8d;
    font-style: italic;
}

/* Memory Graph D3 Styles */
.memory-graph-container svg {
    width: 100%;
    height: 100%;
}

.memory-node {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 2px;
}

.memory-node.user {
    fill: #3498db;
}

.memory-node.assistant {
    fill: #2ecc71;
}

.concept-node {
    fill: #f39c12;
    cursor: pointer;
    stroke: #fff;
    stroke-width: 1px;
}

.memory-link {
    stroke: #95a5a6;
    stroke-width: 1px;
    stroke-opacity: 0.6;
}

.memory-link.strong {
    stroke-width: 2px;
    stroke-opacity: 0.8;
}

.memory-node.selected {
    stroke: #e74c3c;
    stroke-width: 3px;
}

.memory-label {
    font-size: 10px;
    font-family: Arial, sans-serif;
    text-anchor: middle;
    pointer-events: none;
    fill: #2c3e50;
}

/* Timeline Styles */
.memory-timeline-container svg {
    width: 100%;
    height: 100%;
}

.timeline-axis {
    font-size: 11px;
    color: #7f8c8d;
}

.timeline-bar {
    fill: #3498db;
    cursor: pointer;
}

.timeline-bar:hover {
    fill: #2980b9;
}

.timeline-point {
    fill: #e74c3c;
    cursor: pointer;
    stroke: #fff;
    stroke-width: 1px;
}

.timeline-point:hover {
    r: 6;
}

.access-pattern-line {
    stroke: #f39c12;
    stroke-width: 2px;
    fill: none;
    stroke-opacity: 0.7;
}

/* Cluster Visualization */
.cluster-group {
    stroke: #95a5a6;
    stroke-width: 1px;
    stroke-dasharray: 5,5;
    fill: none;
}

.cluster-label {
    font-size: 12px;
    font-weight: 600;
    text-anchor: middle;
    fill: #2c3e50;
}

.cluster-node {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 2px;
}

.cluster-0 { fill: #3498db; }
.cluster-1 { fill: #2ecc71; }
.cluster-2 { fill: #f39c12; }
.cluster-3 { fill: #e74c3c; }
.cluster-4 { fill: #9b59b6; }
.cluster-5 { fill: #1abc9c; }
.cluster-6 { fill: #34495e; }
.cluster-7 { fill: #f1c40f; }

/* Responsive Design for Memory Viz */
@media (max-width: 768px) {
    .search-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .form-group.inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .graph-legend {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .info-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .memory-graph-container, 
    .memory-timeline-container, 
    .memory-clusters-container {
        min-height: 300px;
    }
}

/* VSOM Visualization Styles */
.vsom-tabs {
    margin-top: 1rem;
}

.som-grid-container, 
.som-training-container, 
.som-features-container, 
.som-clusters-container {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    min-height: 400px;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.som-placeholder, 
.training-placeholder, 
.features-placeholder, 
.clusters-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #7f8c8d;
    font-size: 1.1rem;
    background: #f8f9fa;
}

/* SOM Controls */
.som-controls, 
.training-controls, 
.features-controls, 
.cluster-controls {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.topology-select, 
.color-scheme-select, 
.data-source-select {
    width: 120px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* SOM Legend */
.som-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.node-color.high-activation {
    background: #e74c3c;
}

.node-color.medium-activation {
    background: #f39c12;
}

.node-color.low-activation {
    background: #3498db;
}

.node-color.no-activation {
    background: #95a5a6;
}

/* SOM Info */
.som-info {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

/* Training Progress */
.training-details, 
.feature-details {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.training-progress-panel {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.5rem;
}

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

/* SOM Grid D3 Styles */
.som-grid-container svg {
    width: 100%;
    height: 100%;
}

.som-node {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 1px;
}

/* Rectangular and hexagonal nodes are styled via JavaScript */

.som-node.selected {
    stroke: #e74c3c;
    stroke-width: 3px;
}

.som-node.high-activation {
    fill: #e74c3c;
}

.som-node.medium-activation {
    fill: #f39c12;
}

.som-node.low-activation {
    fill: #3498db;
}

.som-node.no-activation {
    fill: #95a5a6;
}

.som-label {
    font-size: 8px;
    font-family: Arial, sans-serif;
    text-anchor: middle;
    pointer-events: none;
    fill: #2c3e50;
}

/* Training Visualization Styles */
.som-training-container svg {
    width: 100%;
    height: 100%;
}

.training-line {
    stroke: #3498db;
    stroke-width: 2px;
    fill: none;
}

.training-point {
    fill: #e74c3c;
    stroke: #fff;
    stroke-width: 1px;
    r: 3;
}

.training-axis {
    font-size: 11px;
    color: #7f8c8d;
}

.progress-bar {
    fill: #3498db;
    height: 20px;
}

.progress-background {
    fill: #ecf0f1;
    height: 20px;
}

/* Feature Map Styles */
.som-features-container svg {
    width: 100%;
    height: 100%;
}

.feature-cell {
    stroke: #fff;
    stroke-width: 0.5px;
    cursor: pointer;
}

.feature-grid-line {
    stroke: #ddd;
    stroke-width: 0.5px;
}

.feature-scale {
    font-size: 10px;
    text-anchor: middle;
}

/* Color scheme definitions for feature maps */
.color-viridis-0 { fill: #440154; }
.color-viridis-1 { fill: #482777; }
.color-viridis-2 { fill: #3f4a8a; }
.color-viridis-3 { fill: #31678e; }
.color-viridis-4 { fill: #26838f; }
.color-viridis-5 { fill: #1f9d8a; }
.color-viridis-6 { fill: #6cce5a; }
.color-viridis-7 { fill: #b6de2b; }
.color-viridis-8 { fill: #fee825; }

.color-plasma-0 { fill: #0c0786; }
.color-plasma-1 { fill: #40039c; }
.color-plasma-2 { fill: #6a00a7; }
.color-plasma-3 { fill: #8f0da4; }
.color-plasma-4 { fill: #b12a90; }
.color-plasma-5 { fill: #cc4778; }
.color-plasma-6 { fill: #e16462; }
.color-plasma-7 { fill: #f2844b; }
.color-plasma-8 { fill: #fca636; }

/* Cluster Visualization for VSOM */
.som-cluster-group {
    stroke: #95a5a6;
    stroke-width: 2px;
    stroke-dasharray: 5,5;
    fill: none;
}

.som-cluster-label {
    font-size: 12px;
    font-weight: 600;
    text-anchor: middle;
    fill: #2c3e50;
}

.som-cluster-node {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 2px;
}

/* VSOM cluster colors */
.som-cluster-0 { fill: #3498db; }
.som-cluster-1 { fill: #2ecc71; }
.som-cluster-2 { fill: #f39c12; }
.som-cluster-3 { fill: #e74c3c; }
.som-cluster-4 { fill: #9b59b6; }
.som-cluster-5 { fill: #1abc9c; }
.som-cluster-6 { fill: #34495e; }
.som-cluster-7 { fill: #f1c40f; }

/* Entity markers on SOM */
.som-entity-marker {
    fill: #e74c3c;
    stroke: #fff;
    stroke-width: 2px;
    r: 4;
    cursor: pointer;
}

.som-entity-marker:hover {
    r: 6;
    fill: #c0392b;
}

/* Responsive Design for VSOM */
@media (max-width: 768px) {
    .som-controls .control-group,
    .training-controls .control-group,
    .features-controls .control-group,
    .cluster-controls .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .som-legend {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .progress-stats, 
    .feature-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .som-grid-container, 
    .som-training-container, 
    .som-features-container, 
    .som-clusters-container {
        min-height: 300px;
    }
    
    .topology-select, 
    .color-scheme-select, 
    .data-source-select {
        width: 100%;
    }
}

/* SPARQL Clips Container Styles */
.sparql-clips-container {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--content-bg, #f8f9fa);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-md, 6px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1));
}

.clips-placeholder {
    color: var(--muted-text, #666);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.sparql-clips-container .clips-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sparql-clips-container .clip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-color, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-sm, 4px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sparql-clips-container .clip-item:hover {
    background: var(--hover-bg, #f0f0f0);
    border-color: var(--accent-color, #007bff);
}

.sparql-clips-container .clip-name {
    font-weight: 500;
    color: var(--text-color, #333);
}

.sparql-clips-container .clip-preview {
    font-size: 0.85rem;
    color: var(--muted-text, #666);
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.sparql-clips-container .clip-actions {
    display: flex;
    gap: 0.5rem;
}

.sparql-clips-container .clip-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color, #ddd);
    background: transparent;
    color: var(--text-color, #333);
    border-radius: var(--border-radius-sm, 3px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sparql-clips-container .clip-actions button:hover {
    background: var(--accent-color, #007bff);
    color: white;
    border-color: var(--accent-color, #007bff);
}

/* Dark theme support for clips */
@media (prefers-color-scheme: dark) {
    .sparql-clips-container {
        background-color: var(--content-bg, #2d2d2d);
        border-color: var(--border-color, #404040);
    }
    
    .sparql-clips-container .clip-item {
        background: var(--bg-color, #1a1a1a);
        border-color: var(--border-color, #404040);
    }
    
    .sparql-clips-container .clip-item:hover {
        background: var(--hover-bg, #3a3a3a);
    }
}

/* SPARQL Browser Wide Layout Styles */
.sparql-wide-layout {
    max-width: none !important;
    width: 95% !important;
    margin: 0 auto;
}

.sparql-wide-layout .container {
    max-width: none !important;
    width: 100% !important;
}

.sparql-dual-panel {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sparql-left-panel {
    flex: 1;
}

.sparql-right-panel {
    flex: 1;
}

.sparql-content-area {
    display: flex;
    gap: 1rem;
    min-height: 600px;
}

.sparql-left-content {
    flex: 1;
    background: var(--content-bg, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-md, 6px);
    padding: 1rem;
}

.sparql-right-content {
    flex: 1;
    background: var(--content-bg, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-md, 6px);
    padding: 1rem;
}

/* Tab button styling for dual panels */
.sparql-left-panel .tabs-inner,
.sparql-right-panel .tabs-inner {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    padding-bottom: 0.5rem;
}

.sparql-left-panel .tab-inner-btn,
.sparql-right-panel .tab-inner-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-color, #666);
    border-radius: var(--border-radius-sm, 4px) var(--border-radius-sm, 4px) 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sparql-left-panel .tab-inner-btn:hover,
.sparql-right-panel .tab-inner-btn:hover {
    background: var(--hover-bg, #f0f0f0);
    color: var(--text-color, #333);
}

.sparql-left-panel .tab-inner-btn.active,
.sparql-right-panel .tab-inner-btn.active {
    background: var(--accent-color, #007bff);
    color: white;
}

/* Content area styling for both panels */
.sparql-left-content .sparql-tab-content,
.sparql-right-content .sparql-tab-content {
    display: none;
    padding-top: 1rem;
}

.sparql-left-content .sparql-tab-content.active,
.sparql-right-content .sparql-tab-content.active {
    display: block;
}

/* Adjust form elements for dual panel layout */
.sparql-left-content .query-editor-container textarea,
.sparql-left-content .rdf-editor-container textarea {
    min-height: 200px;
    width: 100%;
}

.sparql-right-content .rdf-graph-container {
    min-height: 400px;
    width: 100%;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-sm, 4px);
}

/* Responsive adjustments for dual panel */
@media (max-width: 1200px) {
    .sparql-dual-panel {
        flex-direction: column;
    }
    
    .sparql-content-area {
        flex-direction: column;
    }
    
    .sparql-left-content,
    .sparql-right-content {
        flex: none;
    }
}

/* Dark theme support for dual panel */
@media (prefers-color-scheme: dark) {
    .sparql-left-content,
    .sparql-right-content {
        background: var(--content-bg, #2d2d2d);
        border-color: var(--border-color, #404040);
    }
    
    .sparql-left-panel .tabs-inner,
    .sparql-right-panel .tabs-inner {
        border-bottom-color: var(--border-color, #404040);
    }
    
    .sparql-left-panel .tab-inner-btn:hover,
    .sparql-right-panel .tab-inner-btn:hover {
        background: var(--hover-bg, #3a3a3a);
        color: var(--text-color, #e0e0e0);
    }
}

/* Stats Tab Styles */
.stats-container {
    padding: 1rem;
    max-width: 1200px;
}

.stats-refresh {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.last-updated {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stats-grid {
    display: grid;
    gap: 1.5rem;
}

.stats-section {
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.stats-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stats-table-container {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--content-bg);
}

.stats-table th {
    background: var(--surface-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.stats-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.stats-table tbody tr:hover {
    background: var(--hover-bg);
}

.stats-table .no-data {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

/* Responsive design for stats */
@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stats-refresh {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Dark theme adjustments for stats */
@media (prefers-color-scheme: dark) {
    .stats-section {
        background: var(--surface-color, #2d2d2d);
        border-color: var(--border-color, #404040);
    }
    
    .stat-card {
        background: var(--content-bg, #1a1a1a);
        border-color: var(--border-color, #404040);
    }
    
    .stats-table {
        background: var(--content-bg, #1a1a1a);
    }
    
    .stats-table th {
        background: var(--surface-color, #2d2d2d);
        border-bottom-color: var(--border-color, #404040);
    }
    
    .stats-table td {
        border-bottom-color: var(--border-color, #404040);
    }
}