
body{
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--color1);
} 
:root{
    --color1: white;
    --color2: rgb(255, 255, 255,0.9); 
    --color3: rgb(255, 255, 255,0.95); 
    --color4: rgb(0, 33, 70);
    --color5: black;
    --color6: rgb(226, 224, 224);
    --color7: gray;
    --color8: red;
    --background: url('https://images.unsplash.com/photo-1490818387583-1baba5e638af?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1032&q=80');
}
/* This class is called when we click on toggle button and change the colors */
.dark{
    --color1: rgb(0, 0, 0);
    --color2: rgba(22, 22, 22, 0.9); 
    --color3: rgba(15, 15, 15, 0.95); 
    --color4: white;
    --color5: white;
    --color6: rgb(37, 37, 37);
    --color7: rgb(27, 27, 27);
    --color8: rgb(106,119,72);
    --background: url('https://images.unsplash.com/photo-1534604973900-c43ab4c2e0ab?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1088&q=80');
}
/* This are navbar properties */
#nav{
    display: flex;
    justify-content: space-around;
    background:var(--color1);
    color: var(--color4);
    height: 60px;
    align-items: center;
    background-color: var(--color1);
}
#title{
    padding: 0px 0px 0px 20px;
    font-size: 20px;

}

/* This id container-1 contains all the properties belongs to search, fetching data and displaying them */
#container-1{
    display: flex;
    height: 84vh;
}

.search{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: top;
    height: 100%;
    width: 75%;
    position: relative;
    background-color: var(--color1);
    
}
.search:focus{
    outline: none;
}
#searchInput{
    height: 50px;
    width: 80%;
    margin-top: 5%;
    background-color: var(--color2);
    border-radius: 25px;
    border-style: none;
    font-size: 20px;
    text-align: center;
    outline: none;
    color: var(--color4);
    

}

#background{
    background-size: cover;
    background-image: var(--background)
}

#searchResults {
    display: grid;
    text-align: center;
    grid-template-columns: repeat(4,1fr);
    grid-gap: 20px;
    overflow: scroll;
    height: 79%;
    margin: 1%;
    border-radius: 5px;
  }
  
  /* This are card properties which are appended from javascript */
  .card {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: black;
    margin: 15px 10px 0px 10px;
    background-color:var(--color2);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
    transition: ease-out 0.3s;
  }
  
  .card img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
  }
  
  .card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--color4);
  }
  
  .card button {
    display: flex;  
    padding: 8px 16px;
    background-color: var(--color4);
    color: var(--color1);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 1%;
    font-weight: 600;
  }
  
  .card button:hover {
    background-color: rgb(58, 98, 206);
    color:white;
    
  }
  .card:hover{
    transform: scale(1.1);
    transition: ease-in 0.3s;
  }
  ::-webkit-scrollbar {
    display: none;
}

/* This are cardDetails properties which are used to display the meal details */
.cardDetails{
    border: 2px solid var(--color1);
    position: absolute;
    top: 14%;
    left: 1.3%;
    height: 70vh;
    overflow: auto;
    width: 97%;
    color: var(--color4);
    border-radius: 1%;
    text-align: center;
    background-color: var(--color3);
}
.cardDetails img{
    width: 200px;
}

.cardDetails button{
    color: red;
    margin-left: 26%;
    border-radius: 5px;
    cursor: pointer;
    position: fixed;
    background-color: white;
}
.cardDetails button:hover{
    background-color: rgb(255, 0, 0);
    color: white;
}

/* This are the properties which are used display the favourite items */
/* Favourite items container */
#favourite-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24%;
    margin-right: 1%;
    padding: 10px;
    color: var(--color4);
    background-color: var(--color1);
    border: 1px solid rgb(255, 255, 255);
    box-shadow: 0px 2px 4px var(--color5);
    border-radius: 12px;
}

#fav-title {
    font-size: 24px;
    font-style: italic;
    color: var(--color8);
    text-decoration: underline;
    margin-bottom: 15px;
}

/* Card */
.fav-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin: 8px 0;
    border-radius: 15px;
    background-color: var(--color6);
    box-shadow: 0px 4px 6px var(--color7);
    width: 100%;
}

.fav-card img {
    width: 100px;
    height: 100px;
    border-radius: 15px 0 0 15px;
    object-fit: cover;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color4);
    flex: 1;
}

/* Buttons inside card */
.fav-card button {
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.favdetails {
    background-color: rgb(58, 98, 206);
    color: white;
}
.favdetails:hover {
    background-color: rgb(0, 33, 70);
}

.favremove {
    background-color: rgb(255, 5, 5);
    color: white;
}
.favremove:hover {
    background-color: rgb(121, 0, 0);
}

/* Scrollable section */
#fav-container {
    overflow-y: auto;
    margin-top: 10%;
    padding: 10px;
    border-radius: 0 0 0 25px;
}

/* Responsive design */
@media (max-width: 768px) {
    #favourite-container {
        width: 90%;
        margin: auto;
    }
    .fav-card {
        flex-direction: column;
        text-align: center;
    }
    .fav-card img {
        border-radius: 12px;
        width: 80px;
        height: 80px;
    }
}


/* These are the style properties to switch between dark and light modes with the toggle button */

.toggle-container {
    padding: 50px;
    align-items: center;
    text-align: center;
    max-height: 100px;
  }
  
  .toggle-input {
    display: none;
  }
  
  .toggle-label {
    display: inline-block;
    position:absolute;
    margin-top:10%;
    width: 60px;
    height: 30px;
    border-radius: 20px;
    background-color: var(--color4);
    position: relative;
    cursor: pointer;
  }
  
  .toggle-label:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: white;
    transition: transform 0.2s ease;
  }
  /* These two classes will transform the button when the checkbox is checked */
  .toggle-input:checked + .toggle-label {
    background-color: var(--color4);
  }
  
  .toggle-input:checked + .toggle-label:before {
    transform: translateX(30px);
    background-color: var(--color1)
  }
  /* These properties is used to style the names of modes */
  #mode-name {
    position: absolute;
    display: inline-block;
    font-weight: bold;
    font-size: 20px;
    color: var(--color4);
    padding: 5px;
  }

  /* This properties are used to make the app responsive in small devices */
  @media (max-width: 768px) {
    #container-1 {
        flex-direction: column;
    }
    
    .search {
        width: 100%;     
    }
    
    #searchInput {
        width: 90%;
    }
    
    #searchResults {
        grid-template-columns: repeat(2, 1fr);
    }
    .cardDetails button{
        position: relative;
    }
    
    #favourite-container {
        width: 100%;
        margin-right: 0;
        margin-top: 20px;
    }
    
    .fav-card {
        width: 70%;
        margin: 5%;
        display: flex;
        text-align: center;
        align-items: center;
        justify-content: center;
        flex-direction: row;
    }
    
    #fav-container {
        margin-top: 0;
        display: grid;
        grid-template-columns: repeat(2,1fr);
        grid-gap: 20px;
        text-align: center;
        overflow: scroll;
        height: 50vh;
        margin-top: 4%;
    }
    
    .fav-card img {
        width: 100px;
        height: 100px;
        border-radius: 10px;
    }
    
    .fav-card button {
        height: 25px;
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .favdetails {
        margin-left: 0;
        margin-top: 0;
        position: relative;
    }
    
    .favremove {
        margin-left: 0;
        margin-top: 0;
        position: relative;
    }
}

@media (max-width: 480px) {
    #searchResults {
        grid-template-columns: 1fr;
    }
}
