/* --------------------------------------------
   Minecraft Mob Generator – Clean & Modular
   -------------------------------------------- */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --text: #0f172a;
    --text-light: #475569;
    --border: #e2e8f0;
    --border-focus: #94a3b8;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 24px;
    min-height: 100vh;
}

.app {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.logo-accent {
    color: var(--primary);
    margin-left: 4px;
}

.version {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

/* Mob Selector */
.mob-selector {
    background: var(--surface);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mob-selector label {
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
}

.mob-dropdown {
    flex: 1;
    min-width: 260px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font-size: 15px;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: border 0.15s, box-shadow 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 44px;
}

.mob-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    outline: none;
}

/* Main Layout (Tabs + Content) */
.main-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 24px;
}

.tab-nav {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 1px solid var(--border);
    padding-right: 16px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 16px;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: var(--text);
}

.tab-btn.active {
    background: #eff6ff;
    color: var(--primary-dark);
    font-weight: 600;
}

.tab-content {
    flex: 1;
    min-width: 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

/* --- Rotation-Felder (nur bei NoAI aktiv) --- */
.rotation-field {
    background-color: #f0f9ff;  /* dezentes Hellblau = aktiv durch NoAI */
    border-color: var(--primary);
}

/* Formular-Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    transition: border 0.15s, box-shadow 0.15s;
    font-family: var(--font);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    outline: none;
    background: white;
}

/* Disabled-Zustand – dezent und einheitlich */
.form-field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    border-color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Color-Picker + HEX-Feld */
.color-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-row input[type="color"] {
    width: 50px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    background: white;
}

.color-row input[type="text"] {
    flex: 1;
}

/* Checkboxen als eigene Reihe */
.checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

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

.hint {
    margin-top: 12px;
    color: var(--text-light);
    font-size: 13px;
    font-style: italic;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
}

.placeholder {
    color: var(--text-light);
    background: #f8fafc;
    padding: 24px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 10px;
    font-size: 15px;
}

/* Command Panel */
.command-panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 24px;
}

.command-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.command-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.command-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

#syntaxVersion {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    font-size: 14px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
}

.btn.primary {
    background: var(--primary);
    color: white;
}

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

.btn.secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background: #f1f5f9;
}

.command-output textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0a0f1a;
    color: #e2e8f0;
    font-family: 'Menlo', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

/* Aktivierungs-Sektionen (Enable-Checkboxen) */
.enable-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.enable-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    margin: 0;
    cursor: pointer;
}

.enable-section label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    margin: 0;
    text-transform: none;
}

/* --- Trade-UI (komplett ohne Inline-Styles) --- */
.trade-container {
    margin-top: 20px;
}

.trade-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.trade-item {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.trade-item:hover {
    box-shadow: var(--shadow-lg);
}

.trade-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.trade-item-header span {
    font-weight: 600;
    color: var(--text);
}

.trade-remove-btn {
    background: #fee2e2;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #b91c1c;
    cursor: pointer;
    transition: 0.1s;
}

.trade-remove-btn:hover {
    background: #fecaca;
}

.trade-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 16px;
    align-items: end;
}

.trade-grid label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.trade-grid input[type="number"],
.trade-grid input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.trade-buyB-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}

.trade-buyB-title {
    font-size: 14px;
    font-weight: 600;
    color: #6b21a8;
    margin-bottom: 12px;
}

.trade-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
    background: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
}

.trade-settings-grid label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.trade-settings-grid input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.btn-trade-add {
    background: var(--primary);
    color: white;
}

.btn-trade-special {
    background: #8b5cf6;
    color: white;
}

.btn-trade-add:hover,
.btn-trade-special:hover {
    filter: brightness(0.95);
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    padding: 16px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
    }
    .tab-nav {
        flex: auto;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 16px;
    }
    .tab-btn {
        flex: 1 0 auto;
    }
    .trade-grid {
        grid-template-columns: 1fr;
    }
    .trade-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    body { padding: 12px; }
    .header { flex-direction: column; align-items: start; }
    .mob-selector { flex-direction: column; align-items: stretch; }
    .form-grid { grid-template-columns: 1fr; }
    .command-header { flex-direction: column; align-items: stretch; }
    .command-actions { flex-direction: column; }
}