@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600&display=swap');

*{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
    
}

body {
    background: #076585;  
    background: -webkit-linear-gradient(to bottom, #fff, #076585);  
    background: linear-gradient(to bottom, #fff, #076585); 
    background-attachment: fixed;
    background-size: cover; 
    background-repeat: no-repeat;
    min-height: 100vh; 
}

header nav{
    padding: 30px;
    color: #222831;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

header nav h1{
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

header nav form{
    display: flex;
    justify-content: center;
}

form input[type="text"]{
    flex-grow: 1;
    margin-right: 10px;
}

form input[type="text"],button[type="submit"]{
    border: none;
    font-size: 18px;
    padding: 10px;
    border-radius: 4px;
}

form button[type="submit"]{
    background-color: #f44336;
    color: azure;
    cursor: pointer; 
    transition: background-color 0.2s ease-in-out;  
}
form button[type="submit"]:hover{
    background-color: #ff5c5c;
}

/* Main Section */
.recipe-container{
    text-align: center;
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
    grid-gap: 40px;
    width: 80%;
    margin: 10px auto;
    padding: 20px;
    place-items: center;
}
.recipe{
    background-color: white;
    display: flex;
    flex-direction: column;
    color: #363333;
    border-radius: 6px;
    box-shadow: 0 5px 10px rgba(78, 73, 73, 0.1),-5px -5px 10px rgba(34, 34, 34, 0.5);
    max-width: 350px;
}
.recipe img{
    height: 300px;
}
.recipe h3{
    font-size: 20px;
    font-weight: 600;
}
.recipe p{
    
    font-size: 20px;
    font-weight: 500;
}
.recipe span{
    font-weight: 400;
}

.recipe button {background-image: linear-gradient(to right, #232526 0%, #414345  51%, #232526  100%)}
.recipe button {
   margin: 10px;
   padding: 15px 45px;
   text-align: center;
   text-transform: lowercase;
   transition: 0.5s;
   background-size: 200% auto;
   color: white;            
   box-shadow: 0 0 20px #eee;
   border-radius: 10px;
   display: block;
 }

 .recipe button:hover {
   background-position: right center; 
   color: #fff;
   text-decoration: none;
 }

 /* Recipe details */
 .recipe-details {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    background-color: #232526;
    color: #eee;
    transform: translate(-50%, -50%) scale(0.8);
    -webkit-transform: translate(-50%, -50%) scale(0.8);
    border-radius: 16px;
    width: 45%;
    max-width: 500px;
    height: auto;
    max-height: 70%;
    font-size: 18px;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.25);
    opacity: 0; 
}

/* Show popup with animation */
.recipe-details.active {
    display: block;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Close button */
.recipe-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #fff;
    transition: color 0.3s ease-in-out;
}

.recipe-close-btn:hover {
    color: #ff4d4d;
}

/* Smooth scrollbar */
.recipe-details::-webkit-scrollbar {
    width: 6px;
}

.recipe-details::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.recipe-details::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.8);
}


@media screen and(max-width:600px) {
    header nav{
        flex-direction: column;
    }
    
    header nav form{
        width: 80%;
        margin-top: 20px;

    }
}
