/**
 * MCP Bridge Client Styles
 */

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #21262d;
    --border: #30363d;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --success: #3fb950;
    --error: #f85149;
    --warning: #d29922;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 1.125rem;
}

.logo-icon {
    font-size: 1.25rem;
}

.header-status {
    flex: 1;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

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

.status.disconnected {
    border-color: var(--error);
    color: var(--error);
}

.status.connecting {
    border-color: var(--accent);
    color: var(--accent);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.header-links {
    display: flex;
    gap: 1rem;
}

.header-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s;
}

.header-links a:hover {
    color: var(--accent);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 320px 280px 1fr;
    gap: 1px;
    flex: 1;
    background: var(--border);
}

.main-content>section {
    background: var(--bg);
    padding: 1.25rem;
    overflow-y: auto;
}

.main-content h2 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Connection Panel */
.connection-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.input-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.input-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--surface);
    color: var(--text);
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-primary {
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.375rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-primary:hover {
    opacity: 0.9;
}

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

.btn-ghost {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.info-box {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.info-box h3 {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.info-box p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.info-box code {
    background: var(--surface-2);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.info-box pre {
    background: var(--surface-2);
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
}

/* Tools Panel */
.tools-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tools-placeholder {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

.tool-item {
    padding: 0.625rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
}

.tool-name {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
}

.tool-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Activity Log */
.log-panel {
    display: flex;
    flex-direction: column;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.activity-log {
    flex: 1;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.log-entry {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    margin-right: 0.75rem;
}

.log-type {
    display: inline-block;
    min-width: 4rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.log-entry.in .log-type {
    color: var(--accent);
}

.log-entry.out .log-type {
    color: var(--success);
}

.log-entry.error .log-type {
    color: var(--error);
}

.log-entry.success .log-type {
    color: var(--success);
}

.log-entry.info .log-type {
    color: var(--text-muted);
}

.log-content {
    word-break: break-word;
}

.log-details {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--surface-2);
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }
}