Index: NutriMatch/Controllers/RecipesController.cs
===================================================================
--- NutriMatch/Controllers/RecipesController.cs	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/Controllers/RecipesController.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -36,5 +36,5 @@
                 return NotFound();
             }
-            return View(recipe);
+            return PartialView("RecipeDetailsPartial", recipe);
         }
         public IActionResult Create()
@@ -127,5 +127,8 @@
                 return NotFound();
             }
-            var recipe = await _context.Recipes.FindAsync(id);
+            var recipe = await _context.Recipes
+        .Include(r => r.RecipeIngredients)
+            .ThenInclude(ri => ri.Ingredient)
+        .FirstOrDefaultAsync(r => r.Id == id);
             if (recipe == null)
             {
@@ -142,23 +145,74 @@
                 return NotFound();
             }
+            float ConvertType(float number, string unit)
+            {
+                switch (unit.ToLower())
+                {
+                    case "g":
+                        return number / 100; 
+                    case "ml":
+                        return number / 100; 
+                    case "oz":
+                        return (float)(number * 28.3495 / 100); 
+                    default:
+                        return 0;
+                }
+            }
             if (ModelState.IsValid)
             {
-                try
-                {
-                    _context.Update(recipe);
-                    await _context.SaveChangesAsync();
-                }
-                catch (DbUpdateConcurrencyException)
-                {
-                    if (!RecipeExists(recipe.Id))
-                    {
-                        return NotFound();
-                    }
-                    else
-                    {
-                        throw;
-                    }
-                }
+                var file = Request.Form.Files.GetFile("RecipeImage");
+                if (file != null && file.Length > 0)
+                {
+                    var uploadsFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "images");
+                    var uniqueFileName = Guid.NewGuid().ToString() + Path.GetExtension(file.FileName);
+                    var filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                    using (var stream = new FileStream(filePath, FileMode.Create))
+                    {
+                        await file.CopyToAsync(stream);
+                    }
+                    recipe.ImageUrl = "/images/" + uniqueFileName;
+                } else {
+                    Console.WriteLine("No file uploaded or file is empty.");
+                }
+                string selectedIngredients = Request.Form["Ingredients"];
+                List<SelectedIngredient> ingredients = JsonSerializer.Deserialize<List<SelectedIngredient>>(selectedIngredients);
+                float totalCalories = 0;
+                float totalProtein = 0;
+                float totalCarbs = 0;
+                float totalFat = 0;
+                foreach (var i in ingredients)
+                {
+                    _context.RecipeIngredients.Add(new RecipeIngredient
+                    {
+                        RecipeId = recipe.Id,
+                        IngredientId = i.Id,
+                        Unit = i.Unit,
+                        Quantity = i.Quantity
+                    });
+                    Ingredient tempIngredient = _context.Ingredients.Find(i.Id);
+                    totalCalories += ConvertType(tempIngredient.Calories, i.Unit) * i.Quantity;
+                    totalProtein += ConvertType(tempIngredient.Protein, i.Unit) * i.Quantity;
+                    totalCarbs += ConvertType(tempIngredient.Carbs, i.Unit) * i.Quantity;
+                    totalFat += ConvertType(tempIngredient.Fat, i.Unit) * i.Quantity;
+                }
+                recipe.Calories = totalCalories;
+                recipe.Protein = totalProtein;
+                recipe.Carbs = totalCarbs;
+                recipe.Fat = totalFat;
+                _context.Update(recipe);
+                await _context.SaveChangesAsync();
                 return RedirectToAction(nameof(Index));
+            }
+            else
+            {
+                foreach (var key in ModelState.Keys)
+                {
+                    var errors = ModelState[key].Errors;
+                    foreach (var error in errors)
+                    {
+                        Console.WriteLine($"Key: {key} - Error: {error.ErrorMessage}");
+                    }
+                }
+                Console.WriteLine("Model state is invalid. Please check the input data.");
             }
             return View(recipe);
Index: NutriMatch/Data/AppDbContext.cs
===================================================================
--- NutriMatch/Data/AppDbContext.cs	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/Data/AppDbContext.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -10,4 +10,5 @@
         public DbSet<Ingredient> Ingredients { get; set; }
         public DbSet<RestaurantMeal> RestaurantMeals { get; set; }
+        public DbSet<Restaurant> Restaurants { get; set; }
         protected override void OnModelCreating(ModelBuilder modelBuilder)
         {
Index: NutriMatch/Migrations/20250624141408_AddRestaurantModel.Designer.cs
===================================================================
--- NutriMatch/Migrations/20250624141408_AddRestaurantModel.Designer.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
+++ NutriMatch/Migrations/20250624141408_AddRestaurantModel.Designer.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -0,0 +1,158 @@
+﻿// <auto-generated />
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using NutriMatch.Data;
+#nullable disable
+namespace NutriMatch.Migrations
+{
+    [DbContext(typeof(AppDbContext))]
+    [Migration("20250624141408_AddRestaurantModel")]
+    partial class AddRestaurantModel
+    {
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasAnnotation("ProductVersion", "9.0.5")
+                .HasAnnotation("Relational:MaxIdentifierLength", 63);
+            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+            modelBuilder.Entity("NutriMatch.Models.Ingredient", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer")
+                        .HasColumnName("id");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<float>("Calories")
+                        .HasColumnType("real")
+                        .HasColumnName("energy_kcal");
+                    b.Property<float>("Carbs")
+                        .HasColumnType("real")
+                        .HasColumnName("carbohydrates_g");
+                    b.Property<float>("Fat")
+                        .HasColumnType("real")
+                        .HasColumnName("total_fat_g");
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text")
+                        .HasColumnName("food_name");
+                    b.Property<float>("Protein")
+                        .HasColumnType("real")
+                        .HasColumnName("protein_g");
+                    b.HasKey("Id");
+                    b.ToTable("food_macronutrients", (string)null);
+                });
+            modelBuilder.Entity("NutriMatch.Models.Recipe", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<float>("Calories")
+                        .HasColumnType("real");
+                    b.Property<float>("Carbs")
+                        .HasColumnType("real");
+                    b.Property<float>("Fat")
+                        .HasColumnType("real");
+                    b.Property<string>("ImageUrl")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<string>("Instructions")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<float>("Protein")
+                        .HasColumnType("real");
+                    b.Property<float>("Rating")
+                        .HasColumnType("real");
+                    b.Property<string>("Title")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.ToTable("Recipes");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RecipeIngredient", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<int>("IngredientId")
+                        .HasColumnType("integer");
+                    b.Property<float>("Quantity")
+                        .HasColumnType("real");
+                    b.Property<int>("RecipeId")
+                        .HasColumnType("integer");
+                    b.Property<string>("Unit")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.HasIndex("IngredientId");
+                    b.HasIndex("RecipeId");
+                    b.ToTable("RecipeIngredients");
+                });
+            modelBuilder.Entity("NutriMatch.Models.Restaurant", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<string>("ImageUrl")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.ToTable("Restaurants");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RestaurantMeal", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<float>("Calories")
+                        .HasColumnType("real");
+                    b.Property<float>("Carbs")
+                        .HasColumnType("real");
+                    b.Property<float>("Fat")
+                        .HasColumnType("real");
+                    b.Property<string>("ItemDescription")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<string>("ItemName")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<float>("Protein")
+                        .HasColumnType("real");
+                    b.Property<string>("Restaurant")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.ToTable("RestaurantMeals");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RecipeIngredient", b =>
+                {
+                    b.HasOne("NutriMatch.Models.Ingredient", "Ingredient")
+                        .WithMany()
+                        .HasForeignKey("IngredientId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                    b.HasOne("NutriMatch.Models.Recipe", null)
+                        .WithMany("RecipeIngredients")
+                        .HasForeignKey("RecipeId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                    b.Navigation("Ingredient");
+                });
+            modelBuilder.Entity("NutriMatch.Models.Recipe", b =>
+                {
+                    b.Navigation("RecipeIngredients");
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}
Index: NutriMatch/Migrations/20250624141408_AddRestaurantModel.cs
===================================================================
--- NutriMatch/Migrations/20250624141408_AddRestaurantModel.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
+++ NutriMatch/Migrations/20250624141408_AddRestaurantModel.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -0,0 +1,30 @@
+﻿using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+#nullable disable
+namespace NutriMatch.Migrations
+{
+    public partial class AddRestaurantModel : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "Restaurants",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "integer", nullable: false)
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+                    Name = table.Column<string>(type: "text", nullable: false),
+                    ImageUrl = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Restaurants", x => x.Id);
+                });
+        }
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "Restaurants");
+        }
+    }
+}
Index: NutriMatch/Migrations/20250624151632_AddRestaurantMealRelationship.Designer.cs
===================================================================
--- NutriMatch/Migrations/20250624151632_AddRestaurantMealRelationship.Designer.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
+++ NutriMatch/Migrations/20250624151632_AddRestaurantMealRelationship.Designer.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -0,0 +1,172 @@
+﻿// <auto-generated />
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using NutriMatch.Data;
+#nullable disable
+namespace NutriMatch.Migrations
+{
+    [DbContext(typeof(AppDbContext))]
+    [Migration("20250624151632_AddRestaurantMealRelationship")]
+    partial class AddRestaurantMealRelationship
+    {
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasAnnotation("ProductVersion", "9.0.5")
+                .HasAnnotation("Relational:MaxIdentifierLength", 63);
+            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+            modelBuilder.Entity("NutriMatch.Models.Ingredient", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer")
+                        .HasColumnName("id");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<float>("Calories")
+                        .HasColumnType("real")
+                        .HasColumnName("energy_kcal");
+                    b.Property<float>("Carbs")
+                        .HasColumnType("real")
+                        .HasColumnName("carbohydrates_g");
+                    b.Property<float>("Fat")
+                        .HasColumnType("real")
+                        .HasColumnName("total_fat_g");
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text")
+                        .HasColumnName("food_name");
+                    b.Property<float>("Protein")
+                        .HasColumnType("real")
+                        .HasColumnName("protein_g");
+                    b.HasKey("Id");
+                    b.ToTable("food_macronutrients", (string)null);
+                });
+            modelBuilder.Entity("NutriMatch.Models.Recipe", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<float>("Calories")
+                        .HasColumnType("real");
+                    b.Property<float>("Carbs")
+                        .HasColumnType("real");
+                    b.Property<float>("Fat")
+                        .HasColumnType("real");
+                    b.Property<string>("ImageUrl")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<string>("Instructions")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<float>("Protein")
+                        .HasColumnType("real");
+                    b.Property<float>("Rating")
+                        .HasColumnType("real");
+                    b.Property<string>("Title")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.ToTable("Recipes");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RecipeIngredient", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<int>("IngredientId")
+                        .HasColumnType("integer");
+                    b.Property<float>("Quantity")
+                        .HasColumnType("real");
+                    b.Property<int>("RecipeId")
+                        .HasColumnType("integer");
+                    b.Property<string>("Unit")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.HasIndex("IngredientId");
+                    b.HasIndex("RecipeId");
+                    b.ToTable("RecipeIngredients");
+                });
+            modelBuilder.Entity("NutriMatch.Models.Restaurant", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<string>("ImageUrl")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.ToTable("Restaurants");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RestaurantMeal", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<float>("Calories")
+                        .HasColumnType("real");
+                    b.Property<float>("Carbs")
+                        .HasColumnType("real");
+                    b.Property<float>("Fat")
+                        .HasColumnType("real");
+                    b.Property<string>("ItemDescription")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<string>("ItemName")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<float>("Protein")
+                        .HasColumnType("real");
+                    b.Property<int?>("RestaurantId")
+                        .HasColumnType("integer");
+                    b.Property<string>("RestaurantName")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.HasIndex("RestaurantId");
+                    b.ToTable("RestaurantMeals");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RecipeIngredient", b =>
+                {
+                    b.HasOne("NutriMatch.Models.Ingredient", "Ingredient")
+                        .WithMany()
+                        .HasForeignKey("IngredientId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                    b.HasOne("NutriMatch.Models.Recipe", null)
+                        .WithMany("RecipeIngredients")
+                        .HasForeignKey("RecipeId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                    b.Navigation("Ingredient");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RestaurantMeal", b =>
+                {
+                    b.HasOne("NutriMatch.Models.Restaurant", "Restaurant")
+                        .WithMany("RestaurantMeals")
+                        .HasForeignKey("RestaurantId");
+                    b.Navigation("Restaurant");
+                });
+            modelBuilder.Entity("NutriMatch.Models.Recipe", b =>
+                {
+                    b.Navigation("RecipeIngredients");
+                });
+            modelBuilder.Entity("NutriMatch.Models.Restaurant", b =>
+                {
+                    b.Navigation("RestaurantMeals");
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}
Index: NutriMatch/Migrations/20250624151632_AddRestaurantMealRelationship.cs
===================================================================
--- NutriMatch/Migrations/20250624151632_AddRestaurantMealRelationship.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
+++ NutriMatch/Migrations/20250624151632_AddRestaurantMealRelationship.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -0,0 +1,38 @@
+﻿using Microsoft.EntityFrameworkCore.Migrations;
+#nullable disable
+namespace NutriMatch.Migrations
+{
+    public partial class AddRestaurantMealRelationship : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<int>(
+                name: "RestaurantId",
+                table: "RestaurantMeals",
+                type: "integer",
+                nullable: true);
+            migrationBuilder.CreateIndex(
+                name: "IX_RestaurantMeals_RestaurantId",
+                table: "RestaurantMeals",
+                column: "RestaurantId");
+            migrationBuilder.AddForeignKey(
+                name: "FK_RestaurantMeals_Restaurants_RestaurantId",
+                table: "RestaurantMeals",
+                column: "RestaurantId",
+                principalTable: "Restaurants",
+                principalColumn: "Id");
+        }
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropForeignKey(
+                name: "FK_RestaurantMeals_Restaurants_RestaurantId",
+                table: "RestaurantMeals");
+            migrationBuilder.DropIndex(
+                name: "IX_RestaurantMeals_RestaurantId",
+                table: "RestaurantMeals");
+            migrationBuilder.DropColumn(
+                name: "RestaurantId",
+                table: "RestaurantMeals");
+        }
+    }
+}
Index: NutriMatch/Migrations/20250624154122_AddRecipeInstructions.Designer.cs
===================================================================
--- NutriMatch/Migrations/20250624154122_AddRecipeInstructions.Designer.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
+++ NutriMatch/Migrations/20250624154122_AddRecipeInstructions.Designer.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -0,0 +1,171 @@
+﻿// <auto-generated />
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using NutriMatch.Data;
+#nullable disable
+namespace NutriMatch.Migrations
+{
+    [DbContext(typeof(AppDbContext))]
+    [Migration("20250624154122_AddRecipeInstructions")]
+    partial class AddRecipeInstructions
+    {
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasAnnotation("ProductVersion", "9.0.5")
+                .HasAnnotation("Relational:MaxIdentifierLength", 63);
+            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+            modelBuilder.Entity("NutriMatch.Models.Ingredient", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer")
+                        .HasColumnName("id");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<float>("Calories")
+                        .HasColumnType("real")
+                        .HasColumnName("energy_kcal");
+                    b.Property<float>("Carbs")
+                        .HasColumnType("real")
+                        .HasColumnName("carbohydrates_g");
+                    b.Property<float>("Fat")
+                        .HasColumnType("real")
+                        .HasColumnName("total_fat_g");
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text")
+                        .HasColumnName("food_name");
+                    b.Property<float>("Protein")
+                        .HasColumnType("real")
+                        .HasColumnName("protein_g");
+                    b.HasKey("Id");
+                    b.ToTable("food_macronutrients", (string)null);
+                });
+            modelBuilder.Entity("NutriMatch.Models.Recipe", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<float>("Calories")
+                        .HasColumnType("real");
+                    b.Property<float>("Carbs")
+                        .HasColumnType("real");
+                    b.Property<float>("Fat")
+                        .HasColumnType("real");
+                    b.Property<string>("ImageUrl")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.PrimitiveCollection<string[]>("Instructions")
+                        .HasColumnType("text[]");
+                    b.Property<float>("Protein")
+                        .HasColumnType("real");
+                    b.Property<float>("Rating")
+                        .HasColumnType("real");
+                    b.Property<string>("Title")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.ToTable("Recipes");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RecipeIngredient", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<int>("IngredientId")
+                        .HasColumnType("integer");
+                    b.Property<float>("Quantity")
+                        .HasColumnType("real");
+                    b.Property<int>("RecipeId")
+                        .HasColumnType("integer");
+                    b.Property<string>("Unit")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.HasIndex("IngredientId");
+                    b.HasIndex("RecipeId");
+                    b.ToTable("RecipeIngredients");
+                });
+            modelBuilder.Entity("NutriMatch.Models.Restaurant", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<string>("ImageUrl")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.ToTable("Restaurants");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RestaurantMeal", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<float>("Calories")
+                        .HasColumnType("real");
+                    b.Property<float>("Carbs")
+                        .HasColumnType("real");
+                    b.Property<float>("Fat")
+                        .HasColumnType("real");
+                    b.Property<string>("ItemDescription")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<string>("ItemName")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<float>("Protein")
+                        .HasColumnType("real");
+                    b.Property<int?>("RestaurantId")
+                        .HasColumnType("integer");
+                    b.Property<string>("RestaurantName")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.HasIndex("RestaurantId");
+                    b.ToTable("RestaurantMeals");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RecipeIngredient", b =>
+                {
+                    b.HasOne("NutriMatch.Models.Ingredient", "Ingredient")
+                        .WithMany()
+                        .HasForeignKey("IngredientId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                    b.HasOne("NutriMatch.Models.Recipe", null)
+                        .WithMany("RecipeIngredients")
+                        .HasForeignKey("RecipeId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                    b.Navigation("Ingredient");
+                });
+            modelBuilder.Entity("NutriMatch.Models.RestaurantMeal", b =>
+                {
+                    b.HasOne("NutriMatch.Models.Restaurant", "Restaurant")
+                        .WithMany("RestaurantMeals")
+                        .HasForeignKey("RestaurantId");
+                    b.Navigation("Restaurant");
+                });
+            modelBuilder.Entity("NutriMatch.Models.Recipe", b =>
+                {
+                    b.Navigation("RecipeIngredients");
+                });
+            modelBuilder.Entity("NutriMatch.Models.Restaurant", b =>
+                {
+                    b.Navigation("RestaurantMeals");
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}
Index: NutriMatch/Migrations/20250624154122_AddRecipeInstructions.cs
===================================================================
--- NutriMatch/Migrations/20250624154122_AddRecipeInstructions.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
+++ NutriMatch/Migrations/20250624154122_AddRecipeInstructions.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -0,0 +1,24 @@
+﻿using Microsoft.EntityFrameworkCore.Migrations;
+#nullable disable
+namespace NutriMatch.Migrations
+{
+    public partial class AddRecipeInstructions : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<string[]>(
+                name: "Instructions",
+                table: "Recipes",
+                type: "text[]",
+                nullable: true
+                );
+        }
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "Instructions",
+                table: "Recipes"
+                );
+        }
+    }
+}
Index: NutriMatch/Migrations/AppDbContextModelSnapshot.cs
===================================================================
--- NutriMatch/Migrations/AppDbContextModelSnapshot.cs	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/Migrations/AppDbContextModelSnapshot.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -59,7 +59,6 @@
                         .IsRequired()
                         .HasColumnType("text");
-                    b.Property<string>("Instructions")
-                        .IsRequired()
-                        .HasColumnType("text");
+                    b.PrimitiveCollection<string[]>("Instructions")
+                        .HasColumnType("text[]");
                     b.Property<float>("Protein")
                         .HasColumnType("real");
@@ -92,4 +91,19 @@
                     b.ToTable("RecipeIngredients");
                 });
+            modelBuilder.Entity("NutriMatch.Models.Restaurant", b =>
+                {
+                    b.Property<int>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("integer");
+                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
+                    b.Property<string>("ImageUrl")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+                    b.HasKey("Id");
+                    b.ToTable("Restaurants");
+                });
             modelBuilder.Entity("NutriMatch.Models.RestaurantMeal", b =>
                 {
@@ -112,8 +126,11 @@
                     b.Property<float>("Protein")
                         .HasColumnType("real");
-                    b.Property<string>("Restaurant")
+                    b.Property<int?>("RestaurantId")
+                        .HasColumnType("integer");
+                    b.Property<string>("RestaurantName")
                         .IsRequired()
                         .HasColumnType("text");
                     b.HasKey("Id");
+                    b.HasIndex("RestaurantId");
                     b.ToTable("RestaurantMeals");
                 });
@@ -132,7 +149,18 @@
                     b.Navigation("Ingredient");
                 });
+            modelBuilder.Entity("NutriMatch.Models.RestaurantMeal", b =>
+                {
+                    b.HasOne("NutriMatch.Models.Restaurant", "Restaurant")
+                        .WithMany("RestaurantMeals")
+                        .HasForeignKey("RestaurantId");
+                    b.Navigation("Restaurant");
+                });
             modelBuilder.Entity("NutriMatch.Models.Recipe", b =>
                 {
                     b.Navigation("RecipeIngredients");
+                });
+            modelBuilder.Entity("NutriMatch.Models.Restaurant", b =>
+                {
+                    b.Navigation("RestaurantMeals");
                 });
 #pragma warning restore 612, 618
Index: NutriMatch/Models/Recipe.cs
===================================================================
--- NutriMatch/Models/Recipe.cs	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/Models/Recipe.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -13,5 +13,5 @@
         public int Id { get; set; }
         public String Title { get; set; }
-        public String Instructions { get; set; }
+        public String[]? Instructions { get; set; }
         [ValidateNever]
         public float Rating { get; set; }
@@ -27,4 +27,5 @@
         public float Fat { get; set; }
         [ValidateNever]
+
         public String ImageUrl { get; set; } 
         
Index: NutriMatch/Models/Restaurant.cs
===================================================================
--- NutriMatch/Models/Restaurant.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
+++ NutriMatch/Models/Restaurant.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -0,0 +1,16 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace NutriMatch.Models
+{
+    public class Restaurant
+    {
+        [Key]
+        public int Id { get; set; }
+
+        public String Name { get; set; }
+
+        public String ImageUrl { get; set; }
+
+        virtual public List<RestaurantMeal> RestaurantMeals { get; set; }
+    }
+}
Index: NutriMatch/Models/RestaurantMeal.cs
===================================================================
--- NutriMatch/Models/RestaurantMeal.cs	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/Models/RestaurantMeal.cs	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -12,5 +12,7 @@
         public int Id { get; set; }
 
-        public String Restaurant { get; set; }
+        virtual public int? RestaurantId { get; set; }
+        virtual public Restaurant Restaurant { get; set; } = null!;
+        public String RestaurantName { get; set; }
 
         public String ItemName { get; set; }
Index: NutriMatch/Views/Recipes/Create.cshtml
===================================================================
--- NutriMatch/Views/Recipes/Create.cshtml	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/Views/Recipes/Create.cshtml	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -7,59 +7,575 @@
 <head>
     <meta name="viewport" content="width=device-width" />
-    <link href="~/css/recipe-search.css" rel="stylesheet" />
-    <title>Create</title>
+    <title>Create Recipe - NutriMatch</title>
+    <style>
+        * {
+            margin: 0;
+            padding: 0;
+            box-sizing: border-box;
+        }
+        body {
+            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
+            background: #fafbfc;
+            color: #1a1a1a;
+            line-height: 1.6;
+        }
+        .main-container {
+            max-width: 1200px;
+            margin: 0 auto;
+            padding: 2rem;
+        }
+        .page-header {
+            margin-bottom: 2.5rem;
+        }
+        .page-title {
+            font-size: 2.5rem;
+            font-weight: 700;
+            color: #1a1a1a;
+            margin-bottom: 0.5rem;
+            letter-spacing: -0.02em;
+        }
+        .page-subtitle {
+            font-size: 1.125rem;
+            color: #6b7280;
+            font-weight: 400;
+        }
+        .form-card {
+            background: white;
+            border-radius: 16px;
+            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+            border: 1px solid #e5e7eb;
+            overflow: hidden;
+        }
+        .form-content {
+            padding: 2.5rem;
+        }
+        .form-group {
+            margin-bottom: 2rem;
+        }
+        .form-group:last-child {
+            margin-bottom: 0;
+        }
+        .label {
+            display: block;
+            font-size: 0.875rem;
+            font-weight: 600;
+            color: #374151;
+            margin-bottom: 0.5rem;
+            text-transform: uppercase;
+            letter-spacing: 0.05em;
+        }
+        .input {
+            width: 100%;
+            padding: 0.875rem 1rem;
+            border: 1px solid #d1d5db;
+            border-radius: 8px;
+            font-size: 1rem;
+            background: white;
+            transition: all 0.2s ease;
+            font-family: inherit;
+        }
+        .input:focus {
+            outline: none;
+            border-color: #10b981;
+            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
+        }
+        .input::placeholder {
+            color: #9ca3af;
+        }
+        .textarea {
+            min-height: 120px;
+            resize: vertical;
+            font-family: inherit;
+        }
+        .flex-row {
+            display: flex;
+            gap: 1rem;
+            align-items: flex-end;
+        }
+        .flex-1 { flex: 1; }
+        .flex-2 { flex: 2; }
+        .btn {
+            display: inline-flex;
+            align-items: center;
+            justify-content: center;
+            padding: 0.875rem 1.5rem;
+            border-radius: 8px;
+            font-size: 0.875rem;
+            font-weight: 600;
+            text-decoration: none;
+            border: none;
+            cursor: pointer;
+            transition: all 0.2s ease;
+            font-family: inherit;
+            white-space: nowrap;
+        }
+        .btn-primary {
+            background: #10b981;
+            color: white;
+        }
+        .btn-primary:hover {
+            background: #059669;
+            transform: translateY(-1px);
+        }
+        .btn-secondary {
+            background: #f3f4f6;
+            color: #6b7280;
+            border: 1px solid #d1d5db;
+        }
+        .btn-secondary:hover {
+            background: #e5e7eb;
+            color: #374151;
+        }
+        .btn-large {
+            padding: 1rem 2rem;
+            font-size: 1rem;
+        }
+        .items-container {
+            margin-top: 1rem;
+            border: 1px solid #e5e7eb;
+            border-radius: 8px;
+            background: #f9fafb;
+            min-height: 120px;
+        }
+        .items-empty {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            height: 120px;
+            color: #9ca3af;
+            font-size: 0.875rem;
+        }
+        .item {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            padding: 0.875rem 1rem;
+            background: white;
+            border-bottom: 1px solid #e5e7eb;
+            transition: background-color 0.2s ease;
+        }
+        .item:last-child {
+            border-bottom: none;
+        }
+        .item:hover {
+            background: #f9fafb;
+        }
+        .item-content {
+            flex: 1;
+            font-size: 0.875rem;
+            color: #374151;
+        }
+        .item-remove {
+            width: 32px;
+            height: 32px;
+            border-radius: 50%;
+            background: #fef2f2;
+            border: 1px solid #fecaca;
+            color: #dc2626;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            cursor: pointer;
+            transition: all 0.2s ease;
+            font-size: 0.75rem;
+        }
+        .item-remove:hover {
+            background: #fee2e2;
+            transform: scale(1.05);
+        }
+        .search-container {
+            position: relative;
+        }
+        .dropdown {
+            position: absolute;
+            top: 100%;
+            left: 0;
+            right: 0;
+            background: white;
+            border: 1px solid #d1d5db;
+            border-top: none;
+            border-radius: 0 0 8px 8px;
+            max-height: 200px;
+            overflow-y: auto;
+            z-index: 100;
+            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+            display: none;
+        }
+        .dropdown.show {
+            display: block;
+        }
+        .dropdown-item {
+            padding: 0.75rem 1rem;
+            cursor: pointer;
+            border-bottom: 1px solid #f3f4f6;
+            font-size: 0.875rem;
+            color: #374151;
+            transition: background-color 0.2s ease;
+        }
+        .dropdown-item:hover {
+            background: #f9fafb;
+        }
+        .dropdown-item:last-child {
+            border-bottom: none;
+        }
+        .file-upload-area {
+            border: 2px dashed #d1d5db;
+            border-radius: 8px;
+            padding: 2rem;
+            text-align: center;
+            cursor: pointer;
+            transition: all 0.2s ease;
+            background: #fafbfc;
+            position: relative;
+        }
+        .file-upload-area:hover {
+            border-color: #10b981;
+            background: #f0fdf4;
+        }
+        .file-upload-area.dragover {
+            border-color: #10b981;
+            background: #f0fdf4;
+        }
+        .file-upload-icon {
+            width: 48px;
+            height: 48px;
+            margin: 0 auto 1rem;
+            background: #f3f4f6;
+            border-radius: 50%;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            font-size: 1.5rem;
+            color: #6b7280;
+        }
+        .file-upload-text {
+            font-size: 0.875rem;
+            color: #6b7280;
+            margin-bottom: 0.5rem;
+        }
+        .file-upload-hint {
+            font-size: 0.75rem;
+            color: #9ca3af;
+        }
+        .file-input {
+            position: absolute;
+            inset: 0;
+            opacity: 0;
+            cursor: pointer;
+        }
+        .form-actions {
+            margin-top: 2.5rem;
+            padding-top: 2rem;
+            border-top: 1px solid #e5e7eb;
+            display: flex;
+            gap: 1rem;
+            justify-content: flex-end;
+        }
+        .back-link {
+            display: inline-flex;
+            align-items: center;
+            gap: 0.5rem;
+            color: #6b7280;
+            text-decoration: none;
+            font-size: 0.875rem;
+            font-weight: 500;
+            transition: color 0.2s ease;
+            margin-top: 1rem;
+        }
+        .back-link:hover {
+            color: #10b981;
+        }
+        .validation-error {
+            color: #dc2626;
+            font-size: 0.75rem;
+            margin-top: 0.25rem;
+        }
+        @@media (max-width: 768px) {
+            .main-container {
+                padding: 1rem;
+            }
+            .form-content {
+                padding: 1.5rem;
+            }
+            .page-title {
+                font-size: 2rem;
+            }
+            .flex-row {
+                flex-direction: column;
+                align-items: stretch;
+            }
+            .form-actions {
+                flex-direction: column-reverse;
+            }
+            .btn {
+                width: 100%;
+                justify-content: center;
+            }
+        }
+        .item {
+            animation: slideIn 0.3s ease;
+        }
+        @@keyframes slideIn {
+            from {
+                opacity: 0;
+                transform: translateY(-10px);
+            }
+            to {
+                opacity: 1;
+                transform: translateY(0);
+            }
+        }
+        .dropdown::-webkit-scrollbar {
+            width: 4px;
+        }
+        .dropdown::-webkit-scrollbar-track {
+            background: #f1f1f1;
+        }
+        .dropdown::-webkit-scrollbar-thumb {
+            background: #c1c1c1;
+            border-radius: 2px;
+        }
+        .btn:focus,
+        .input:focus {
+            outline: 2px solid #10b981;
+            outline-offset: 2px;
+        }
+    </style>
 </head>
 <body>
-<h4>Recipe</h4>
-<hr />
-<div class="row">
-    <div class="col-md-4">
-        <form asp-action="Create" enctype="multipart/form-data">
-            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
-            <div class="form-group">
-                <label asp-for="Title" class="control-label"></label>
-                <input asp-for="Title" class="form-control" />
-                <span asp-validation-for="Title" class="text-danger"></span>
+    <div class="main-container">
+        <div class="page-header">
+            <h1 class="page-title">Create Recipe</h1>
+            <p class="page-subtitle">Share your culinary creation with the community</p>
+        </div>
+        <div class="form-card">
+            <div class="form-content">
+                <form asp-action="Create" enctype="multipart/form-data">
+                    <div class="form-group">
+                        <label for="Title" class="label">Recipe Title</label>
+                        <input type="text" 
+                               name="Title" 
+                               id="Title" 
+                               class="input" 
+                               placeholder="Enter your recipe name..."
+                               required />
+                        <div class="validation-error" id="titleValidation"></div>
+                    </div>
+                    <div class="form-group">
+                        <label class="label">Instructions</label>
+                        <div class="flex-row">
+                            <textarea class="input textarea flex-1" 
+                                      placeholder="Add a cooking step..." 
+                                      id="instructionInput"></textarea>
+                            <button type="button" class="btn btn-primary" id="addInstructionButton">
+                                Add Step
+                            </button>
+                        </div>
+                        <div class="items-container" id="instructionsList">
+                            <div class="items-empty">No instructions added yet</div>
+                        </div>
+                        <input type="hidden" id="selectedInstructions" name="Instructions" />
+                    </div>
+                    <div class="form-group">
+                        <label class="label">Ingredients</label>
+                        <div class="search-container">
+                            <div class="flex-row">
+                                <input type="text" 
+                                       class="input flex-2" 
+                                       placeholder="Search ingredients..." 
+                                       id="ingredientSearch">
+                                <select class="input flex-1" id="ingredientUnit">
+                                    <option value="">Unit</option>
+                                    <option value="g">Grams</option>
+                                    <option value="ml">Milliliters</option>
+                                    <option value="oz">Ounce</option>
+                                    <option value="tbsp">Tablespoon</option>
+                                    <option value="tsp">Teaspoon</option>
+                                    <option value="cup">Cup</option>
+                                </select>
+                                <input type="number" 
+                                       class="input flex-1" 
+                                       placeholder="Amount" 
+                                       id="ingredientQuantity" 
+                                       step="0.01" 
+                                       min="0">
+                                <button type="button" class="btn btn-primary" id="addIngredientButton">
+                                    Add
+                                </button>
+                            </div>
+                            <div class="dropdown" id="ingredientDropdown"></div>
+                        </div>
+                        <div class="items-container" id="ingredientsList">
+                            <div class="items-empty">No ingredients added yet</div>
+                        </div>
+                        <input type="hidden" id="selectedIngredients" name="Ingredients" />
+                    </div>
+                    <div class="form-group">
+                    <label class="form-label">Recipe Photo</label>
+                        <div class="file-upload-area" id="fileUploadArea">
+                            <div class="file-upload-icon">📷</div>
+                            <p><strong>Click to upload</strong> or drag and drop</p>
+                            <p>PNG, JPG, GIF up to 10MB</p>
+                            <input  type="file" id="RecipeImage" name="RecipeImage" accept="image/*" style="display: none;">
+                        </div>
+                        <div id="imagePreview" style="margin-top: 1rem; text-align: center;"></div>
+                    </div>
+                    <div class="form-actions">
+                        <button type="button" class="btn btn-secondary">
+                            Save as Draft
+                        </button>
+                        <button type="submit" class="btn btn-primary btn-large">
+                            Create Recipe
+                        </button>
+                    </div>
+                </form>
             </div>
-            <div class="form-group">
-                <label asp-for="Instructions" class="control-label"></label>
-                <input asp-for="Instructions" class="form-control" />
-                <span asp-validation-for="Instructions" class="text-danger"></span>
-            </div>
-            <div class="form-group">
-                <label class="form-label">Search Ingredients</label>
-                <div class="search-container">
-                    <div style="display: flex; gap: 10px; align-items: center;">
-                        <input type="text" class="search-input form-control" placeholder="Type to search ingredients..." id="ingredientSearch" style="flex: 2;">
-                        <select class="form-control" id="ingredientUnit" style="flex: 1;">
-                            <option value="">Select Unit</option>
-                            <option value="g">Grams (g)</option>
-                            <option value="ml">Milliliters (ml)</option>
-                            <option value="oz">Ounce</option>
-                            <option value="tbsp">Tablespoon</option>
-                        </select>
-                        <input type="number" class="form-control" placeholder="Quantity" id="ingredientQuantity" style="flex: 1;" step="0.01" min="0">
-                        <button type="button" class="btn btn-primary" id="addIngredientButton">Add</button>
-                    </div>
-                    <div class="dropdown" id="ingredientDropdown"></div>
+        </div>
+        <a href="/Recipes" class="back-link">
+            ← Back to Recipes
+        </a>
+    </div>
+    <script>
+document.addEventListener('DOMContentLoaded', function() {
+    const aiPictureButton = document.querySelector('.btn-secondary');
+    const titleInput = document.getElementById('Title');
+    const imagePreview = document.getElementById('imagePreview');
+    const fileInput = document.getElementById('RecipeImage');
+    aiPictureButton.textContent = 'Generate AI Picture';
+    aiPictureButton.innerHTML = '🎨 Generate AI Picture';
+    aiPictureButton.addEventListener('click', async function() {
+        const recipeTitle = titleInput.value.trim();
+        if (!recipeTitle) {
+            alert('Please enter a recipe title first!');
+            titleInput.focus();
+            return;
+        }
+        const originalText = aiPictureButton.innerHTML;
+        aiPictureButton.innerHTML = '⏳ Generating...';
+        aiPictureButton.disabled = true;
+        try {
+            await generateAIPicture(recipeTitle);
+        } catch (error) {
+            console.error('Error generating AI picture:', error);
+            alert('Failed to generate AI picture. Please try again.');
+        } finally {
+            aiPictureButton.innerHTML = originalText;
+            aiPictureButton.disabled = false;
+        }
+    });
+    async function generateAIPicture(recipeTitle) {
+        try {
+            const prompt = `A delicious ${recipeTitle} food photography, professional lighting, appetizing, high quality, detailed`;
+            const pollinationsUrl = `https://image.pollinations.ai/prompt/${encodeURIComponent(prompt)}?width=800&height=600&seed=${Math.floor(Math.random() * 1000000)}`;
+            imagePreview.innerHTML = `
+                <div style="text-align: center; padding: 2rem;">
+                    <div style="width: 50px; height: 50px; border: 4px solid #f3f3f3; border-top: 4px solid #10b981; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem;"></div>
+                    <p style="color: #6b7280;">Generating AI picture...</p>
                 </div>
-                <div class="form-group">
-                    <input type="file"  id="recipeImage" name="RecipeImage" />
+            `;
+            const img = new Image();
+            img.crossOrigin = 'anonymous';
+            img.onload = function() {
+                imagePreview.innerHTML = `
+                    <img src="${pollinationsUrl}" alt="AI generated ${recipeTitle}" style="max-width: 300px; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
+                    <p style="margin-top: 0.5rem; color: #10b981; font-weight: 500;">✓ AI picture generated successfully</p>
+                    <button type="button" onclick="useAIImage('${pollinationsUrl}')" style="margin-top: 0.5rem; padding: 0.5rem 1rem; background: #10b981; color: white; border: none; border-radius: 5px; cursor: pointer;">Use This Image</button>
+                `;
+            };
+            img.onerror = function() {
+                tryAlternativeImageGeneration(recipeTitle);
+            };
+            img.src = pollinationsUrl;
+        } catch (error) {
+            console.error('Error in generateAIPicture:', error);
+            tryAlternativeImageGeneration(recipeTitle);
+        }
+    }
+    async function tryAlternativeImageGeneration(recipeTitle) {
+        try {
+            const foodKeywords = ['food', 'meal', 'dish', 'cooking', 'kitchen', 'restaurant'];
+            const randomKeyword = foodKeywords[Math.floor(Math.random() * foodKeywords.length)];
+            const picsumUrl = `https://picsum.photos/800/600?random=${Date.now()}`;
+            imagePreview.innerHTML = `
+                <img src="${picsumUrl}" alt="Generated image for ${recipeTitle}" style="max-width: 300px; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
+                <p style="margin-top: 0.5rem; color: #10b981; font-weight: 500;">✓ Image generated successfully</p>
+                <button type="button" onclick="useAIImage('${picsumUrl}')" style="margin-top: 0.5rem; padding: 0.5rem 1rem; background: #10b981; color: white; border: none; border-radius: 5px; cursor: pointer;">Use This Image</button>
+            `;
+        } catch (error) {
+            imagePreview.innerHTML = `
+                <div style="text-align: center; padding: 2rem; color: #dc2626;">
+                    <p>❌ Failed to generate image</p>
+                    <p style="font-size: 0.875rem; margin-top: 0.5rem;">Please try uploading an image manually</p>
                 </div>
-                <div class="ingredients-list" id="ingredientsList">
-                    <small class="text-muted">Selected ingredients will appear here</small>
-                </div>
-                <input type="hidden" id="selectedIngredients" name="Ingredients" />
-            </div>
-            <div class="form-group">
-                <input type="submit" value="Create" class="btn btn-primary" />
-            </div>
-         </form>
-    </div>
-</div>
-<div>
-    <a asp-action="Index">Back to List</a>
-</div>
-<script src="~/js/recipe-search.js"></script>
+            `;
+        }
+    }
+    window.useAIImage = async function(imageUrl) {
+        try {
+            const response = await fetch(imageUrl);
+            const blob = await response.blob();
+            const file = new File([blob], `ai-generated-${Date.now()}.jpg`, { type: 'image/jpeg' });
+            const dt = new DataTransfer();
+            dt.items.add(file);
+            fileInput.files = dt.files;
+            imagePreview.innerHTML = `
+                <img src="${imageUrl}" alt="Selected AI generated image" style="max-width: 300px; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
+                <p style="margin-top: 0.5rem; color: #10b981; font-weight: 500;">✓ AI image selected for upload</p>
+            `;
+            console.log('AI image set successfully');
+        } catch (error) {
+            console.error('Error setting AI image:', error);
+            alert('Error setting the AI image. Please try again.');
+        }
+    };
+});
+const style = document.createElement('style');
+style.textContent = `
+    @@keyframes spin {
+        0% { transform: rotate(0deg); }
+        100% { transform: rotate(360deg); }
+    }
+`;
+document.head.appendChild(style);
+    </script>
+    <script>
+        const fileUploadArea = document.getElementById('fileUploadArea');
+        const fileInput = document.getElementById('RecipeImage');
+        const imagePreview = document.getElementById('imagePreview');
+        fileUploadArea.addEventListener('click', () => fileInput.click());
+        fileUploadArea.addEventListener('dragover', (e) => {
+            e.preventDefault();
+            fileUploadArea.classList.add('dragover');
+        });
+        fileUploadArea.addEventListener('dragleave', () => {
+            fileUploadArea.classList.remove('dragover');
+        });
+        fileUploadArea.addEventListener('drop', (e) => {
+            e.preventDefault();
+            fileUploadArea.classList.remove('dragover');
+            const files = e.dataTransfer.files;
+            if (files.length > 0) {
+                handleFileSelect(files[0]);
+            }
+        });
+        fileInput.addEventListener('change', (e) => {
+            if (e.target.files && e.target.files[0]) {
+                handleFileSelect(e.target.files[0]);
+            }
+        });
+        function handleFileSelect(file) {
+            if (file.type.startsWith('image/')) {
+                const reader = new FileReader();
+                reader.onload = (e) => {
+                    imagePreview.innerHTML = `
+                        <img src="${e.target.result}" alt="Recipe preview" style="max-width: 300px; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
+                        <p style="margin-top: 0.5rem; color: #4CAF50; font-weight: 500;">✓ Image uploaded successfully</p>
+                    `;
+                };
+                reader.readAsDataURL(file);
+            }
+        }
+    </script>
 </body>
 </html>
+<script src="~/js/recipe-search.js"></script>
Index: NutriMatch/Views/Recipes/Edit.cshtml
===================================================================
--- NutriMatch/Views/Recipes/Edit.cshtml	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/Views/Recipes/Edit.cshtml	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -1,50 +1,594 @@
+@using System.Text.Json
 @model NutriMatch.Models.Recipe
-
 @{
     Layout = null;
 }
-
 <!DOCTYPE html>
-
 <html>
 <head>
     <meta name="viewport" content="width=device-width" />
-    <title>Edit</title>
+    <title>Edit Recipe - NutriMatch</title>
+    <style>
+        * {
+            margin: 0;
+            padding: 0;
+            box-sizing: border-box;
+        }
+        body {
+            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
+            background: #fafbfc;
+            color: #1a1a1a;
+            line-height: 1.6;
+        }
+        .main-container {
+            max-width: 1200px;
+            margin: 0 auto;
+            padding: 2rem;
+        }
+        .page-header {
+            margin-bottom: 2.5rem;
+        }
+        .page-title {
+            font-size: 2.5rem;
+            font-weight: 700;
+            color: #1a1a1a;
+            margin-bottom: 0.5rem;
+            letter-spacing: -0.02em;
+        }
+        .page-subtitle {
+            font-size: 1.125rem;
+            color: #6b7280;
+            font-weight: 400;
+        }
+        .form-card {
+            background: white;
+            border-radius: 16px;
+            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+            border: 1px solid #e5e7eb;
+            overflow: hidden;
+        }
+        .form-content {
+            padding: 2.5rem;
+        }
+        .form-group {
+            margin-bottom: 2rem;
+        }
+        .form-group:last-child {
+            margin-bottom: 0;
+        }
+        .label {
+            display: block;
+            font-size: 0.875rem;
+            font-weight: 600;
+            color: #374151;
+            margin-bottom: 0.5rem;
+            text-transform: uppercase;
+            letter-spacing: 0.05em;
+        }
+        .input {
+            width: 100%;
+            padding: 0.875rem 1rem;
+            border: 1px solid #d1d5db;
+            border-radius: 8px;
+            font-size: 1rem;
+            background: white;
+            transition: all 0.2s ease;
+            font-family: inherit;
+        }
+        .input:focus {
+            outline: none;
+            border-color: #10b981;
+            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
+        }
+        .input::placeholder {
+            color: #9ca3af;
+        }
+        .textarea {
+            min-height: 120px;
+            resize: vertical;
+            font-family: inherit;
+        }
+        .flex-row {
+            display: flex;
+            gap: 1rem;
+            align-items: flex-end;
+        }
+        .flex-1 { flex: 1; }
+        .flex-2 { flex: 2; }
+        .btn {
+            display: inline-flex;
+            align-items: center;
+            justify-content: center;
+            padding: 0.875rem 1.5rem;
+            border-radius: 8px;
+            font-size: 0.875rem;
+            font-weight: 600;
+            text-decoration: none;
+            border: none;
+            cursor: pointer;
+            transition: all 0.2s ease;
+            font-family: inherit;
+            white-space: nowrap;
+        }
+        .btn-primary {
+            background: #10b981;
+            color: white;
+        }
+        .btn-primary:hover {
+            background: #059669;
+            transform: translateY(-1px);
+        }
+        .btn-secondary {
+            background: #f3f4f6;
+            color: #6b7280;
+            border: 1px solid #d1d5db;
+        }
+        .btn-secondary:hover {
+            background: #e5e7eb;
+            color: #374151;
+        }
+        .btn-large {
+            padding: 1rem 2rem;
+            font-size: 1rem;
+        }
+        .items-container {
+            margin-top: 1rem;
+            border: 1px solid #e5e7eb;
+            border-radius: 8px;
+            background: #f9fafb;
+            min-height: 120px;
+        }
+        .items-empty {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            height: 120px;
+            color: #9ca3af;
+            font-size: 0.875rem;
+        }
+        .item {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            padding: 0.875rem 1rem;
+            background: white;
+            border-bottom: 1px solid #e5e7eb;
+            transition: background-color 0.2s ease;
+        }
+        .item:last-child {
+            border-bottom: none;
+        }
+        .item:hover {
+            background: #f9fafb;
+        }
+        .item-content {
+            flex: 1;
+            font-size: 0.875rem;
+            color: #374151;
+        }
+        .item-remove {
+            width: 32px;
+            height: 32px;
+            border-radius: 50%;
+            background: #fef2f2;
+            border: 1px solid #fecaca;
+            color: #dc2626;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            cursor: pointer;
+            transition: all 0.2s ease;
+            font-size: 0.75rem;
+        }
+        .item-remove:hover {
+            background: #fee2e2;
+            transform: scale(1.05);
+        }
+        .search-container {
+            position: relative;
+        }
+        .dropdown {
+            position: absolute;
+            top: 100%;
+            left: 0;
+            right: 0;
+            background: white;
+            border: 1px solid #d1d5db;
+            border-top: none;
+            border-radius: 0 0 8px 8px;
+            max-height: 200px;
+            overflow-y: auto;
+            z-index: 100;
+            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+            display: none;
+        }
+        .dropdown.show {
+            display: block;
+        }
+        .dropdown-item {
+            padding: 0.75rem 1rem;
+            cursor: pointer;
+            border-bottom: 1px solid #f3f4f6;
+            font-size: 0.875rem;
+            color: #374151;
+            transition: background-color 0.2s ease;
+        }
+        .dropdown-item:hover {
+            background: #f9fafb;
+        }
+        .dropdown-item:last-child {
+            border-bottom: none;
+        }
+        .file-upload-area {
+            border: 2px dashed #d1d5db;
+            border-radius: 8px;
+            padding: 2rem;
+            text-align: center;
+            cursor: pointer;
+            transition: all 0.2s ease;
+            background: #fafbfc;
+            position: relative;
+        }
+        .file-upload-area:hover {
+            border-color: #10b981;
+            background: #f0fdf4;
+        }
+        .file-upload-area.dragover {
+            border-color: #10b981;
+            background: #f0fdf4;
+        }
+        .file-upload-icon {
+            width: 48px;
+            height: 48px;
+            margin: 0 auto 1rem;
+            background: #f3f4f6;
+            border-radius: 50%;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            font-size: 1.5rem;
+            color: #6b7280;
+        }
+        .file-upload-text {
+            font-size: 0.875rem;
+            color: #6b7280;
+            margin-bottom: 0.5rem;
+        }
+        .file-upload-hint {
+            font-size: 0.75rem;
+            color: #9ca3af;
+        }
+        .file-input {
+            position: absolute;
+            inset: 0;
+            opacity: 0;
+            cursor: pointer;
+        }
+        .form-actions {
+            margin-top: 2.5rem;
+            padding-top: 2rem;
+            border-top: 1px solid #e5e7eb;
+            display: flex;
+            gap: 1rem;
+            justify-content: flex-end;
+        }
+        .back-link {
+            display: inline-flex;
+            align-items: center;
+            gap: 0.5rem;
+            color: #6b7280;
+            text-decoration: none;
+            font-size: 0.875rem;
+            font-weight: 500;
+            transition: color 0.2s ease;
+            margin-top: 1rem;
+        }
+        .back-link:hover {
+            color: #10b981;
+        }
+        .validation-error {
+            color: #dc2626;
+            font-size: 0.75rem;
+            margin-top: 0.25rem;
+        }
+        @@media (max-width: 768px) {
+            .main-container {
+                padding: 1rem;
+            }
+            .form-content {
+                padding: 1.5rem;
+            }
+            .page-title {
+                font-size: 2rem;
+            }
+            .flex-row {
+                flex-direction: column;
+                align-items: stretch;
+            }
+            .form-actions {
+                flex-direction: column-reverse;
+            }
+            .btn {
+                width: 100%;
+                justify-content: center;
+            }
+        }
+        .item {
+            animation: slideIn 0.3s ease;
+        }
+        @@keyframes slideIn {
+            from {
+                opacity: 0;
+                transform: translateY(-10px);
+            }
+            to {
+                opacity: 1;
+                transform: translateY(0);
+            }
+        }
+        .dropdown::-webkit-scrollbar {
+            width: 4px;
+        }
+        .dropdown::-webkit-scrollbar-track {
+            background: #f1f1f1;
+        }
+        .dropdown::-webkit-scrollbar-thumb {
+            background: #c1c1c1;
+            border-radius: 2px;
+        }
+        .btn:focus,
+        .input:focus {
+            outline: 2px solid #10b981;
+            outline-offset: 2px;
+        }
+    </style>
 </head>
 <body>
-
-<h4>Recipe</h4>
-<hr />
-<div class="row">
-    <div class="col-md-4">
-        <form asp-action="Edit">
-            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
-            <input type="hidden" asp-for="Id" />
-            <div class="form-group">
-                <label asp-for="Title" class="control-label"></label>
-                <input asp-for="Title" class="form-control" />
-                <span asp-validation-for="Title" class="text-danger"></span>
+    <div class="main-container">
+        <div class="page-header">
+            <h1 class="page-title">Create Recipe</h1>
+            <p class="page-subtitle">Share your culinary creation with the community</p>
+        </div>
+        <div class="form-card">
+            <div class="form-content">
+                <form asp-action="Edit" enctype="multipart/form-data">
+                    <div class="form-group">
+                        <label for="Title" class="label">Recipe Title</label>
+                        <input type="text" 
+                               name="Title" 
+                               id="Title" 
+                               class="input" 
+                               placeholder="Enter your recipe name..."
+                               value="@Model.Title"
+                               required />
+                        <div class="validation-error" id="titleValidation"></div>
+                    </div>
+                    <div class="form-group">
+                        <label class="label">Instructions</label>
+                        <div class="flex-row">
+                            <textarea class="input textarea flex-1" 
+                                      placeholder="Add a cooking step..." 
+                                      id="instructionInput"></textarea>
+                            <button type="button" class="btn btn-primary" id="addInstructionButton">
+                                Add Step
+                            </button>
+                        </div>
+                        <div class="items-container" id="instructionsList">
+                            <div class="items-empty">
+                            </div>
+                        </div>
+                        <input type="hidden" id="selectedInstructions"  name="Instructions" />
+                    </div>
+                    <div class="form-group">
+                        <label class="label">Ingredients</label>
+                        <div class="search-container">
+                            <div class="flex-row">
+                                <input type="text" 
+                                       class="input flex-2" 
+                                       placeholder="Search ingredients..." 
+                                       id="ingredientSearch">
+                                <select class="input flex-1" id="ingredientUnit">
+                                    <option value="">Unit</option>
+                                    <option value="g">Grams</option>
+                                    <option value="ml">Milliliters</option>
+                                    <option value="oz">Ounce</option>
+                                    <option value="tbsp">Tablespoon</option>
+                                    <option value="tsp">Teaspoon</option>
+                                    <option value="cup">Cup</option>
+                                </select>
+                                <input type="number" 
+                                       class="input flex-1" 
+                                       placeholder="Amount" 
+                                       id="ingredientQuantity" 
+                                       step="0.01" 
+                                       min="0">
+                                <button type="button" class="btn btn-primary" id="addIngredientButton">
+                                    Add
+                                </button>
+                            </div>
+                            <div class="dropdown" id="ingredientDropdown"></div>
+                        </div>
+                        <div class="items-container" id="ingredientsList">
+                            <div class="items-empty">No ingredients added yet</div>
+                        </div>
+                        <input type="hidden" id="selectedIngredients" name="Ingredients" />
+                    </div>
+                    <div class="form-group">
+                    <label class="form-label">Recipe Photo</label>
+                        <div class="file-upload-area" id="fileUploadArea">
+                            <div class="file-upload-icon">📷</div>
+                            <p><strong>Click to upload</strong> or drag and drop</p>
+                            <p>PNG, JPG, GIF up to 10MB</p>
+                            <input  type="file" id="RecipeImage" name="RecipeImage" accept="image/*" style="display: none;">
+                        </div>
+                        <div id="imagePreview" style="margin-top: 1rem; text-align: center;">
+                        <img src="@Model.ImageUrl" alt="Recipe preview" style="max-width: 300px; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
+                        </div>
+                    </div>
+                    <div class="form-actions">
+                        <button type="button" class="btn btn-secondary">
+                            Save as Draft
+                        </button>
+                        <button type="submit" class="btn btn-primary btn-large">
+                            Create Recipe
+                        </button>
+                    </div>
+                </form>
             </div>
-            <div class="form-group">
-                <label asp-for="Instructions" class="control-label"></label>
-                <input asp-for="Instructions" class="form-control" />
-                <span asp-validation-for="Instructions" class="text-danger"></span>
-            </div>
-            <div class="form-group">
-                <label asp-for="Rating" class="control-label"></label>
-                <input asp-for="Rating" class="form-control" />
-                <span asp-validation-for="Rating" class="text-danger"></span>
-            </div>
-            <div class="form-group">
-                <input type="submit" value="Save" class="btn btn-primary" />
-            </div>
-        </form>
+        </div>
+        <a href="/Recipes" class="back-link">
+            ← Back to Recipes
+        </a>
     </div>
-</div>
-
-<div>
-    <a asp-action="Index">Back to List</a>
-</div>
-
+    <script>
+document.addEventListener('DOMContentLoaded', function() {
+    const aiPictureButton = document.querySelector('.btn-secondary');
+    const titleInput = document.getElementById('Title');
+    const imagePreview = document.getElementById('imagePreview');
+    const fileInput = document.getElementById('RecipeImage');
+    aiPictureButton.textContent = 'Generate AI Picture';
+    aiPictureButton.innerHTML = '🎨 Generate AI Picture';
+    aiPictureButton.addEventListener('click', async function() {
+        const recipeTitle = titleInput.value.trim();
+        if (!recipeTitle) {
+            alert('Please enter a recipe title first!');
+            titleInput.focus();
+            return;
+        }
+        const originalText = aiPictureButton.innerHTML;
+        aiPictureButton.innerHTML = '⏳ Generating...';
+        aiPictureButton.disabled = true;
+        try {
+            await generateAIPicture(recipeTitle);
+        } catch (error) {
+            console.error('Error generating AI picture:', error);
+            alert('Failed to generate AI picture. Please try again.');
+        } finally {
+            aiPictureButton.innerHTML = originalText;
+            aiPictureButton.disabled = false;
+        }
+    });
+    async function generateAIPicture(recipeTitle) {
+        try {
+            const prompt = `A delicious ${recipeTitle} food photography, professional lighting, appetizing, high quality, detailed`;
+            const pollinationsUrl = `https://image.pollinations.ai/prompt/${encodeURIComponent(prompt)}?width=800&height=600&seed=${Math.floor(Math.random() * 1000000)}`;
+            imagePreview.innerHTML = `
+                <div style="text-align: center; padding: 2rem;">
+                    <div style="width: 50px; height: 50px; border: 4px solid #f3f3f3; border-top: 4px solid #10b981; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem;"></div>
+                    <p style="color: #6b7280;">Generating AI picture...</p>
+                </div>
+            `;
+            const img = new Image();
+            img.crossOrigin = 'anonymous';
+            img.onload = function() {
+                imagePreview.innerHTML = `
+                    <img src="${pollinationsUrl}" alt="AI generated ${recipeTitle}" style="max-width: 300px; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
+                    <p style="margin-top: 0.5rem; color: #10b981; font-weight: 500;">✓ AI picture generated successfully</p>
+                    <button type="button" onclick="useAIImage('${pollinationsUrl}')" style="margin-top: 0.5rem; padding: 0.5rem 1rem; background: #10b981; color: white; border: none; border-radius: 5px; cursor: pointer;">Use This Image</button>
+                `;
+            };
+            img.onerror = function() {
+                tryAlternativeImageGeneration(recipeTitle);
+            };
+            img.src = pollinationsUrl;
+        } catch (error) {
+            console.error('Error in generateAIPicture:', error);
+            tryAlternativeImageGeneration(recipeTitle);
+        }
+    }
+    async function tryAlternativeImageGeneration(recipeTitle) {
+        try {
+            const foodKeywords = ['food', 'meal', 'dish', 'cooking', 'kitchen', 'restaurant'];
+            const randomKeyword = foodKeywords[Math.floor(Math.random() * foodKeywords.length)];
+            const picsumUrl = `https://picsum.photos/800/600?random=${Date.now()}`;
+            imagePreview.innerHTML = `
+                <img src="${picsumUrl}" alt="Generated image for ${recipeTitle}" style="max-width: 300px; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
+                <p style="margin-top: 0.5rem; color: #10b981; font-weight: 500;">✓ Image generated successfully</p>
+                <button type="button" onclick="useAIImage('${picsumUrl}')" style="margin-top: 0.5rem; padding: 0.5rem 1rem; background: #10b981; color: white; border: none; border-radius: 5px; cursor: pointer;">Use This Image</button>
+            `;
+        } catch (error) {
+            imagePreview.innerHTML = `
+                <div style="text-align: center; padding: 2rem; color: #dc2626;">
+                    <p>❌ Failed to generate image</p>
+                    <p style="font-size: 0.875rem; margin-top: 0.5rem;">Please try uploading an image manually</p>
+                </div>
+            `;
+        }
+    }
+    window.useAIImage = async function(imageUrl) {
+        try {
+            const response = await fetch(imageUrl);
+            const blob = await response.blob();
+            const file = new File([blob], `ai-generated-${Date.now()}.jpg`, { type: 'image/jpeg' });
+            const dt = new DataTransfer();
+            dt.items.add(file);
+            fileInput.files = dt.files;
+            imagePreview.innerHTML = `
+                <img src="${imageUrl}" alt="Selected AI generated image" style="max-width: 300px; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
+                <p style="margin-top: 0.5rem; color: #10b981; font-weight: 500;">✓ AI image selected for upload</p>
+            `;
+            console.log('AI image set successfully');
+            console.log('AI image file:', file);
+        } catch (error) {
+            console.error('Error setting AI image:', error);
+            alert('Error setting the AI image. Please try again.');
+        }
+    };
+});
+const style = document.createElement('style');
+style.textContent = `
+    @@keyframes spin {
+        0% { transform: rotate(0deg); }
+        100% { transform: rotate(360deg); }
+    }
+`;
+document.head.appendChild(style);
+    </script>
+    <script>
+        const fileUploadArea = document.getElementById('fileUploadArea');
+        const fileInput = document.getElementById('RecipeImage');
+        const imagePreview = document.getElementById('imagePreview');
+        fileUploadArea.addEventListener('click', () => fileInput.click());
+        fileUploadArea.addEventListener('dragover', (e) => {
+            e.preventDefault();
+            fileUploadArea.classList.add('dragover');
+        });
+        fileUploadArea.addEventListener('dragleave', () => {
+            fileUploadArea.classList.remove('dragover');
+        });
+        fileUploadArea.addEventListener('drop', (e) => {
+            e.preventDefault();
+            fileUploadArea.classList.remove('dragover');
+            const files = e.dataTransfer.files;
+            if (files.length > 0) {
+                handleFileSelect(files[0]);
+            }
+        });
+        fileInput.addEventListener('change', (e) => {
+            if (e.target.files && e.target.files[0]) {
+                handleFileSelect(e.target.files[0]);
+            }
+        });
+        function handleFileSelect(file) {
+            if (file.type.startsWith('image/')) {
+                const reader = new FileReader();
+                reader.onload = (e) => {
+                    imagePreview.innerHTML = `
+                        <img src="${e.target.result}" alt="Recipe preview" style="max-width: 300px; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
+                        <p style="margin-top: 0.5rem; color: #4CAF50; font-weight: 500;">✓ Image uploaded successfully</p>
+                    `;
+                };
+                reader.readAsDataURL(file);
+            }
+        }
+        console.log();
+    </script>
 </body>
 </html>
+<script id="selectedInstructionsScript" type="application/json">
+    @Html.Raw(JsonSerializer.Serialize(Model.Instructions))
+</script>
+<script id="selectedIngredientsScript" type="application/json">
+   @Html.Raw(JsonSerializer.Serialize(Model.RecipeIngredients))
+</script>
+<script src="~/js/recipe-search-edit.js"></script>
Index: NutriMatch/Views/Recipes/Index.cshtml
===================================================================
--- NutriMatch/Views/Recipes/Index.cshtml	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/Views/Recipes/Index.cshtml	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -130,15 +130,22 @@
         .recipe-grid {
             display: grid;
-            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
+            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
             gap: 2rem;
             margin-top: 2rem;
+            justify-items: center;
         }
         .recipe-card {
+            width: 350px !important;
             background: white;
             border-radius: 20px;
             overflow: hidden;
             box-shadow: 0 8px 32px rgba(0,0,0,0.1);
-            transition: all 0.3s ease;
+            transition: transform 0.3s ease, box-shadow 0.3s ease;
             position: relative;
+            cursor: pointer;
+            min-height: 400px !important;
+            max-width: 350px !important;
+            flex-shrink: 0;
+            box-sizing: border-box;
         }
         .recipe-card:hover {
@@ -146,23 +153,100 @@
             box-shadow: 0 20px 40px rgba(0,0,0,0.15);
         }
+        .recipe-card.loading {
+            pointer-events: none;
+        }
+        .recipe-card.loading * {
+            transition: none !important;
+            animation: none !important;
+        }
         .recipe-image {
-            width: 100%;
-            height: 200px;
+            width: 100% !important;
+            height: 200px !important;
             object-fit: cover;
             background: linear-gradient(45deg, var(--nutri-green), var(--nutri-green-dark));
+            position: relative;
+            display: block !important;
+            flex-shrink: 0;
+            box-sizing: border-box;
+        }
+        .favorite-btn {
+            position: absolute;
+            top: 12px;
+            right: 12px;
+            background: rgba(255, 255, 255, 0.9);
+            border: none;
+            border-radius: 50%;
+            width: 40px;
+            height: 40px;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            cursor: pointer;
+            transition: all 0.3s ease;
+            z-index: 10;
+            backdrop-filter: blur(10px);
+        }
+        .favorite-btn:hover {
+            background: rgba(255, 255, 255, 1);
+            transform: scale(1.1);
+        }
+        .favorite-btn i {
+            font-size: 18px;
+            color: #ef4444;
+            transition: all 0.3s ease;
+        }
+        .favorite-btn:hover i {
+            color: #dc2626;
+        }
+        .favorite-btn.active i {
+            color: #ef4444;
+            font-weight: 900;
         }
         .recipe-content {
-            padding: 1.5rem;
+            padding: 1.5rem !important;
+            height: calc(100% - 200px) !important;
+            display: flex !important;
+            flex-direction: column !important;
+            box-sizing: border-box;
+            position: relative;
+            flex-shrink: 0;
         }
         .recipe-title {
-            font-size: 1.3rem;
-            font-weight: 700;
-            color: #1f2937;
-            margin-bottom: 0.5rem;
-        }
-        .recipe-description {
+            font-size: 1.3rem !important;
+            font-weight: 700 !important;
+            color: #1f2937 !important;
+            margin-bottom: 0.5rem !important;
+            line-height: 1.3 !important;
+            transition: none !important;
+            animation: none !important;
+        }
+        .recipe-card .recipe-title,
+        .recipe-card:hover .recipe-title,
+        .recipe-card:active .recipe-title,
+        .recipe-card:focus .recipe-title,
+        .recipe-card.loading .recipe-title {
+            font-size: 1.3rem !important;
+            font-weight: 700 !important;
+            color: #1f2937 !important;
+            margin-bottom: 0.5rem !important;
+            line-height: 1.3 !important;
+            transition: none !important;
+            animation: none !important;
+        }
+        .recipe-meta {
+            display: flex;
+            align-items: center;
+            gap: 1rem;
+            margin-bottom: 1rem;
+            font-size: 0.9rem;
             color: var(--nutri-gray);
-            margin-bottom: 1rem;
-            font-size: 0.95rem;
+            flex-wrap: wrap;
+        }
+        .recipe-meta .rating {
+            color: #fbbf24;
+            font-weight: 600;
+        }
+        .recipe-meta i {
+            margin-right: 4px;
         }
         .recipe-macros {
@@ -170,5 +254,5 @@
             grid-template-columns: repeat(4, 1fr);
             gap: 0.5rem;
-            margin-bottom: 1rem;
+            margin-top: auto;
         }
         .macro-item {
@@ -182,4 +266,5 @@
             color: var(--nutri-green-dark);
             font-size: 1rem;
+            line-height: 1.2;
         }
         .macro-label {
@@ -188,53 +273,37 @@
             text-transform: uppercase;
             font-weight: 600;
-        }
-        .recipe-rating {
-            display: flex;
-            align-items: center;
-            gap: 0.5rem;
-            margin-bottom: 1rem;
-        }
-        .stars {
-            color: #fbbf24;
-        }
-        .rating-text {
+            line-height: 1;
+        }
+        .results-count {
+            margin: 1rem 0;
+            font-size: 1.1rem;
             color: var(--nutri-gray);
-            font-size: 0.9rem;
-        }
-        .view-recipe-btn {
-            width: 100%;
-            background: var(--nutri-green);
-            border: none;
-            color: white;
-            padding: 0.8rem;
-            border-radius: 12px;
             font-weight: 600;
-            transition: all 0.3s ease;
-        }
-        .view-recipe-btn:hover {
-            background: var(--nutri-green-dark);
-            color: white;
-        }
-        .chef-badge {
-            position: absolute;
-            top: 15px;
-            right: 15px;
-            background: rgba(255,255,255,0.95);
-            padding: 0.5rem 1rem;
-            border-radius: 20px;
-            font-size: 0.8rem;
-            font-weight: 600;
-            color: var(--nutri-green-dark);
-            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
-        }
-        .filter-values {
-            font-size: 0.9rem;
-            color: var(--nutri-green-dark);
-            font-weight: 600;
-        }
-        .results-count {
-            color: var(--nutri-gray);
-            font-size: 1.1rem;
-            margin-bottom: 1rem;
+        }
+        #modalWindow {
+            position: fixed;
+            top: 0;
+            left: 0;
+            z-index: 9999;
+            pointer-events: none;
+        }
+        #modalWindow .modal {
+            pointer-events: all;
+        }
+        .recipe-card * {
+            box-sizing: border-box;
+        }
+        .recipe-card[style*="none"] {
+            display: none !important;
+        }
+        .recipe-card[style*="block"] {
+            display: block !important;
+        }
+        .recipe-card h3.recipe-title {
+            font-size: 1.3rem !important;
+            font-weight: 700 !important;
+            color: #1f2937 !important;
+            margin-bottom: 0.5rem !important;
+            line-height: 1.3 !important;
         }
     </style>
@@ -245,5 +314,5 @@
             <div class="row align-items-center">
                 <div class="col-md-10">
-                    <input type="text" class="form-control search-input" placeholder="Search recipes    " id="searchInput">
+                    <input type="text" class="form-control search-input" placeholder="Search recipes..." id="searchInput">
                 </div>
                 <div class="col-md-2">
@@ -318,231 +387,105 @@
         </div>
         <div class="recipe-grid" id="recipeGrid">
-            <div class="recipe-card">
-                <div class="chef-badge">Chef Milan</div>
-                <div class="recipe-image" style="background: url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 300 200%22><rect fill=%22%2322c55e%22 width=%22300%22 height=%22200%22/><circle fill=%22%23ffffff%22 cx=%22150%22 cy=%22100%22 r=%2230%22 opacity=%220.3%22/></svg>') center/cover;"></div>
-                <div class="recipe-content">
-                    <h5 class="recipe-title">Mediterranean Buddha Bowl</h5>
-                    <p class="recipe-description">A colorful mix of quinoa, roasted vegetables, and tahini dressing</p>
-                    <div class="recipe-macros">
-                        <div class="macro-item">
-                            <div class="macro-value">420</div>
-                            <div class="macro-label">Cal</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">18g</div>
-                            <div class="macro-label">Protein</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">52g</div>
-                            <div class="macro-label">Carbs</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">14g</div>
-                            <div class="macro-label">Fats</div>
+            @foreach(var recipe in Model)
+            {
+                <div class="recipe-card" onclick="showRecipeDetails(@recipe.Id)" data-calories="@recipe.Calories" data-protein="@recipe.Protein" data-carbs="@recipe.Carbs" data-fat="@recipe.Fat">
+                    <button class="favorite-btn" onclick="event.stopPropagation(); toggleFavorite(this)">
+                        <i class="far fa-heart"></i>
+                    </button>
+                    <img src="@recipe.ImageUrl" alt="@recipe.Title" class="recipe-image">
+                    <div class="recipe-content">
+                        <h3 class="recipe-title">@recipe.Title</h3>
+                        <div class="recipe-meta">
+                            <span class="rating">
+                                <i class="fas fa-star"></i> 4.8
+                            </span>
+                            <span><i class="far fa-clock"></i> 25 min</span>
+                            <span><i class="fas fa-user"></i> Chef Mario</span>
+                        </div>
+                        <div class="recipe-macros">
+                            <div class="macro-item">
+                                <div class="macro-value">@recipe.Calories</div>
+                                <div class="macro-label">Cal</div>
+                            </div>
+                            <div class="macro-item">
+                                <div class="macro-value">@recipe.Protein</div>
+                                <div class="macro-label">Protein</div>
+                            </div>
+                            <div class="macro-item">
+                                <div class="macro-value">@recipe.Carbs</div>
+                                <div class="macro-label">Carbs</div>
+                            </div>
+                            <div class="macro-item">
+                                <div class="macro-value">@recipe.Fat</div>
+                                <div class="macro-label">Fats</div>
+                            </div>
                         </div>
                     </div>
-                    <div class="recipe-rating">
-                        <div class="stars">
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                        </div>
-                        <span class="rating-text">(4.9) • 127 reviews</span>
-                    </div>
-                    <button class="btn view-recipe-btn">View Recipe</button>
                 </div>
-            </div>
-            <div class="recipe-card">
-                <div class="chef-badge">Chef Sarah</div>
-                <div class="recipe-image" style="background: url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 300 200%22><rect fill=%22%23f59e0b%22 width=%22300%22 height=%22200%22/><circle fill=%22%23ffffff%22 cx=%22150%22 cy=%22100%22 r=%2225%22 opacity=%220.4%22/></svg>') center/cover;"></div>
-                <div class="recipe-content">
-                    <h5 class="recipe-title">Grilled Chicken & Avocado Salad</h5>
-                    <p class="recipe-description">High-protein salad with mixed greens and lime vinaigrette</p>
-                    <div class="recipe-macros">
-                        <div class="macro-item">
-                            <div class="macro-value">380</div>
-                            <div class="macro-label">Cal</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">35g</div>
-                            <div class="macro-label">Protein</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">12g</div>
-                            <div class="macro-label">Carbs</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">22g</div>
-                            <div class="macro-label">Fats</div>
-                        </div>
-                    </div>
-                    <div class="recipe-rating">
-                        <div class="stars">
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="far fa-star"></i>
-                        </div>
-                        <span class="rating-text">(4.7) • 89 reviews</span>
-                    </div>
-                    <button class="btn view-recipe-btn">View Recipe</button>
-                </div>
-            </div>
-            <div class="recipe-card">
-                <div class="chef-badge">Chef Marco</div>
-                <div class="recipe-image" style="background: url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 300 200%22><rect fill=%22%238b5cf6%22 width=%22300%22 height=%22200%22/><circle fill=%22%23ffffff%22 cx=%22150%22 cy=%22100%22 r=%2235%22 opacity=%220.3%22/></svg>') center/cover;"></div>
-                <div class="recipe-content">
-                    <h5 class="recipe-title">Salmon Teriyaki Bowl</h5>
-                    <p class="recipe-description">Glazed salmon with brown rice and steamed vegetables</p>
-                    <div class="recipe-macros">
-                        <div class="macro-item">
-                            <div class="macro-value">520</div>
-                            <div class="macro-label">Cal</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">28g</div>
-                            <div class="macro-label">Protein</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">45g</div>
-                            <div class="macro-label">Carbs</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">24g</div>
-                            <div class="macro-label">Fats</div>
-                        </div>
-                    </div>
-                    <div class="recipe-rating">
-                        <div class="stars">
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                        </div>
-                        <span class="rating-text">(4.8) • 156 reviews</span>
-                    </div>
-                    <button class="btn view-recipe-btn">View Recipe</button>
-                </div>
-            </div>
-            <div class="recipe-card">
-                <div class="chef-badge">Chef Lisa</div>
-                <div class="recipe-image" style="background: url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 300 200%22><rect fill=%22%2306b6d4%22 width=%22300%22 height=%22200%22/><circle fill=%22%23ffffff%22 cx=%22150%22 cy=%22100%22 r=%2228%22 opacity=%220.4%22/></svg>') center/cover;"></div>
-                <div class="recipe-content">
-                    <h5 class="recipe-title">Veggie Protein Smoothie Bowl</h5>
-                    <p class="recipe-description">Spinach, banana and protein powder topped with berries</p>
-                    <div class="recipe-macros">
-                        <div class="macro-item">
-                            <div class="macro-value">290</div>
-                            <div class="macro-label">Cal</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">25g</div>
-                            <div class="macro-label">Protein</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">38g</div>
-                            <div class="macro-label">Carbs</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">8g</div>
-                            <div class="macro-label">Fats</div>
-                        </div>
-                    </div>
-                    <div class="recipe-rating">
-                        <div class="stars">
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="far fa-star"></i>
-                        </div>
-                        <span class="rating-text">(4.6) • 73 reviews</span>
-                    </div>
-                    <button class="btn view-recipe-btn">View Recipe</button>
-                </div>
-            </div>
-            <div class="recipe-card">
-                <div class="chef-badge">Chef Tony</div>
-                <div class="recipe-image" style="background: url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 300 200%22><rect fill=%22%23ef4444%22 width=%22300%22 height=%22200%22/><circle fill=%22%23ffffff%22 cx=%22150%22 cy=%22100%22 r=%2232%22 opacity=%220.3%22/></svg>') center/cover;"></div>
-                <div class="recipe-content">
-                    <h5 class="recipe-title">Turkey & Sweet Potato Hash</h5>
-                    <p class="recipe-description">Lean ground turkey with roasted sweet potatoes and herbs</p>
-                    <div class="recipe-macros">
-                        <div class="macro-item">
-                            <div class="macro-value">450</div>
-                            <div class="macro-label">Cal</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">32g</div>
-                            <div class="macro-label">Protein</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">35g</div>
-                            <div class="macro-label">Carbs</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">18g</div>
-                            <div class="macro-label">Fats</div>
-                        </div>
-                    </div>
-                    <div class="recipe-rating">
-                        <div class="stars">
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                        </div>
-                        <span class="rating-text">(4.9) • 201 reviews</span>
-                    </div>
-                    <button class="btn view-recipe-btn">View Recipe</button>
-                </div>
-            </div>
-            <div class="recipe-card">
-                <div class="chef-badge">Chef Elena</div>
-                <div class="recipe-image" style="background: url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 300 200%22><rect fill=%22%2322c55e%22 width=%22300%22 height=%22200%22/><circle fill=%22%23ffffff%22 cx=%22150%22 cy=%22100%22 r=%2240%22 opacity=%220.2%22/></svg>') center/cover;"></div>
-                <div class="recipe-content">
-                    <h5 class="recipe-title">Quinoa Stuffed Bell Peppers</h5>
-                    <p class="recipe-description">Colorful bell peppers stuffed with quinoa and black beans</p>
-                    <div class="recipe-macros">
-                        <div class="macro-item">
-                            <div class="macro-value">320</div>
-                            <div class="macro-label">Cal</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">14g</div>
-                            <div class="macro-label">Protein</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">58g</div>
-                            <div class="macro-label">Carbs</div>
-                        </div>
-                        <div class="macro-item">
-                            <div class="macro-value">6g</div>
-                            <div class="macro-label">Fats</div>
-                        </div>
-                    </div>
-                    <div class="recipe-rating">
-                        <div class="stars">
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="fas fa-star"></i>
-                            <i class="far fa-star"></i>
-                        </div>
-                        <span class="rating-text">(4.5) • 94 reviews</span>
-                    </div>
-                    <button class="btn view-recipe-btn">View Recipe</button>
-                </div>
-            </div>
+            }
         </div>
     </div>
-</body>
+    <div id="modalWindow"></div>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
     <script>
+        function showRecipeDetails(recipeId) {
+            const clickedCard = event.currentTarget;
+            clickedCard.classList.add('loading');
+            const titleElement = clickedCard.querySelector('.recipe-title');
+            const originalStyles = {
+                fontSize: '1.3rem',
+                fontWeight: '700',
+                color: '#1f2937',
+                marginBottom: '0.5rem',
+                lineHeight: '1.3'
+            };
+            Object.assign(titleElement.style, originalStyles);
+            fetch(`/Recipes/Details/${recipeId}`)
+                .then(response => {
+                    if (!response.ok) {
+                        throw new Error('Network response was not ok');
+                    }
+                    return response.text();
+                })
+                .then(html => {
+                    const modalContainer = document.getElementById('modalWindow');
+                    modalContainer.innerHTML = html;
+                    const modalElement = modalContainer.querySelector('.modal');
+                    if (modalElement) {
+                        const modal = new bootstrap.Modal(modalElement);
+                        modal.show();
+                        modalElement.addEventListener('hidden.bs.modal', function () {
+                            modalContainer.innerHTML = '';
+                            clickedCard.classList.remove('loading');
+                            titleElement.style.cssText = '';
+                        });
+                        modalElement.addEventListener('shown.bs.modal', function () {
+                            clickedCard.classList.remove('loading');
+                            Object.assign(titleElement.style, originalStyles);
+                        });
+                    } else {
+                        clickedCard.classList.remove('loading');
+                        titleElement.style.cssText = '';
+                    }
+                })
+                .catch(err => {
+                    console.error("Failed to fetch recipe details", err);
+                    alert("Failed to load recipe details. Please try again.");
+                    clickedCard.classList.remove('loading');
+                    titleElement.style.cssText = '';
+                });
+        }
+        function toggleFavorite(button) {
+            const icon = button.querySelector('i');
+            if (icon.classList.contains('far')) {
+                icon.classList.remove('far');
+                icon.classList.add('fas');
+                button.classList.add('active');
+            } else {
+                icon.classList.remove('fas');
+                icon.classList.add('far');
+                button.classList.remove('active');
+            }
+        }
         document.addEventListener('DOMContentLoaded', function() {
             updateSlider('calories');
@@ -604,13 +547,9 @@
             recipeCards.forEach(card => {
                 const title = card.querySelector('.recipe-title').textContent.toLowerCase();
-                const description = card.querySelector('.recipe-description').textContent.toLowerCase();
-                const macroValues = card.querySelectorAll('.macro-value');
-                const recipeCalories = parseInt(macroValues[0].textContent);
-                const recipeProtein = parseInt(macroValues[1].textContent);
-                const recipeCarbs = parseInt(macroValues[2].textContent);
-                const recipeFats = parseInt(macroValues[3].textContent);
-                const matchesSearch = searchTerm === '' || 
-                    title.includes(searchTerm) || 
-                    description.includes(searchTerm);
+                const recipeCalories = parseInt(card.dataset.calories) || 0;
+                const recipeProtein = parseInt(card.dataset.protein) || 0;
+                const recipeCarbs = parseInt(card.dataset.carbs) || 0;
+                const recipeFats = parseInt(card.dataset.fat) || 0;
+                const matchesSearch = searchTerm === '' || title.includes(searchTerm);
                 const matchesMacros = 
                     recipeCalories >= calories.min && recipeCalories <= calories.max &&
@@ -638,41 +577,11 @@
                 }
             });
+            const filterSection = document.querySelector('.filter-section h4');
+            const resetBtn = document.createElement('button');
+            resetBtn.className = 'btn btn-outline-secondary btn-sm ms-3';
+            resetBtn.innerHTML = '<i class="fas fa-undo me-1"></i>Reset Filters';
+            resetBtn.onclick = resetFilters;
+            filterSection.appendChild(resetBtn);
         });
-        document.addEventListener('DOMContentLoaded', function() {
-            const viewRecipeButtons = document.querySelectorAll('.view-recipe-btn');
-            viewRecipeButtons.forEach(button => {
-                button.addEventListener('click', function() {
-                    const recipeCard = this.closest('.recipe-card');
-                    const recipeTitle = recipeCard.querySelector('.recipe-title').textContent;
-                    alert(`Opening recipe: ${recipeTitle}`);
-                });
-            });
-        });
-        function searchRecipes() {
-            const searchTerm = document.getElementById('searchInput').value.trim();
-            if (searchTerm) {
-                console.log('Searching for:', searchTerm);
-                filterRecipes();
-                if (history.pushState) {
-                    const newUrl = new URL(window.location);
-                    newUrl.searchParams.set('search', searchTerm);
-                    history.pushState({}, '', newUrl);
-                }
-            } else {
-                filterRecipes();
-            }
-        }
-        function animateCards() {
-            const visibleCards = document.querySelectorAll('.recipe-card[style*="block"], .recipe-card:not([style*="none"])');
-            visibleCards.forEach((card, index) => {
-                card.style.opacity = '0';
-                card.style.transform = 'translateY(20px)';
-                setTimeout(() => {
-                    card.style.transition = 'opacity 0.3s ease, transform 0.3s ease';
-                    card.style.opacity = '1';
-                    card.style.transform = 'translateY(0)';
-                }, index * 50);
-            });
-        }
         function resetFilters() {
             document.getElementById('caloriesMin').value = 0;
@@ -691,11 +600,5 @@
             filterRecipes();
         }
-        document.addEventListener('DOMContentLoaded', function() {
-            const filterSection = document.querySelector('.filter-section h4');
-            const resetBtn = document.createElement('button');
-            resetBtn.className = 'btn btn-outline-secondary btn-sm ms-3';
-            resetBtn.innerHTML = '<i class="fas fa-undo me-1"></i>Reset Filters';
-            resetBtn.onclick = resetFilters;
-            filterSection.appendChild(resetBtn);
-        });
-        </script>
+    </script>
+</body>
+</html>
Index: NutriMatch/Views/Recipes/RecipeDetailsPartial.cshtml
===================================================================
--- NutriMatch/Views/Recipes/RecipeDetailsPartial.cshtml	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
+++ NutriMatch/Views/Recipes/RecipeDetailsPartial.cshtml	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -0,0 +1,419 @@
+@model NutriMatch.Models.Recipe
+<div class="modal fade" id="recipeModal" tabindex="-1" aria-labelledby="recipeModalLabel" aria-hidden="true">
+    <div class="modal-dialog modal-xl">
+        <div class="modal-content">
+            <div class="modal-header border-0">
+                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
+            </div>
+            <div class="modal-body">
+                <div class="recipe-hero">
+                    <div class="recipe-image-container">
+                        <img src="@Model.ImageUrl" alt="@Model.Title" class="recipe-image">
+                    </div>
+                    <div class="recipe-info">
+                        <div>
+                            <div class="chef-badge">
+                                <img src="#" class="chef-avatar">
+                                Chef Milan
+                                <span class="rating-stars">
+                                    @for (int i = 1; i <= 5; i++)
+                                    {
+                                        if (i <= Model.Rating)
+                                        {
+                                            <i class="fas fa-star"></i>
+                                        }
+                                        else
+                                        {
+                                            <i class="far fa-star"></i>
+                                        }
+                                    }
+                                </span>
+                            </div>
+                            <h2 class="recipe-title">@Model.Title</h2>
+                        </div>
+                        <div class="recipe-stats">
+                            <div class="stat-item">
+                                <span class="stat-value">20</span>
+                                <span class="stat-label">mins</span>
+                            </div>
+                            <div class="stat-item">
+                                <span class="stat-value">@Model.Calories</span>
+                                <span class="stat-label">calories</span>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="row">
+                    <div class="col-md-4">
+                        <div class="nutrition-card">
+                            <h4 class="section-title">
+                                <i class="fas fa-chart-pie"></i>
+                                Nutrition Facts
+                            </h4>
+                            <div class="nutrition-grid">
+                                <div class="nutrition-item">
+                                    <div class="nutrition-value">@Model.Calories</div>
+                                    <div class="nutrition-label">Calories</div>
+                                </div>
+                                <div class="nutrition-item">
+                                    <div class="nutrition-value">@Model.Protein</div>
+                                    <div class="nutrition-label">Protein</div>
+                                </div>
+                                <div class="nutrition-item">
+                                    <div class="nutrition-value">@Model.Carbs</div>
+                                    <div class="nutrition-label">Carbs</div>
+                                </div>
+                                <div class="nutrition-item">
+                                    <div class="nutrition-value">@Model.Fat</div>
+                                    <div class="nutrition-label">Fat</div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="col-md-8">
+                        <div class="ingredients-list">
+                            <h4 class="section-title">
+                                <i class="fas fa-list-ul"></i>
+                                Ingredients
+                            </h4>
+                            @if (Model.RecipeIngredients != null && Model.RecipeIngredients.Any())
+                            {
+                                @for (int i = 0; i < Model.RecipeIngredients.Count; i++)
+                                {
+                                    <div class="ingredient-item">
+                                        <input type="checkbox" class="ingredient-checkbox" id="ingredient@(i + 1)"> 
+                                        <label for="ingredient@(i + 1)">@Model.RecipeIngredients[i].Ingredient.Name, @Model.RecipeIngredients[i].Quantity @Model.RecipeIngredients[i].Unit </label>
+                                    </div>
+                                }
+                            }
+                        </div>
+                        <div class="instructions-list">
+                            <h4 class="section-title">
+                                <i class="fas fa-clipboard-list"></i>
+                                Instructions
+                            </h4>
+                            <p>@Model.Instructions</p>
+                        </div>
+                        <div class="action-buttons">
+                                <button type="submit" class="btn btn-nutri">
+                                    <i class="fas fa-heart me-2"></i>
+                                    Save Recipe
+                                </button>
+                                <button type="submit" class="btn btn-outline-nutri">
+                                    <i class="fas fa-calendar-plus me-2"></i>
+                                    Add to Meal Plan
+                                </button>
+                                <button type="submit" class="btn btn-outline-nutri">
+                                    <i class="fas fa-shopping-cart me-2"></i>
+                                    Add to Shopping List
+                                </button>
+                            <button type="button" class="btn btn-outline-nutri" onclick="shareRecipe(@Model.Id)">
+                                <i class="fas fa-share-alt me-2"></i>
+                                Share Recipe
+                            </button>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<style>
+    :root {
+        --nutri-primary: #4CAF50;
+        --nutri-secondary: #45A049;
+        --nutri-light: #E8F5E8;
+        --nutri-dark: #2E7D32;
+    }
+    .modal-xl {
+        max-width: 1200px;
+    }
+    .recipe-hero {
+        display: flex;
+        gap: 2rem;
+        background: white;
+        border-radius: 15px;
+        overflow: hidden;
+        margin-bottom: 2rem;
+        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
+        min-height: 300px;
+    }
+    .recipe-image-container {
+        flex: 0 0 40%;
+        position: relative;
+        overflow: hidden;
+        border-radius: 15px 0 0 15px;
+    }
+    .recipe-image {
+        width: 100%;
+        height: 100%;
+        object-fit: cover;
+        transition: transform 0.3s ease;
+    }
+    .recipe-image:hover {
+        transform: scale(1.05);
+    }
+    .recipe-info {
+        flex: 1;
+        padding: 2rem;
+        display: flex;
+        flex-direction: column;
+        justify-content: space-between;
+    }
+    .chef-badge {
+        display: inline-flex;
+        align-items: center;
+        background: var(--nutri-primary);
+        color: white;
+        padding: 0.5rem 1rem;
+        border-radius: 25px;
+        font-size: 0.9rem;
+        margin-bottom: 1rem;
+        font-weight: 500;
+    }
+    .chef-avatar {
+        width: 30px;
+        height: 30px;
+        border-radius: 50%;
+        margin-right: 0.5rem;
+        border: 2px solid white;
+    }
+    .rating-stars {
+        color: #FFD700;
+        margin-left: 0.5rem;
+    }
+    @@media (max-width: 768px) {
+        .recipe-hero {
+            flex-direction: column;
+        }
+        .recipe-image-container {
+            flex: none;
+            height: 250px;
+            border-radius: 15px 15px 0 0;
+        }
+        .recipe-stats {
+            flex-wrap: wrap;
+            gap: 1rem;
+        }
+        .stat-item {
+            min-width: calc(50% - 0.5rem);
+        }
+    }
+    .recipe-stats {
+        display: flex;
+        gap: 1.5rem;
+        margin-top: 1.5rem;
+    }
+    .stat-item {
+        text-align: center;
+        background: var(--nutri-light);
+        padding: 1rem;
+        border-radius: 10px;
+        flex: 1;
+        min-width: 80px;
+    }
+    .stat-value {
+        font-size: 1.5rem;
+        font-weight: bold;
+        display: block;
+        color: var(--nutri-dark);
+    }
+    .stat-label {
+        font-size: 0.9rem;
+        color: #666;
+        margin-top: 0.25rem;
+    }
+    .recipe-title {
+        color: var(--nutri-dark);
+        font-size: 2rem;
+        font-weight: 600;
+        margin-bottom: 1rem;
+        line-height: 1.2;
+    }
+    .recipe-description {
+        color: #666;
+        font-size: 1.1rem;
+        line-height: 1.5;
+        margin-bottom: 1.5rem;
+    }
+    .nutrition-card {
+        background: var(--nutri-light);
+        border-radius: 15px;
+        padding: 1.5rem;
+        margin-bottom: 1.5rem;
+    }
+    .nutrition-grid {
+        display: grid;
+        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
+        gap: 1rem;
+    }
+    .nutrition-item {
+        text-align: center;
+        background: white;
+        padding: 1rem;
+        border-radius: 10px;
+        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
+    }
+    .nutrition-value {
+        font-size: 1.5rem;
+        font-weight: bold;
+        color: var(--nutri-dark);
+    }
+    .nutrition-label {
+        font-size: 0.9rem;
+        color: #666;
+        margin-top: 0.25rem;
+    }
+    .ingredients-list {
+        background: white;
+        border-radius: 15px;
+        padding: 1.5rem;
+        margin-bottom: 1.5rem;
+        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
+    }
+    .ingredient-item {
+        display: flex;
+        align-items: center;
+        padding: 0.75rem 0;
+        border-bottom: 1px solid #f0f0f0;
+    }
+    .ingredient-item:last-child {
+        border-bottom: none;
+    }
+    .ingredient-checkbox {
+        margin-right: 1rem;
+        transform: scale(1.2);
+        accent-color: var(--nutri-primary);
+    }
+    .instructions-list {
+        background: white;
+        border-radius: 15px;
+        padding: 1.5rem;
+        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
+    }
+    .instruction-step {
+        display: flex;
+        margin-bottom: 1.5rem;
+        padding-bottom: 1.5rem;
+        border-bottom: 1px solid #f0f0f0;
+    }
+    .instruction-step:last-child {
+        border-bottom: none;
+        margin-bottom: 0;
+        padding-bottom: 0;
+    }
+    .step-number {
+        background: var(--nutri-primary);
+        color: white;
+        width: 40px;
+        height: 40px;
+        border-radius: 50%;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        font-weight: bold;
+        margin-right: 1rem;
+        flex-shrink: 0;
+    }
+    .step-content {
+        flex: 1;
+        padding-top: 0.5rem;
+    }
+    .action-buttons {
+        display: flex;
+        gap: 1rem;
+        margin-top: 2rem;
+    }
+    .btn-nutri {
+        background: var(--nutri-primary);
+        border: none;
+        color: white;
+        padding: 0.75rem 1.5rem;
+        border-radius: 25px;
+        font-weight: 500;
+        transition: all 0.3s ease;
+    }
+    .btn-nutri:hover {
+        background: var(--nutri-secondary);
+        color: white;
+        transform: translateY(-2px);
+    }
+    .btn-outline-nutri {
+        border: 2px solid var(--nutri-primary);
+        color: var(--nutri-primary);
+        background: transparent;
+        padding: 0.75rem 1.5rem;
+        border-radius: 25px;
+        font-weight: 500;
+        transition: all 0.3s ease;
+    }
+    .btn-outline-nutri:hover {
+        background: var(--nutri-primary);
+        color: white;
+        transform: translateY(-2px);
+    }
+    .difficulty-badge {
+        display: inline-block;
+        padding: 0.25rem 0.75rem;
+        border-radius: 15px;
+        font-size: 0.8rem;
+        font-weight: 500;
+    }
+    .difficulty-easy {
+        background: #E8F5E9;
+        color: #2E7D32;
+    }
+    .difficulty-medium {
+        background: #FFF3E0;
+        color: #F57C00;
+    }
+    .difficulty-hard {
+        background: #FFEBEE;
+        color: #C62828;
+    }
+    .section-title {
+        color: var(--nutri-dark);
+        font-weight: 600;
+        margin-bottom: 1rem;
+        display: flex;
+        align-items: center;
+    }
+    .section-title i {
+        margin-right: 0.5rem;
+        color: var(--nutri-primary);
+    }
+    .tags-container {
+        display: flex;
+        flex-wrap: wrap;
+        gap: 0.5rem;
+        margin-top: 1rem;
+    }
+    .recipe-tag {
+        background: var(--nutri-light);
+        color: var(--nutri-dark);
+        padding: 0.25rem 0.75rem;
+        border-radius: 15px;
+        font-size: 0.85rem;
+        font-weight: 500;
+    }
+</style>
+<script>
+    document.querySelectorAll('.ingredient-checkbox').forEach(checkbox => {
+        checkbox.addEventListener('change', function() {
+            const label = this.nextElementSibling;
+            if (this.checked) {
+                label.style.textDecoration = 'line-through';
+                label.style.opacity = '0.6';
+            } else {
+                label.style.textDecoration = 'none';
+                label.style.opacity = '1';
+            }
+        });
+    });
+    document.getElementById('recipeModal').addEventListener('shown.bs.modal', function () {
+        this.querySelector('.modal-body').scrollTop = 0;
+    });
+    function shareRecipe(recipeId) {
+        console.log('Sharing recipe with ID:', recipeId);
+    }
+</script>
Index: NutriMatch/Views/Shared/_Layout.cshtml
===================================================================
--- NutriMatch/Views/Shared/_Layout.cshtml	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/Views/Shared/_Layout.cshtml	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -10,32 +10,37 @@
     <link rel="stylesheet" href="~/NutriMatch.styles.css" asp-append-version="true" />
     <link rel="stylesheet" href="~/css/_Layout.css"  />
+</head>
 <body>
     <header>
         <nav class="navbar navbar-expand-lg navbar-light fixed-top">
-        <div class="container">
-            <a class="navbar-brand" href="#">
-                <img src="~/images/NutriMatch.png" alt="NutriMatch Logo" class="logo" style="width: 150px;" />
-            </a>
-            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
-                <span class="navbar-toggler-icon"></span>
-            </button>
-            <div class="collapse navbar-collapse" id="navbarNav">
-                <ul class="navbar-nav ms-auto">
-                    <li class="nav-item">
-                        <a class="nav-link" href="/Home">Home</a>
-                    </li>
-                    <li class="nav-item">
-                        <a class="nav-link" href="/Recipes" >Recipes</a>
-                    </li>
-                    <li class="nav-item">
-                        <a class="nav-link" href="#">Restaurants</a>
-                    </li>
-                    <li class="nav-item">
-                        <a class="nav-link" href="#">My Account</a>
-                    </li>
-                </ul>
+            <div class="container">
+                <a class="navbar-brand" href="#">
+                    <img src="~/images/NutriMatch.png" alt="NutriMatch Logo" class="logo" style="width: 150px;" />
+                </a>
+                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
+                    <span class="navbar-toggler-icon"></span>
+                </button>
+                <div class="collapse navbar-collapse" id="navbarNav">
+                    <ul class="navbar-nav ms-auto">
+                        <li class="nav-item">
+                            <a class="nav-link" href="/Home">Home</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link" href="/Recipes" >Recipes</a>
+                        </li>
+                         <li class="nav-item">
+                            <a class="nav-link" href="/Recipes/Create">Add Recipe</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link" href="#">Restaurants</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link" href="#">My Account</a>
+                        </li>
+                       
+                    </ul>
+                </div>
             </div>
-        </div>
-    </nav>
+        </nav>
     </header>
     <div class="container">
Index: NutriMatch/wwwroot/css/recipe-search.css
===================================================================
--- NutriMatch/wwwroot/css/recipe-search.css	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/wwwroot/css/recipe-search.css	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -96,4 +96,74 @@
 }
 
+
+.instructions-container {
+    margin-bottom: 15px;
+}
+
+.instructions-list {
+    margin-top: 10px;
+    padding: 10px;
+    background-color: #f8f9fa;
+    border-radius: 0.375rem;
+    min-height: 50px;
+}
+
+.instruction-item {
+    display: flex;
+    align-items: flex-start;
+    background-color: #ffffff;
+    padding: 12px;
+    margin: 8px 0;
+    border-radius: 8px;
+    border-left: 4px solid #0d6efd;
+    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+    transition: box-shadow 0.15s ease-in-out;
+}
+
+.instruction-item:hover {
+    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
+}
+
+.instruction-number {
+    background-color: #0d6efd;
+    color: white;
+    border-radius: 50%;
+    width: 28px;
+    height: 28px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 12px;
+    flex-shrink: 0;
+}
+
+.instruction-text {
+    flex: 1;
+    line-height: 1.5;
+    color: #333;
+    font-size: 14px;
+}
+
+.instruction-item .remove {
+    cursor: pointer;
+    margin-left: 12px;
+    color: #dc3545;
+    font-weight: bold;
+    font-size: 20px;
+    width: 24px;
+    height: 24px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border-radius: 50%;
+    transition: background-color 0.15s ease-in-out;
+}
+
+.instruction-item .remove:hover {
+    background-color: rgba(220, 53, 69, 0.1);
+}
+
 .form-container {
     max-width: 800px;
@@ -116,3 +186,26 @@
         max-height: 150px;
     }
-}
+    
+    .instruction-item {
+        padding: 10px;
+        margin: 6px 0;
+    }
+    
+    .instruction-number {
+        width: 24px;
+        height: 24px;
+        font-size: 12px;
+        margin-right: 10px;
+    }
+    
+    .instruction-text {
+        font-size: 13px;
+    }
+    
+    .instruction-item .remove {
+        font-size: 18px;
+        width: 20px;
+        height: 20px;
+        margin-left: 8px;
+    }
+}
Index: NutriMatch/wwwroot/js/recipe-search-edit.js
===================================================================
--- NutriMatch/wwwroot/js/recipe-search-edit.js	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
+++ NutriMatch/wwwroot/js/recipe-search-edit.js	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -0,0 +1,303 @@
+
+let selectedIngredients = [];
+let selectedInstructions = [];
+let searchTimeout;
+let currentFocus = -1;
+let selectedIngredient = null;
+const ingredientSearch = document.getElementById('ingredientSearch');
+const ingredientDropdown = document.getElementById('ingredientDropdown');
+const ingredientsList = document.getElementById('ingredientsList');
+const hiddenIngredientsInput = document.getElementById('selectedIngredients');
+const addButton = document.getElementById('addIngredientButton');
+const qtyInput = document.getElementById('ingredientQuantity');
+const unitSelect = document.getElementById('ingredientUnit');
+const instructionInput = document.getElementById('instructionInput');
+const addInstructionButton = document.getElementById('addInstructionButton');
+const instructionsList = document.getElementById('instructionsList');
+const hiddenInstructionsInput = document.getElementById('selectedInstructions');
+document.addEventListener('DOMContentLoaded', function() {
+    initializeSearchFunctionality();
+    initializeInstructionsFunctionality();
+    var strr = JSON.parse((document.getElementById('selectedInstructionsScript').innerText))[0];
+    strr = JSON.parse(strr);
+    var strr2 = JSON.parse((document.getElementById('selectedIngredientsScript').innerText));
+    console.log(strr2)
+    strr2.forEach(element => {
+        selectedIngredients.push({
+            Id: element.IngredientId,
+            Name: element.Ingredient.Name,
+            Quantity: element.Quantity,
+            Unit: element.Unit
+        })
+    });
+    updateIngredientsDisplay();
+    updateIngredientsInput();
+    strr.forEach(element => {
+        selectedInstructions.push(element);
+    });
+    updateInstructionsDisplay()
+    updateInstructionsInput()
+});
+function initializeSearchFunctionality() {
+    if (addButton) {
+        addButton.addEventListener('click', function() {
+            if (selectedIngredient && qtyInput && unitSelect) {
+                const qty = parseFloat(qtyInput.value);
+                const unit = unitSelect.value;
+                if (qty > 0 && unit && selectedIngredient.name) {
+                    addIngredient(selectedIngredient, qty, unit);
+                } else {
+                    alert('Please enter a valid quantity and select a unit.');
+                }
+            } else {
+                alert('Please search and select an ingredient first.');
+            }
+        });
+    }
+    if (ingredientSearch) {
+        ingredientSearch.addEventListener('input', function() {
+            const query = this.value.trim();
+            currentFocus = -1;
+            selectedIngredient = null;
+            if (query === '') {
+                hideDropdown(ingredientDropdown);
+                return;
+            }
+            clearTimeout(searchTimeout);
+            searchTimeout = setTimeout(() => {
+                searchIngredients(query);
+            }, 300);
+        });
+        ingredientSearch.addEventListener('keydown', function(e) {
+            handleKeyNavigation(e, ingredientDropdown);
+        });
+        ingredientSearch.addEventListener('focus', function() {
+            if (this.value.trim() !== '') {
+                searchIngredients(this.value.trim());
+            }
+        });
+    }
+    document.addEventListener('click', function(e) {
+        if (!e.target.closest('.search-container')) {
+            hideDropdown(ingredientDropdown);
+        }
+    });
+}
+function initializeInstructionsFunctionality() {
+    if (addInstructionButton) {
+        addInstructionButton.addEventListener('click', function() {
+            addInstruction();
+        });
+    }
+    if (instructionInput) {
+        instructionInput.addEventListener('keydown', function(e) {
+            if (e.key === 'Enter') {
+                e.preventDefault();
+                addInstruction();
+            }
+        });
+    }
+}
+async function searchIngredients(query) {
+    if (!ingredientDropdown) return;
+    try {
+        ingredientDropdown.innerHTML = '<div class="loading">Loading...</div>';
+        showDropdown(ingredientDropdown);
+        const response = await fetch(`/Recipes/getSuggestions?query=${encodeURIComponent(query)}`, {
+            method: 'GET',
+            headers: {
+                'Content-Type': 'application/json',
+                'X-Requested-With': 'XMLHttpRequest'
+            }
+        });
+        if (!response.ok) {
+            throw new Error(`HTTP error! status: ${response.status}`);
+        }
+        const suggestions = await response.json();
+        displaySuggestions(suggestions, query);
+    } catch (error) {
+        console.error('Error fetching suggestions:', error);
+        ingredientDropdown.innerHTML = '<div class="no-results">Error loading suggestions. Please try again.</div>';
+        showDropdown(ingredientDropdown);
+    }
+}
+function displaySuggestions(suggestions, query) {
+    if (!ingredientDropdown) return;
+    ingredientDropdown.innerHTML = '';
+    if (!suggestions || suggestions.length === 0) {
+        ingredientDropdown.innerHTML = '<div class="no-results">No results found</div>';
+        showDropdown(ingredientDropdown);
+        return;
+    }
+    suggestions.forEach((suggestion, index) => {
+        const item = document.createElement('div');
+        item.className = 'dropdown-item';
+        item.setAttribute('data-index', index);
+        const name = typeof suggestion === 'string' ? suggestion : suggestion.name;
+        const id = typeof suggestion === 'object' ? suggestion.id : null;
+        const regex = new RegExp(`(${escapeRegExp(query)})`, 'gi');
+        const highlightedText = name.replace(regex, '<strong>$1</strong>');
+        item.innerHTML = highlightedText;
+        item.addEventListener('click', function() {
+            selectedIngredient = {
+                id: id,
+                name: name
+            };
+            ingredientSearch.value = name;
+            hideDropdown(ingredientDropdown);
+        });
+        ingredientDropdown.appendChild(item);
+    });
+    showDropdown(ingredientDropdown);
+}
+function handleKeyNavigation(e, dropdownElement) {
+    if (!dropdownElement) return;
+    const items = dropdownElement.querySelectorAll('.dropdown-item:not(.no-results):not(.loading)');
+    switch(e.key) {
+        case 'ArrowDown':
+            e.preventDefault();
+            currentFocus++;
+            if (currentFocus >= items.length) currentFocus = 0;
+            setActive(items);
+            break;
+        case 'ArrowUp':
+            e.preventDefault();
+            currentFocus--;
+            if (currentFocus < 0) currentFocus = items.length - 1;
+            setActive(items);
+            break;
+        case 'Enter':
+            e.preventDefault();
+            if (currentFocus > -1 && items[currentFocus]) {
+                items[currentFocus].click();
+            }
+            break;
+        case 'Escape':
+            hideDropdown(dropdownElement);
+            e.target.blur();
+            break;
+    }
+}
+function setActive(items) {
+    items.forEach(item => item.classList.remove('highlighted'));
+    if (currentFocus >= 0 && currentFocus < items.length) {
+        items[currentFocus].classList.add('highlighted');
+        items[currentFocus].scrollIntoView({ block: 'nearest' });
+    }
+}
+function addIngredient(ingredient, quantity, unit) {
+    if (!ingredient || !ingredient.name) {
+        console.error('Invalid ingredient data');
+        return;
+    }
+    const existingIngredient = selectedIngredients.find(item => item.Id === ingredient.id);
+    if (existingIngredient) {
+        alert('This ingredient is already added to the recipe.');
+        return;
+    }
+    const newIngredient = {
+        Id: ingredient.id,
+        Name: ingredient.name,
+        Quantity: quantity,
+        Unit: unit
+    };
+    selectedIngredients.push(newIngredient);
+    updateIngredientsDisplay();
+    updateIngredientsInput();
+    if (ingredientSearch) ingredientSearch.value = '';
+    if (qtyInput) qtyInput.value = '';
+    if (unitSelect) unitSelect.value = '';
+    selectedIngredient = null;
+    hideDropdown(ingredientDropdown);
+    currentFocus = -1;
+}
+function removeIngredient(ingredientName) {
+    selectedIngredients = selectedIngredients.filter(item => item.Name !== ingredientName);
+    updateIngredientsDisplay();
+    updateIngredientsInput();
+}
+function addInstruction() {
+    if (!instructionInput) return;
+    const instruction = instructionInput.value.trim();
+    if (instruction === '') {
+        alert('Please enter an instruction.');
+        return;
+    }
+    if (selectedInstructions.includes(instruction)) {
+        alert('This instruction is already added.');
+        return;
+    }
+    selectedInstructions.push(instruction);
+    updateInstructionsDisplay();
+    updateInstructionsInput();
+    instructionInput.value = '';
+}
+function removeInstruction(instructionIndex) {
+    selectedInstructions.splice(instructionIndex, 1);
+    updateInstructionsDisplay();
+    updateInstructionsInput();
+}
+function updateIngredientsDisplay() {
+    if (!ingredientsList) return;
+    if (selectedIngredients.length === 0) {
+        ingredientsList.innerHTML = '<small class="text-muted">Selected ingredients will appear here</small>';
+    } else {
+        ingredientsList.innerHTML = selectedIngredients.map(ingredient => 
+            `<span class="ingredient-tag" style="display: inline-block; background-color: #e3f2fd; padding: 5px 10px; margin: 2px; border-radius: 15px; font-size: 14px;">
+                ${escapeHtml(ingredient.Quantity)} ${escapeHtml(ingredient.Unit)} of ${escapeHtml(ingredient.Name)}
+                <span class="remove" onclick="removeIngredient('${escapeHtml(ingredient.Name)}')" 
+                      style="cursor: pointer; margin-left: 8px; color: #dc3545; font-weight: bold;" 
+                      title="Remove ingredient">&times;</span>
+            </span>`
+        ).join('');
+    }
+}
+function updateInstructionsDisplay() {
+    if (!instructionsList) return;
+    if (selectedInstructions.length === 0) {
+        instructionsList.innerHTML = '<small class="text-muted">Added instructions will appear here</small>';
+    } else {
+        instructionsList.innerHTML = selectedInstructions.map((instruction, index) => 
+            `<div class="instruction-item" style="display: flex; flex-wrap: wrap; align-items: flex-start; background-color: #f8f9fa; padding: 10px; margin: 5px 0; border-radius: 8px; border-left: 4px solid #10b981;">
+                <span class="instruction-number" style="background-color: #10b981; color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; margin-right: 10px; flex-shrink: 0;">${index + 1}</span>
+                <span class="instruction-text" style="flex: 1; min-width: 0; word-wrap: break-word; overflow-wrap: break-word; line-height: 1.4;">
+${escapeHtml(instruction)}</span>
+                <span class="remove" onclick="removeInstruction(${index})" 
+                      style="cursor: pointer; margin-left: 10px; color: #dc3545; font-weight: bold; font-size: 18px;" 
+                      title="Remove instruction">&times;</span>
+            </div>`
+        ).join('');
+    }
+}
+function updateIngredientsInput() {
+    if (hiddenIngredientsInput) {
+        hiddenIngredientsInput.value = JSON.stringify(selectedIngredients);
+        console.log('Updated hidden ingredients input:', hiddenIngredientsInput.value);
+    }
+}
+function updateInstructionsInput() {
+    if (hiddenInstructionsInput) {
+        hiddenInstructionsInput.value = JSON.stringify(selectedInstructions);
+        console.log('Updated hidden instructions input:', hiddenInstructionsInput.value);
+    }
+}
+function showDropdown(dropdownElement) {
+    if (dropdownElement) {
+        dropdownElement.style.display = 'block';
+    }
+}
+function hideDropdown(dropdownElement) {
+    if (dropdownElement) {
+        dropdownElement.style.display = 'none';
+    }
+    currentFocus = -1;
+}
+function escapeHtml(text) {
+    if (text === null || text === undefined) return '';
+    const div = document.createElement('div');
+    div.textContent = text.toString();
+    return div.innerHTML;
+}
+function escapeRegExp(string) {
+    return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+}
Index: NutriMatch/wwwroot/js/recipe-search.js
===================================================================
--- NutriMatch/wwwroot/js/recipe-search.js	(revision 1bb908bf54f2e3398c19e1688d4a2bca1fec96b6)
+++ NutriMatch/wwwroot/js/recipe-search.js	(revision f2b09ee1157f2f5e93f0bcfb42b366cbb520fdee)
@@ -1,4 +1,5 @@
 
 let selectedIngredients = [];
+let selectedInstructions = [];
 let searchTimeout;
 let currentFocus = -1;
@@ -7,10 +8,15 @@
 const ingredientDropdown = document.getElementById('ingredientDropdown');
 const ingredientsList = document.getElementById('ingredientsList');
-const hiddenInput = document.getElementById('selectedIngredients');
+const hiddenIngredientsInput = document.getElementById('selectedIngredients');
 const addButton = document.getElementById('addIngredientButton');
 const qtyInput = document.getElementById('ingredientQuantity');
 const unitSelect = document.getElementById('ingredientUnit');
+const instructionInput = document.getElementById('instructionInput');
+const addInstructionButton = document.getElementById('addInstructionButton');
+const instructionsList = document.getElementById('instructionsList');
+const hiddenInstructionsInput = document.getElementById('selectedInstructions');
 document.addEventListener('DOMContentLoaded', function() {
     initializeSearchFunctionality();
+    initializeInstructionsFunctionality();
 });
 function initializeSearchFunctionality() {
@@ -58,4 +64,19 @@
         }
     });
+}
+function initializeInstructionsFunctionality() {
+    if (addInstructionButton) {
+        addInstructionButton.addEventListener('click', function() {
+            addInstruction();
+        });
+    }
+    if (instructionInput) {
+        instructionInput.addEventListener('keydown', function(e) {
+            if (e.key === 'Enter') {
+                e.preventDefault();
+                addInstruction();
+            }
+        });
+    }
 }
 async function searchIngredients(query) {
@@ -177,4 +198,25 @@
     updateIngredientsInput();
 }
+function addInstruction() {
+    if (!instructionInput) return;
+    const instruction = instructionInput.value.trim();
+    if (instruction === '') {
+        alert('Please enter an instruction.');
+        return;
+    }
+    if (selectedInstructions.includes(instruction)) {
+        alert('This instruction is already added.');
+        return;
+    }
+    selectedInstructions.push(instruction);
+    updateInstructionsDisplay();
+    updateInstructionsInput();
+    instructionInput.value = '';
+}
+function removeInstruction(instructionIndex) {
+    selectedInstructions.splice(instructionIndex, 1);
+    updateInstructionsDisplay();
+    updateInstructionsInput();
+}
 function updateIngredientsDisplay() {
     if (!ingredientsList) return;
@@ -192,8 +234,31 @@
     }
 }
+function updateInstructionsDisplay() {
+    if (!instructionsList) return;
+    if (selectedInstructions.length === 0) {
+        instructionsList.innerHTML = '<small class="text-muted">Added instructions will appear here</small>';
+    } else {
+        instructionsList.innerHTML = selectedInstructions.map((instruction, index) => 
+            `<div class="instruction-item" style="display: flex; flex-wrap: wrap; align-items: flex-start; background-color: #f8f9fa; padding: 10px; margin: 5px 0; border-radius: 8px; border-left: 4px solid #10b981;">
+                <span class="instruction-number" style="background-color: #10b981; color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; margin-right: 10px; flex-shrink: 0;">${index + 1}</span>
+                <span class="instruction-text" style="flex: 1; min-width: 0; word-wrap: break-word; overflow-wrap: break-word; line-height: 1.4;">
+${escapeHtml(instruction)}</span>
+                <span class="remove" onclick="removeInstruction(${index})" 
+                      style="cursor: pointer; margin-left: 10px; color: #dc3545; font-weight: bold; font-size: 18px;" 
+                      title="Remove instruction">&times;</span>
+            </div>`
+        ).join('');
+    }
+}
 function updateIngredientsInput() {
-    if (hiddenInput) {
-        hiddenInput.value = JSON.stringify(selectedIngredients);
-        console.log('Updated hidden input:', hiddenInput.value);
+    if (hiddenIngredientsInput) {
+        hiddenIngredientsInput.value = JSON.stringify(selectedIngredients);
+        console.log('Updated hidden ingredients input:', hiddenIngredientsInput.value);
+    }
+}
+function updateInstructionsInput() {
+    if (hiddenInstructionsInput) {
+        hiddenInstructionsInput.value = JSON.stringify(selectedInstructions);
+        console.log('Updated hidden instructions input:', hiddenInstructionsInput.value);
     }
 }
