@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800;900&display=swap');

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

:root {
    --dark-bg: #121212;
    --dark-gray: #1e1e1e;
    --accent-color: #ff6e00;
    --accent-color-dark: #d55a00;
    --text-color: #e0e0e0;
    --highlight-color: #ff9800;
}

body {
    background: url(bg.jpg);
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.6;
    background-color: var(--dark-bg);
    color: var(--text-color);
}

header{
    
    color: #fff;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.header-container {
    display: flex;
    align-items: center;
    padding-left: 1rem;
  }
  
.header-icon {
    font-size: 3rem; /* Larger icon size for prominence */
    color: #f8f6f4; /* Light color for the icon to stand out */
    margin-right: 0.5rem; /* Space between icon and title */
  }
  
.header-title {
    font-size: 3rem; /* Larger font size for the title */
    font-weight: 700; /* Bold text for prominence */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* Optional shadow for better visibility */
  }


body::before { /* to make the bg transparent*/
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Adjust the opacity value here */
    z-index: -1;
    pointer-events: none;
}

.container {
    min-height: 100vh;
    padding: 2rem;
}

.meal-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--dark-gray);
    border-radius: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}
.meal-search{
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* Horizontally center the content */
    justify-content: center; /* Vertically center the content */
}
.title {
    display: flex;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--highlight-color);
}

.meal-search {
    margin: 2rem 0;
}

.meal-search cite {
    font-size: 1rem;
    color: var(--text-color);
}

.meal-search-box {
    margin: 1.2rem 0;
    display: flex;
    align-items: stretch;
}

.search-control,
.search-btn {
    width: 100%;
}

.search-control {
    padding: 0 1rem;
    font-size: 1.1rem;
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    background: var(--dark-gray);
    border-top-left-radius: 2rem;
    border-bottom-left-radius: 2rem;
}

.search-control::placeholder {
    color: var(--text-color);
}

.search-btn {
    width: 55px;
    height: 55px;
    font-size: 1.8rem;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-top-right-radius: 2rem;
    border-bottom-right-radius: 2rem;
    transition: background 0.4s;
}

.search-btn:hover {
    background: var(--accent-color-dark);
}

.meal-result {
    margin-top: 4rem;
}

#meal {
    margin: 2.4rem 0;
}

.meal-item {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin: 2rem 0;
    background: var(--dark-gray);
}

.meal-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.meal-name {
    padding: 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.meal-name h3 {
    font-size: 1.4rem;
    color: var(--highlight-color);
}

.recipe-btn {
    text-decoration: none;
    color: #fff;
    background: var(--accent-color);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.75rem 0;
    display: block;
    width: 175px;
    margin: 1rem auto;
    text-align: center;
    border-radius: 2rem;
    transition: all 0.4s linear;
    /*transition: background 0.4s;*/
}

.recipe-btn:hover {
    background: var(--tenne-tawny-dark);
}

.meal-details {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: var(--dark-gray);
    border-radius: 1rem;
    width: 90%;
    height: auto;
    overflow-y: auto;
    display: none;
    padding: 2rem 1rem;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 21px -12px rgba(0, 0, 0, 0.79);
    
}
.meal-details-content {
    text-align: center; /* Center text alignment */
    margin: 0 auto; /* Center the content horizontally */
}
.recipe-title {
    font-size: 2rem; /* Adjust font size for prominence */
    font-weight: 700; /* Bold text for prominence */
    margin-bottom: 1rem;
}

.recipe-category {
    background: #fff;
    font-weight: 600;
    color: var(--tenne-tawny);
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    margin-bottom: 1rem;
}
.recipe-instruct {
    padding: 1rem 0;
  }
  
  .recipe-meal-img img {
    width: 200px; /* Adjust width for visibility */
    height: auto; /* Maintain aspect ratio */
    border-radius: 1rem; /* Rounded corners for the image */
    margin: 1rem auto; /* Center image horizontally with margin */
    display: block; /* Ensure image is a block-level element */
  }
  
.recipe-link a {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.4s linear;
}
  
.recipe-link a:hover {
    opacity: 0.8;
}
  
.recipe-close-btn {
    position: absolute;
    right: 2rem;
    top: 2rem;
    font-size: 1.8rem;
    background: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

.meal-details::-webkit-scrollbar {
    width: 10px;
}

.meal-details::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

.showRecipe {
    display: block;
}

.meal-details-content {
    margin: 2rem;
}

.recipe-close-btn {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.8rem;
    background: var(--dark-gray);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    cursor: pointer;
}

.recipe-title {
    letter-spacing: 1px;
    padding-bottom: 1rem;
    color: var(--highlight-color);
}

.recipe-category {
    background: #fff;
    font-weight: 600;
    color: var(--accent-color);
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
}

.recipe-instruct {
    padding: 1rem 0;
}

.recipe-meal-img img {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    margin: 0 auto;
    display: block;
}

.recipe-link {
    margin: 1.4rem 0;
}

.recipe-link a {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    transition: opacity 0.4s;
}

.recipe-link a:hover {
    opacity: 0.8;
}

.notFound {
    color: var(--accent-color);
    font-size: 1.8rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
}
.meal-result{
    display:none;
}
.showResults {
    display: block;
}
.footer{
    background: rgb(41, 39, 39);
    max-width: 2000px;
    text-align: center;
    
    padding: 0.5rem 0;
    position: relative;
    bottom: 0;
    width: 100%;
}
.footer p {
    margin-bottom: 1rem;
}

/* Media Queries */
@media screen and (min-width: 600px) {
    .meal-search-box {
        width: 540px;
        margin: auto;
    }
}

@media screen and (min-width: 768px) {
    #meal {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media screen and (min-width: 992px) {
    #meal {
        grid-template-columns: repeat(3, 1fr);
    }
}
