:root {
    --bg-base: #09090b;
    --bg-surface: #18181b;
    --bg-elevated: #27272a;
    --border: #3f3f46;
    --border-hover: #52525b;
    
    --brand-primary: #f59e0b; /* Amber/Orange */
    --brand-primary-hover: #d97706;
    --brand-secondary: #fef3c7;
    
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 12px;
    
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --sidebar-width: 280px;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4 { color: var(--text-primary); }
h1 { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
h2 { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
h3 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem;}
pre { font-family: var(--font-mono); font-size: 0.875rem; }

/* Layout */
.app-container {
    display: flex;
    height: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sidebar Components */
.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-primary);
}

.logo i { width: 24px; height: 24px; }

.version-badge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--brand-primary);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.sidebar-section {
    padding: 1.5rem 0 0.5rem 0;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.section-header {
    padding: 0 1.5rem 0.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.server-list, .tool-list {
    list-style: none;
    margin: 0;
    padding: 0 0.75rem;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.nav-btn.active {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--brand-primary);
}

.nav-btn:hover:not(.active) {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-btn i { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Main Content Components */
.main-header {
    height: 70px;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-surface);
}

.tool-title-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tool-title-area h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    text-transform: none;
    letter-spacing: normal;
}

.badge {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
}

.badge.brand {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--brand-primary);
    border-color: rgba(245, 158, 11, 0.2);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Playground Area */
.playground-area {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 1.5rem;
    gap: 1.5rem;
    background-image: radial-gradient(var(--bg-elevated) 1px, transparent 0);
    background-size: 30px 30px;
    background-position: -15px -15px;
}

.pane {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}

.input-pane {
    flex: 1;
    min-width: 400px;
}

.output-pane {
    flex: 1;
    min-width: 450px;
}

/* Panels */
.panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 i { width: 16px; height: 16px; color: var(--text-secondary); }

.panel-body {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.panel-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.02);
}

.p-0 { padding: 0 !important; }
.relative { position: relative; }

/* Tool Description & Security */
.tool-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.security-warning {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.security-warning i { color: var(--error); flex-shrink: 0; }
.security-warning strong { color: var(--error); font-size: 0.875rem; }
.security-warning p { color: var(--text-secondary); font-size: 0.8rem; margin-top: 0.25rem; }

/* Schema Viewer & Output JSON */
.schema-viewer, .tab-content pre {
    background-color: var(--bg-base);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid var(--border);
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.schema-viewer { max-height: 250px; }
.tab-content { display: none; height: 100%; }
.tab-content.active { display: block; }

.tab-content pre {
    height: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

/* Forms */
.parameter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
}
.form-group label span.required { color: var(--error); }
.form-group label span.type { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.7rem; }

.form-group input, .form-group textarea, .form-group select {
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--brand-primary);
}

.form-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    background: transparent;
    border: none;
    padding: 0.4rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.tab.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.tab:hover:not(.active) { color: var(--text-primary); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn i { width: 16px; height: 16px; }

.w-full { width: 100%; }

.btn-primary {
    background-color: var(--brand-primary);
    color: var(--bg-base);
}
.btn-primary:hover:not(:disabled) { background-color: var(--brand-primary-hover); }

.btn-secondary {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background-color: var(--border-hover); }

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

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
}
.btn-icon i { width: 18px; height: 18px; }

/* Empty States */
.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}
.hidden { display: none !important; }

/* Loader */
.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 24, 27, 0.8);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--brand-primary);
    font-size: 0.875rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(245, 158, 11, 0.2);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Syntax Highlighting overrides for JSON */
.language-json .string { color: #a5d6ff; }
.language-json .number { color: #79c0ff; }
.language-json .boolean { color: #56d364; }
.language-json .null { color: #ff7b72; }
.language-json .key { color: #d2a8ff; font-weight: 500; }

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden { opacity: 0; pointer-events: none; }

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}
.modal-content.large { max-width: 700px; }

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

#importSpecInput {
    width: 100%;
    height: 250px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    resize: vertical;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.prose h4 { margin-top: 0; margin-bottom: 0.5rem; font-size: 1.1rem; }
.prose h5 { margin-top: 1rem; margin-bottom: 0.5rem; color: var(--text-secondary); }
.prose p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 1rem; }
.prose pre { background: var(--bg-base); padding: 1rem; border-radius: var(--radius-md); border: 1px solid var(--border); overflow-x: auto; }
