:root {
    --bg: #1a1a2e;
    --surface: #16213e;
    --surface-hover: #1a2745;
    --border: #2a3a5c;
    --text: #e0e0e0;
    --text-muted: #8892a8;
    --accent: #4fc3f7;
    --cat-environment: #4caf50;
    --cat-events: #ff9800;
    --cat-fun: #ab47bc;
    --cat-player: #42a5f5;
    --cat-vehicle: #ef5350;
    --cat-zombies: #b71c1c;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.app-header h1 {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Filters */
.filters {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.search-input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--accent);
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cat-btn {
    padding: 0.3rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    opacity: 0.7;
}

.cat-btn:hover {
    opacity: 1;
}

.cat-btn.active {
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.cat-btn.cat-environment { background: var(--cat-environment); color: #fff; }
.cat-btn.cat-events { background: var(--cat-events); color: #fff; }
.cat-btn.cat-fun { background: var(--cat-fun); color: #fff; }
.cat-btn.cat-player { background: var(--cat-player); color: #fff; }
.cat-btn.cat-vehicle { background: var(--cat-vehicle); color: #fff; }
.cat-btn.cat-zombies { background: var(--cat-zombies); color: #fff; }

/* Action Cards */
.actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.action-card[open] {
    border-color: var(--accent);
}

.action-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.action-header::-webkit-details-marker {
    display: none;
}

.action-header::before {
    content: '\25B6';
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.action-card[open] > .action-header::before {
    transform: rotate(90deg);
}

.action-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.cat-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.cat-badge.cat-environment { background: var(--cat-environment); color: #fff; }
.cat-badge.cat-events { background: var(--cat-events); color: #fff; }
.cat-badge.cat-fun { background: var(--cat-fun); color: #fff; }
.cat-badge.cat-player { background: var(--cat-player); color: #fff; }
.cat-badge.cat-vehicle { background: var(--cat-vehicle); color: #fff; }
.cat-badge.cat-zombies { background: var(--cat-zombies); color: #fff; }

.action-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.quick-copy-btn {
    margin-left: auto;
    padding: 0.2rem 0.6rem;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.7rem;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.quick-copy-btn:hover {
    background: #81d4fa;
}

.quick-copy-btn.copied {
    background: #4caf50;
    color: #fff;
}

/* Action Body */
.action-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border);
}

.params-section,
.global-section,
.examples-section {
    margin-top: 0.8rem;
}

.params-section h4,
.global-section h4,
.examples-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.global-section {
    border-top: 1px dashed var(--border);
    padding-top: 0.8rem;
}

/* Parameter Rows */
.param-row {
    margin-bottom: 0.6rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}

.param-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
}

.param-name {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.param-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

.badge {
    font-size: 0.6rem;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-required { background: #c62828; color: #fff; }
.badge-optional { background: #455a64; color: #cfd8dc; }
.badge-auto { background: #1565c0; color: #bbdefb; }

.param-constraints {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
}

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

/* Inputs */
.param-input,
.checkbox-label input[type="checkbox"] {
    font-family: inherit;
}

.param-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.param-input:focus {
    border-color: var(--accent);
}

select.param-input {
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
}

/* Output */
.output-section {
    margin-top: 1rem;
}

.output-wrapper {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--accent);
}

.output-field {
    flex: 1;
    padding: 0.6rem 0.8rem;
    background: #0d1117;
    color: #7ee787;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    border: none;
    outline: none;
    cursor: text;
}

.default-btn {
    padding: 0.6rem 1rem;
    background: #455a64;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    transition: background 0.2s;
    white-space: nowrap;
    border-right: 1px solid var(--border);
}

.default-btn:hover {
    background: #546e7a;
}

.default-btn.copied {
    background: #4caf50;
}

.copy-btn {
    padding: 0.6rem 1rem;
    background: var(--accent);
    color: #000;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #81d4fa;
}

.copy-btn.copied {
    background: #4caf50;
    color: #fff;
}

/* Examples */
.examples-section {
    border-top: 1px dashed var(--border);
    padding-top: 0.6rem;
}

.example-line {
    display: block;
    padding: 0.3rem 0.6rem;
    margin-bottom: 0.2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    word-break: break-all;
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Responsive */
@media (max-width: 640px) {
    .app-header h1 {
        font-size: 1.4rem;
    }

    .action-header {
        flex-wrap: wrap;
    }

    .action-desc {
        width: 100%;
        white-space: normal;
    }

    .param-constraints {
        margin-left: 0;
        width: 100%;
    }
}
