/* Recipe Form Specific Styles */
.container {
    max-width: 900px;
    margin: 0 auto;
}

.page-title {
    color: var(--color-purple-dark);
    margin: 0 auto 30px;
    text-align: center;
    font-size: 2em;
    font-weight: 700;
    display: table;
    border-bottom: 2px solid var(--color-yellow);
    padding-bottom: 0.4rem;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--color-purple-light);
    border-radius: 10px;
    border: 1px solid var(--color-purple);
    box-sizing: border-box;
    overflow: hidden;
}

#ingredientsContainer,
#stepsContainer {
    width: 100%;
    overflow: hidden;
}

.form-section h3 {
    color: var(--color-purple-dark);
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid var(--color-yellow);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-ink);
    font-weight: 600;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 0.6em 0.75em;
    border: 2px solid var(--color-purple);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--color-paper);
    color: var(--color-ink);
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-purple-dark);
    box-shadow: 0 0 0 3px rgba(125, 95, 181, 0.25);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-ink);
    opacity: 0.5;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.ingredient-item,
.step-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    cursor: move;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s;
    box-sizing: border-box;
    width: 100%;
}

.ingredient-item:hover,
.step-item:hover {
    background-color: var(--color-yellow-light);
}

.ingredient-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    margin-top: 15px;
    align-items: center;
    padding: 15px;
    background: var(--color-purple-light);
    border-radius: 8px;
    border-left: 4px solid var(--color-purple-dark);
    cursor: move;
    box-sizing: border-box;
    width: 100%;
}

.ingredient-section:hover {
    background-color: var(--color-yellow-light);
}

.ingredient-section input {
    flex: 1;
    font-weight: 600;
    background: var(--color-paper);
}

.ingredient-section .btn-remove {
    flex-shrink: 0;
}

.ingredient-item input,
.step-item textarea {
    flex: 1;
}

.ingredient-item.dragging,
.step-item.dragging,
.ingredient-section.dragging {
    opacity: 0.4;
    background-color: var(--color-purple-light);
}

.drag-over {
    border: 2px dashed var(--color-yellow-dark);
    background-color: var(--color-yellow-light);
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-add {
    background: var(--color-purple);
    color: #fff;
}

.btn-add:hover {
    background: var(--color-purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(125, 95, 181, 0.35);
}

.btn-section {
    background: var(--color-purple-dark);
    color: #fff;
}

.btn-section:hover {
    background: var(--color-purple);
}

.btn-remove {
    background: #c0392b;
    color: #fff;
    padding: 8px 16px;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #a5301f;
}

.btn-generate {
    background: linear-gradient(135deg, #6a4a9e, #b8952f);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    width: 100%;
    padding: 16px;
    font-size: 16px;
    margin-top: 20px;
    font-weight: bold;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(217, 189, 74, 0.35);
}

.btn-reset {
    background: #c0392b;
    color: #fff;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    margin-top: 10px;
    font-weight: bold;
}

.btn-reset:hover {
    background: #a5301f;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(192, 57, 43, 0.3);
}

.copy-btn {
    background: #2f9e60;
    color: #fff;
    margin-top: 10px;
    margin-right: 10px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.copy-btn:hover {
    background: #268049;
    box-shadow: 0 5px 15px rgba(47, 158, 96, 0.35);
}

.drag-handle {
    cursor: grab;
    color: var(--color-yellow-dark);
    font-size: 18px;
    padding: 0 5px;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.order-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btn-order {
    background: var(--color-purple);
    color: #fff;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1;
    min-width: 30px;
}

.btn-order:hover {
    background: var(--color-purple-dark);
    transform: none;
}

.output {
    margin-top: 30px;
    padding: 20px;
    background: var(--color-yellow-light);
    border-radius: 10px;
    display: none;
    border: 2px solid var(--color-yellow);
}

.output pre {
    color: var(--color-ink);
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

    .container {
        padding: 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group button {
        width: 100%;
    }
}
