/* ZethalMC — BreweryX Recipe Creator (matches assets/css/portfolio.css) */

body {
    padding: 60px 20px;
}

.container {
    max-width: 700px;
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: left;
}

h1 {
    color: var(--text);
    font-size: 2.2em;
    margin: 0 0 10px 0;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

h2 {
    color: var(--accent-bright);
    font-size: 1.2em;
    margin: 30px 0 15px 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 28px;
    padding: 24px 24px 18px 24px;
    background: var(--surface-alt);
}

legend {
    color: var(--accent-bright);
    font-size: 1.1em;
    font-weight: 700;
    padding: 0 12px;
    margin-bottom: 10px;
}

label {
    display: block;
    margin: 12px 0 8px 0;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95em;
}

input,
select,
button {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

input:focus,
select:focus,
button:focus {
    outline: none;
    border-color: var(--accent-bright);
}

button {
    font-weight: 600;
    background: linear-gradient(180deg, var(--accent-bright), var(--accent));
    color: #fff;
    border: none;
    cursor: pointer;
    width: auto;
    margin: 10px 0 0 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(23, 163, 152, 0.3);
}

button[type="submit"] {
    display: block;
    width: 100%;
    padding: 14px 32px;
    font-size: 1.05rem;
    margin-top: 20px;
}

.inline-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.inline-row input,
.inline-row select {
    flex: 1;
    min-width: 160px;
    margin-bottom: 0;
}

.ingredient-row,
.lore-row,
.servercommand-row,
.playercommand-row,
.effect-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.ingredient-row input,
.lore-row input,
.servercommand-row input,
.playercommand-row input,
.effect-row input,
.lore-row select,
.servercommand-row select,
.playercommand-row select {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
}

.ingredient-row .ingredient-source {
    flex: 0 0 150px;
    min-width: 130px;
    margin-bottom: 0;
}

.ingredient-row .ingredient-custom-prefix {
    flex: 0 0 130px;
    min-width: 110px;
    margin-bottom: 0;
}

.ingredient-row .ingredient-item {
    flex: 2;
}

.ingredient-row .ingredient-amount {
    flex: 1;
    min-width: 90px;
}

.removeIngredientBtn,
.removeLoreBtn,
.removeServerCommandBtn,
.removePlayerCommandBtn,
.removeEffectBtn,
.removeOptionalBtn {
    background: var(--surface-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 8px 14px;
    font-size: 1em;
    cursor: pointer;
    margin: 0;
    width: auto;
    flex-shrink: 0;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.removeIngredientBtn,
.removeLoreBtn,
.removeServerCommandBtn,
.removePlayerCommandBtn,
.removeEffectBtn {
    height: 42px;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.removeIngredientBtn:hover,
.removeLoreBtn:hover,
.removeServerCommandBtn:hover,
.removePlayerCommandBtn:hover,
.removeEffectBtn:hover,
.removeOptionalBtn:hover {
    border-color: var(--accent-bright);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

.note {
    font-size: 0.9em;
    color: var(--text-muted);
    margin: 6px 0 10px 0;
    display: block;
    font-style: italic;
}

.note-warning {
    font-style: normal;
    font-weight: 700;
    color: var(--accent-bright);
    background: var(--bg);
    border: 1px solid var(--accent-bright);
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 4px;
}

.optional-block[hidden] {
    display: none !important;
}

.optional-block {
    margin-bottom: 14px;
}

.optional-block.just-added {
    animation: optional-block-flash 1.2s ease;
}

@keyframes optional-block-flash {
    0% {
        box-shadow: 0 0 0 2px var(--accent-bright);
    }

    100% {
        box-shadow: 0 0 0 2px transparent;
    }
}

.optional-fields-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.optional-fields-title {
    display: block;
    color: var(--accent-bright);
    font-size: 1em;
    margin-bottom: 10px;
}

.optional-fields-panel label {
    margin-top: 0;
}

.optional-fields-panel .inline-row {
    flex-wrap: nowrap;
}

.optional-fields-panel select {
    min-width: 0;
}

.optional-fields-panel button {
    width: auto;
    flex-shrink: 0;
    margin: 0;
}

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

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-alt);
    color: var(--text-muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85em;
    letter-spacing: 0.02em;
}

.copy-btn {
    width: auto;
    margin: 0;
    padding: 6px 12px;
    font-size: 0.85em;
    font-weight: 600;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.copy-btn:hover {
    border-color: var(--accent-bright);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

.copy-btn.copied {
    border-color: var(--accent-bright);
    color: var(--accent-bright);
}

#output {
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.6;
    white-space: pre-wrap;
    min-height: 1.6em;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.7em;
    }

    h2 {
        font-size: 1.05em;
    }

    .inline-row,
    .ingredient-row,
    .lore-row,
    .servercommand-row,
    .playercommand-row,
    .effect-row {
        flex-direction: column;
        align-items: stretch;
    }

    .removeIngredientBtn,
    .removeLoreBtn,
    .removeServerCommandBtn,
    .removePlayerCommandBtn,
    .removeEffectBtn {
        width: 100%;
    }

    .ingredient-row .ingredient-source,
    .ingredient-row .ingredient-custom-prefix,
    .ingredient-row .ingredient-item,
    .ingredient-row .ingredient-amount {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    body {
        padding-bottom: 220px;
    }

    .optional-fields-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        box-sizing: border-box;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .optional-fields-panel .inline-row {
        flex-wrap: wrap;
    }

    .optional-fields-panel select,
    .optional-fields-panel button {
        width: 100%;
    }
}
