/* Стили для формы добавления рецепта */
.add-recipe-form {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #ff6b6b;
    outline: none;
}

.form-group input[type="file"] {
    padding: 8px;
}

.hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    display: block;
    font-style: italic;
}

.error {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 5px;
    display: block;
    min-height: 18px;
    visibility: hidden;
}

.error:not(:empty) {
    visibility: visible;
}

.submit-btn {
    background: #ff6b6b;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    width: 100%;
    margin-top: 20px;
}

.submit-btn:hover {
    background: #e55a5a;
}

.submit-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.errors-summary {
    background: #ffebee;
    border: 1px solid #d32f2f;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    min-height: 60px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.errors-summary.has-errors {
    visibility: visible;
    opacity: 1;
}

.error-title {
    font-size: 16px;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 10px;
    color: #d32f2f;
}

.errors-list {
    margin: 0;
    padding-left: 20px;
    color: #d32f2f;
}

.errors-list li {
    margin-bottom: 5px;
}

/* Стили для невалидных полей */
.form-group input:invalid,
.form-group textarea:invalid,
.form-group select:invalid {
    border-color: #d32f2f;
}

/* Стили для динамических ингредиентов */
.ingredient-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.ingredient-name {
    flex: 2;
}

.ingredient-amount {
    flex: 1;
    max-width: 120px;
}

.ingredient-unit {
    flex: 1;
    max-width: 150px;
}

.remove-ingredient-btn {
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-ingredient-btn:hover {
    background: #b71c1c;
}

.add-ingredient-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.add-ingredient-btn:hover {
    background: #45a049;
}

#ingredients-container {
    margin-bottom: 10px;
}

.ingredient-amount:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.ingredient-amount:disabled::placeholder {
    color: #ccc;
}



/* Toast-уведомления */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
    width: 100%;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    border-left: 4px solid;
}

.toast.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-hide {
    transform: translateX(400px);
    opacity: 0;
}

.toast-success {
    border-left-color: #4CAF50;
}

.toast-error {
    border-left-color: #d32f2f;
}

.toast-warning {
    border-left-color: #ff9800;
}

.toast-info {
    border-left-color: #2196F3;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: #4CAF50;
    color: white;
}

.toast-error .toast-icon {
    background: #d32f2f;
    color: white;
}

.toast-warning .toast-icon {
    background: #ff9800;
    color: white;
}

.toast-info .toast-icon {
    background: #2196F3;
    color: white;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.3s;
}

.toast-close:hover {
    color: #333;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    animation: progress 5s linear forwards;
}

.toast-success .toast-progress {
    background: #4CAF50;
}

.toast-error .toast-progress {
    background: #d32f2f;
}

.toast-warning .toast-progress {
    background: #ff9800;
}

.toast-info .toast-progress {
    background: #2196F3;
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Анимация для кнопки отправки */
.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Улучшение для мобильных устройств */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        width: 100%;
    }
}