/* MCP Visualization Tool Styles */

:root {
    --primary-color: #6366F1;
    --secondary-color: #8B5CF6;
    --background-color: #F8FAFC;
    --text-color: #1E293B;
    --accent-color: #10B981;
    --border-color: #E2E8F0;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --success-color: #10B981;
    --spacing: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.h-100 {
    height: 100vh !important;
}

/* Sidebar Styles */
.sidebar {
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 0;
    overflow-y: auto;
    height: 100vh;
}

.sidebar-header {
    padding: var(--spacing);
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-color);
    color: white;
}

.sidebar-title {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.connection-section {
    padding: var(--spacing);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--spacing);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background-color: #5145e5;
    border-color: #5145e5;
}

.connection-status {
    padding: var(--spacing);
    border-bottom: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger-color);
    margin-right: 8px;
    transition: background-color 0.3s ease;
}

.status-dot.connected {
    background-color: var(--success-color);
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-section {
    padding: var(--spacing);
}

.nav-pills .nav-link {
    color: var(--text-color);
    border-radius: 6px;
    margin-bottom: 4px;
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 0.875rem;
}

.nav-pills .nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Main Content Styles */
.main-content {
    padding: 0;
    height: 100vh;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
}

.content-header {
    background: white;
    padding: calc(var(--spacing) * 2);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.page-title {
    margin: 0;
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.75rem;
}

.page-subtitle {
    margin: 8px 0 0 0;
    color: #64748b;
    font-size: 1rem;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 140px);
    text-align: center;
    padding: var(--spacing);
}

.welcome-content {
    max-width: 500px;
}

.welcome-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing) * 1.5);
}

.welcome-content h3 {
    color: var(--text-color);
    margin-bottom: var(--spacing);
    font-weight: 600;
}

.welcome-content p {
    color: #64748b;
    margin-bottom: calc(var(--spacing) * 2);
    line-height: 1.6;
}

.example-urls {
    text-align: left;
    background: white;
    padding: calc(var(--spacing) * 1.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.example-urls h6 {
    font-weight: 600;
    margin-bottom: var(--spacing);
    color: var(--text-color);
}

.example-urls ul {
    margin: 0;
    padding-left: 20px;
}

.example-urls li {
    margin-bottom: 8px;
    color: #64748b;
}

.example-urls code {
    background: var(--background-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--primary-color);
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 140px);
    text-align: center;
}

.loading-screen p {
    color: #64748b;
    margin: 0;
}

/* Tab Content */
.tab-content {
    padding: calc(var(--spacing) * 2);
}

.section-header {
    margin-bottom: calc(var(--spacing) * 2);
}

.section-header h4 {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: var(--text-color);
}

.section-header p {
    margin: 0;
    color: #64748b;
}

/* Info Cards */
.info-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: calc(var(--spacing) * 1.5);
    margin-bottom: var(--spacing);
    height: fit-content;
}

.info-card .card-title {
    margin: 0 0 var(--spacing) 0;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.info-label {
    font-weight: 500;
    color: var(--text-color);
    margin-right: var(--spacing);
    min-width: 80px;
}

.info-value {
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    word-break: break-all;
}

/* Tool and Resource Cards */
.tool-card, .resource-card, .tester-tool-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: var(--spacing);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.tool-card:hover, .resource-card:hover, .tester-tool-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tool-header, .resource-header {
    padding: calc(var(--spacing) * 1.5);
    background: #fafbfc;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tool-header > div:first-child, .resource-header > div:first-child {
    flex: 1;
    min-width: 0;
}

/* Client Tester Specific Styles */
.tester-tool-body {
    padding: calc(var(--spacing) * 1.5);
}

.client-tester-content {
    padding: var(--spacing);
}

.tester-form {
    margin: 0;
}

.parameters-section h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.result-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.result-section h6 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-section pre {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Result Tabs */
.result-tabs {
    display: flex;
    gap: 0.25rem;
}

.result-tabs button {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
}

.result-tabs button.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.result-content {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
}

/* JSON Tree Styles */
.json-tree {
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.json-line {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 1px 0;
}

.json-child {
    margin-left: 1.5rem;
}

.json-children {
    display: none;
}

.json-children.expanded {
    display: block;
}

.json-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
    margin-left: 0.25rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.json-toggle:hover {
    color: var(--primary-color);
}

.json-key {
    color: #d73a49;
    font-weight: 500;
}

.json-string {
    color: #032f62;
}

.json-string-label {
    color: #005cc5;
    font-weight: 600;
    font-style: italic;
}

.json-number {
    color: #005cc5;
}

.json-boolean {
    color: #e36209;
}

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

.json-bracket {
    color: #24292e;
    font-weight: bold;
}

.json-comma {
    color: #24292e;
}

.json-unknown {
    color: #6a737d;
}

.tool-title, .resource-title {
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.tool-description, .resource-description {
    color: #64748b;
    margin: 4px 0 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    width: 100%;
    max-width: 100%;
}

/* Structured text formatting for tool descriptions */
.tool-description .section-header {
    color: var(--primary-color);
    font-weight: 600;
    margin: 12px 0 6px 0;
    display: block;
    font-size: 0.9em;
}

.tool-description .args-header,
.tool-description .returns-header {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9em;
    margin: 8px 0 4px 0;
}

.tool-description .arg-name {
    color: var(--secondary-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    font-weight: 500;
}

.tool-description .bullet-point {
    color: var(--secondary-color);
    font-weight: 500;
}

.tool-description .action-item {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.tool-description .technical-note {
    color: #64748b;
    font-style: italic;
    font-size: 0.9em;
}

.tool-description .version-id {
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8em;
    font-weight: 500;
}

/* Collapsible Sections */
.collapsible-section {
    margin-top: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--background-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.collapsible-header:hover {
    background: #E2E8F0;
}

.collapsible-header .section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.collapsible-header .chevron-icon {
    width: 16px;
    height: 16px;
    color: var(--text-color);
    transition: transform 0.2s ease;
}

.collapsible-content {
    padding: 12px;
    background: white;
    border-top: none;
    line-height: 1.4;
    font-size: 0.8rem;
}

.collapsible-content .args-header,
.collapsible-content .returns-header {
    display: none;
}

/* Enhanced argument name styling */
.collapsible-content .arg-name-enhanced {
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    margin-right: 4px;
}

.collapsible-content .arg-name {
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    font-weight: 600;
}

/* Make all content in collapsible sections smaller and more compact */
.collapsible-content * {
    font-size: inherit !important;
    line-height: 1.4 !important;
}

.collapsible-content br {
    line-height: 1.2;
}

.expand-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.expand-btn:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

.tool-body, .resource-body {
    padding: calc(var(--spacing) * 1.5);
    display: none;
}

.tool-body.expanded, .resource-body.expanded {
    display: block;
}

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

.parameter-item {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

.parameter-name {
    font-weight: 600;
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

.parameter-type {
    background: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 8px;
}

.parameter-required {
    background: var(--danger-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 4px;
}

.parameter-description {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 4px;
    flex: 1;
}

.parameter-details {
    text-align: right;
    display: flex;
    align-items: center;
}

/* Action Buttons */
.action-buttons {
    margin-top: var(--spacing);
    display: flex;
    gap: 8px;
}

.btn-action {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.btn-action:hover {
    background-color: #5145e5;
}

.btn-secondary-action {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.btn-secondary-action:hover {
    background-color: #7c3aed;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: calc(var(--spacing) * 3);
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: var(--spacing);
}

.empty-state h5 {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.empty-state p {
    margin: 0;
    line-height: 1.6;
}

/* Error Styles */
.alert {
    border-radius: 8px;
    margin: var(--spacing);
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Code Blocks */
pre {
    background: #1e293b;
    border-radius: 6px;
    padding: var(--spacing);
    margin: 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

code {
    font-family: 'JetBrains Mono', monospace;
}

/* Modal Customizations */
.modal-content {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

.modal-title {
    font-weight: 600;
    display: flex;
    align-items: center;
}

/* Parameter Form Styles */
.parameter-form-group {
    margin-bottom: var(--spacing);
}

.parameter-form-group label {
    font-weight: 500;
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

.parameter-form-group .form-control {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

.parameter-form-group .form-text {
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .content-header {
        padding: var(--spacing);
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .tab-content {
        padding: var(--spacing);
    }
}

/* Utility Classes */
.text-monospace {
    font-family: 'JetBrains Mono', monospace !important;
}

.fw-medium {
    font-weight: 500 !important;
}

.text-muted {
    color: #64748b !important;
}
