:root {
    --primary: #2496ED;
    --primary-hover: #1e7bc4;
    --bg-main: #0D1117;
    --bg-card: #161B22;
    --bg-input: #0D1117;
    --border: #30363D;
    --border-focus: #58A6FF;
    --text-main: #C9D1D9;
    --text-muted: #8B949E;
    --radius: 6px;
    --transition: 0.2s ease;
    --code-bg: #010409;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 1rem 2rem;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    color: var(--primary);
}

h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #c9d1d9;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

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

/* Form Styles */
.section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

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

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.required {
    color: var(--primary);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(36, 150, 237, 0.3);
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Dynamic Lists (Ports, Mounts, Env) */
.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.list-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.list-item input {
    flex: 1;
}

.btn-icon {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: #f85149;
    color: white;
    border-color: #f85149;
}

.btn-add {
    background: transparent;
    color: var(--primary);
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.btn-add:hover {
    text-decoration: underline;
}

/* Presets */
.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.preset {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.preset:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

/* Command Output Sticky Panel */
.output-panel {
    position: sticky;
    top: 2rem;
}

.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-copy {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.btn-copy:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

.code-content {
    padding: 1rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.85rem;
    color: #e6edf3;
    word-break: break-all;
    white-space: pre-wrap;
    min-height: 100px;
}

.kw {
    color: #ff7b72;
}

.fl {
    color: #79c0ff;
}

.str {
    color: #a5d6ff;
}

.img {
    color: #d2a8ff;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
    z-index: 10;
    margin-bottom: 5px;
}

[data-tooltip]:hover:after {
    opacity: 1;
}