:root {
    /* Hot Pink Palette */
    --primary: #E84393;
    --primary-hover: #e02a82;
    --secondary: #FD79A8;
    --accent: #00CEC9;
    --bg-dark: #1A0A14;
    --bg-panel: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(0, 0, 0, 0.3);
    --border: rgba(232, 67, 147, 0.15);
    --border-focus: rgba(232, 67, 147, 0.5);

    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-dark: #1A0A14;

    --syntax-cmd: #FD79A8;
    --syntax-key: #00CEC9;
    --syntax-val: #ffeaa7;
    --syntax-arg: #a29bfe;

    --radius: 12px;
    --radius-sm: 8px;
    --transition: 200ms ease;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(232, 67, 147, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(0, 206, 201, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    background: linear-gradient(135deg, var(--primary), #a22964);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(232, 67, 147, 0.2);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1.2fr 1fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

/* Common Panel */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding: 0 1rem;
}

/* --- Sidebar --- */
.sidebar {
    overflow-y: auto;
}

.sidebar-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.search-section {
    padding: 1.25rem 1rem;
}

.search-wrap {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-wrap input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-main);
    font-family: inherit;
    transition: all var(--transition);
    outline: none;
}

.search-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--border-focus);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0.5rem;
}

.nav-item {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(232, 67, 147, 0.15);
    color: var(--primary);
    font-weight: 500;
}

.cmd-count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 99px;
}

/* Sub-items generic style */
.cmd-sublist {
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.25rem;
    display: none;
}

.nav-item.active+.cmd-sublist {
    display: block;
}

.cmd-item {
    padding: 0.4rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.cmd-item:hover {
    color: var(--secondary);
    background: rgba(255, 255, 255, 0.03);
}

.cmd-item.active {
    color: var(--primary);
    background: rgba(232, 67, 147, 0.1);
}

/* --- Builder Area --- */
.config-area {
    flex: 1;
}

.config-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cmd-title-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.cmd-title-wrap h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: var(--primary);
}

.badge {
    background: rgba(0, 206, 201, 0.15);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(0, 206, 201, 0.3);
}

.cmd-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.config-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Dynamic Inputs */
.param-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.param-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.param-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.param-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.param-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
    width: 100%;
}

.param-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--border-focus);
}

.param-input.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Opts toggles */
.opts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.opt-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.opt-toggle.active {
    background: rgba(232, 67, 147, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* Docs Panel */
.docs-toggle-wrap {
    padding: 0 1.5rem 1.5rem;
}

.docs-panel {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
}

.docs-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.docs-syntax {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 1rem;
    background: rgba(0, 206, 201, 0.05);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    line-height: 1.5;
}

.docs-content {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- Preview Area --- */
.preview-area {
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.code-preview {
    padding: 1.5rem;
    position: relative;
}

.code-actions {
    position: absolute;
    right: 2rem;
    top: 2rem;
}

.syntax-highlighted {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    line-height: 1.6;
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.cmd-node {
    color: var(--syntax-cmd);
    font-weight: 700;
}

.key-node {
    color: var(--syntax-key);
}

.val-node {
    color: var(--syntax-val);
}

.arg-node {
    color: var(--syntax-arg);
}

.terminal-mock {
    margin: 0 1.5rem 1.5rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid #333;
    background: #000;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.term-header {
    background: #1a1a1a;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #333;
}

.term-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    background: #ed6a5e;
}

.term-dots span:nth-child(2) {
    background: #f4bf4f;
}

.term-dots span:nth-child(3) {
    background: #61c554;
}

.term-title {
    color: #888;
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
}

.term-body {
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #fff;
    flex: 1;
}

.term-prompt {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.term-input {
    color: #ddd;
}

.term-line.output {
    color: var(--success);
    margin-top: 0.5rem;
}

/* Buttons & Utils */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn.ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn.ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-sm {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

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

.hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: var(--primary);
    color: var(--bg-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(232, 67, 147, 0.3);
    z-index: 100;
    transition: all 0.3s ease;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 250px 1fr;
    }

    .preview-area {
        grid-column: 1 / -1;
    }

    .app-container {
        height: auto;
        display: block;
    }
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}