*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

.loading {
    text-align: center;
    font-size: 24px;
    padding: 20px;
    display: none;
}

.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    color: black;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}
body{
    background-color: white;
    color: aliceblue;
    margin: 0;
    padding-top: 80px;
}


header nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: orange;
  color: black;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  border-radius: 2px;
  text-shadow: 1px 1px 2px black;
  z-index: 1000;
  margin-top: 0;
}

header nav h1{
    font-weight: 730;
    font-size: 30px;
    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: 22px;
    padding: 10px;
    border-radius: 5px;
}
form button[type=submit]{
    background-color: rgb(232, 35, 35);
    color: rgb(253, 251, 251);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}
form button[type=submit]:hover{
    background-color: rgb(255, 0, 0);
}

/* details of the recipe */
.recipeDetails{
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    background-color: white;
    color: black;
    border-radius: 10px;
    width: 90vw;
    max-width: 500px;
    height: 80vh;
    max-height: 600px;
    font-size: 1rem;
    transition: all 0.6s ease-in-out;
    overflow-y: auto;
}

/* Main Container */

.recipe-container{
    text-align: center;
    margin-top: 20px;
    margin:10px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    width: 95vw;
    max-width: 1200px;
    padding: 16px;
    place-items: center;
}

.recipe{
    background-color: white;
    display: flex;
    flex-direction: column;
    color: black;
    border-radius: 5px;
    box-shadow: 0 6px rgba(77, 64, 64, 0.792), 0 8px 20px rgba(0, 0, 0, 0.19);
    cursor: pointer;
    width: 100%;
    max-width: 350px;
    min-width: 220px;
    transition: transform 0.3s ease-in-out;
}
.recipe:hover{
    transform: scale(1.02);
}

.recipe img{
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
}

.recipe h3{
    font-size: 24px;
    margin-block: 4px;
}
.recipe p{
    font-size: 20px;
    color: rgb(17, 16, 17);
    margin: 5px 0;
}
.recipe span{
    font-weight: 600;
}

.recipe button{
    font-size: 20px;
    padding: 10px;
    font-weight: 600;
    border: 5px solid rgb(247, 12, 8);
    margin: 10px auto;
    background-color: orange;
    cursor: pointer;
    color: aliceblue;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease-in-out;
}

.recipe button:hover{
    background-color: rgb(71, 248, 58);
    color: rgb(10, 6, 6);
}
.recipeDetailsContent{
    margin-top: 50px; 

    padding: 30px;
}
.recipeName{
    text-align: center;
    text-decoration: underline;
    text-transform: uppercase;
}
.ingredientsList li{
    margin-top: 12px;
    margin-left: 20px;
}
.recipeInstructions{
    line-height: 30px;
    white-space: pre-line;
}

.closeButton{
    border: none;
    position: absolute;
    top: 15px;
    right: 10px;
    font-size: 18px;
    padding: 8px;
    border-radius: 4px;
    background-color: rgb(12, 12, 12);
    color: black;
    width: 40px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.recipeName ,.ingredientsList, .recipeInstructions{
    margin-bottom: 20px;
}

.voice-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.voice-button {
    background-color: orange;
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.voice-button:hover {
    background-color: rgb(60, 210, 48);
    transform: scale(1.05);
}

.voice-button:last-child {
    background-color: orange;
    color: white;
}

.voice-button:last-child:hover {
    background-color: rgb(220, 50, 50);
}

/* adding scroll bar  */

.recipeDetails::-webkit-scrollbar{
    width: 10px;
}
.recipeDetails::-webkit-scrollbar-thumb{
    background-color: orange;
    --webkit-border-radius: 10px;
}

.body::-webkit-scrollbar{
    width: 15px;
}
.body::-webkit-scrollbar-thumb{
    background-color: orange;
}

.body::-webkit-scrollbar-track{
    background-color: antiquewhite;
}

/* footer {
    position: relative;
    left: 0;
    bottom: 0;
    width: 100vw;
    background: orange;
    color: black;
    text-align: center;
    padding: 10px 0;
    font-size: 1.1rem;
    letter-spacing: 1px;
    box-shadow: 0 -2px 12px rgba(26,107,228,0.15);
    z-index: 10;
    margin-top: auto;
}

.footer-content span {
    font-weight: 600;
    font-family: 'Segoe UI', sans-serif;
    display: inline-block;
    vertical-align: middle;
} */
#contact a {
    color: orange;
    text-decoration: none;
    font-weight: 500;
}

@media screen and (max-width: 630px) {
    header nav{
        flex-direction: column;
        align-items: center;
        padding: 12px;
    }
    header nav form{
        width: 100%;
        margin-top: 12px;
    }
    form {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }
    form input[type=text] {
        flex: 1;
        margin-right: 8px;
        font-size: 16px;
        padding: 10px;
        min-width: 0;
    }
    form button[type=submit] {
        font-size: 16px;
        padding: 10px;
        width: auto;
    }
    header nav h1 {
        font-size: 24px;
    }
    .recipe-container h2 {
        font-size: 18px;
    }
    .recipeDetails {
        width: 98vw;
        max-width: 98vw;
        height: 90vh;
        max-height: 90vh;
        font-size: 0.95rem;
        padding: 8px;
    }
    .recipe {
        min-width: 160px;
        max-width: 98vw;
    }
    .recipe img {
        max-height: 140px;
    }
    .closeButton {
    position: fixed;
    top: 80px;
    right: 10px;
    z-index: 2000;
    background-color: rgb(18, 18, 18);
    color: black;
    width: 40px;
    height: 35px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
}

@media screen and (max-width: 400px) {
    header nav h1 {
        font-size: 16px;
    }
    .recipe-container h2 {
        font-size: 14px;
    }
    form input[type=text] {
        font-size: 14px;
        padding: 8px;
    }
    form button[type=submit] {
        font-size: 14px;
        padding: 8px;
    }
    .recipeDetails {
        font-size: 0.85rem;
        padding: 4px;
    }
    .recipe {
        min-width: 120px;
        max-width: 98vw;
    }
    .recipe img {
        max-height: 160px;
    }
}
/* Tablet breakpoint */
@media screen and (min-width: 631px) and (max-width: 900px) {
    .recipe-container {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 18px;
        width: 95vw;
        padding: 10px;
    }
    .recipe {
        max-width: 260px;
    }
    .recipe img {
        max-height: 180px;
    }
    .recipeDetails {
        width: 80vw;
        max-width: 400px;
        height: 70vh;
        max-height: 400px;
        font-size: 0.95rem;
    }
}
/* Large desktop breakpoint */
@media screen and (min-width: 1200px) {
    .recipe-container {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 32px;
        width: 80vw;
        max-width: 1400px;
        padding: 32px;
    }
    .recipe {
        max-width: 400px;
    }
    .recipe img {
        max-height: 320px;
    }
    .recipeDetails {
        width: 40vw;
        max-width: 600px;
        height: 60vh;
        max-height: 600px;
        font-size: 1.1rem;
    }
}