/* styles.css */
html, body {
    height: 100%;
    
    background: url("particles 2.gif");
    background-repeat: no-repeat; /* Prevents gradient repetition */
    background-attachment: fixed; /* Locks gradient to viewport */
    background-size: cover; /* Stretches gradient to cover the screen */
    font-family: Arial, sans-serif;
    color: #ffffff;
    display: grid;
    place-items: center;
}

header {
    background-color: #000;
    color: white;
    width: 100%;
    padding: 1rem 0;
}

.navbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background-color: #000;
    padding: 1rem 0;
}

.logo {
    margin-bottom: 15px; /* Space between logo and links */
}

.navbar-links nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px; /* Space between links */
}

.navbar-links nav ul li a,
.navbar-links nav ul li button {
    color: white;
    text-decoration: underline;
    justify-content: center;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}

.navbar-links nav ul li a:hover,
.navbar-links nav ul li button:hover {
    color: #e1bc05;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin: 0 1rem;
}

nav ul li a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

nav ul li a:hover {
    text-decoration: underline;
    color: #e1bc05;
}

nav ul li button {
    background-color: transparent;
    color: white;
    text-decoration: underline;
    font-weight: bold;
    border: none;
    font-size: 1rem;
}

nav ul li button:hover {
    text-decoration: underline;
    color: #e1bc05;
}

.btn{
    background-color: #e1bc05;
    color: white;
    border: none;
    padding: 10px 20px; /* Adjusted padding for better size */
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s ease;
     /* Space between input and button */
    margin-top: 10px;
    margin-bottom: 10px;
}
.btn:hover{
    background-color: #e1bc05;
}

.slider{
    width: full;
    height: var(--height);
    overflow: hidden;
    mask-image: linear-gradient(
        to right,
        transparent,
        #000 10% 90%,
        transparent
    );
}
.slider .list{
    display: flex;
    width: full;
    min-width: calc(var(--width) * var(--quantity));
    position: relative;
}
.slider .list .item{
    width: var(--width);
    height: var(--height);
    position: absolute;
    left: 100%;
    animation: autoRun 10s linear infinite;
    transition: filter 0.5s;
    animation-delay: calc( (10s / var(--quantity)) * (var(--position) - 1) - 10s)!important;
}
.slider .list .item img{
    width: 100%;
}
@keyframes autoRun{
    from{
        left: 100%;
    }to{
        left: calc(var(--width) * -1);
    }
}
.slider:hover .item{
    animation-play-state: paused!important;
    filter: grayscale(1);
}
.slider .item:hover{
    filter: grayscale(0);
}
.slider[reverse="true"] .item{
    animation: reversePlay 10s linear infinite;
}
@keyframes reversePlay{
    from{
        left: calc(var(--width) * -1);
    }to{
        left: 100%;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h3 {
    margin-bottom: 20px;
    font-size: 2.5em;
}

.text-center {
    text-align: center;
}

.filter-condition {
    display: flex;
    justify-content: flex-end; /* Align all items to the right */
    align-items: center; /* Center items vertically */
    margin-bottom: 20px;
}

#sortButton {

    background-color: #e1bc05;
    color: white;
    border: none;
    padding: 10px 20px; /* Adjusted padding for better size */
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 10px; /* Space between input and button */
    margin-top: 10px;
}


#sortButton:hover {
    background-color: #e1bc05;
}

.dropdown-menu {
    display: none; /* Initially hide dropdown */
    position: absolute;
    background: #333333;
    border: 1px solid #444444;
    z-index: 1000; /* Ensure dropdown appears above other elements */
}

.dropdown-menu.show {
    display: block; /* Show dropdown when active */
}

.dropdown-item {
    padding: 10px;
    color: #ffffff;
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: #444444; /* Change background on hover */
}

.d-flex {
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-control {
    padding: 10px;
    border: 1px solid #ffffff;
    background-color: #333333;
    color: #ffffff;
    width: 100%;
    margin-right: 10px;
}

/* Recipe cards grid */
#showRecipe {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Four columns */
    gap: 20px; /* Space between cards */
    margin-top: 20px;
}

.card {
    background: #222222;
    border: 1px solid #444444;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* Use flexbox for vertical alignment */
    flex-direction: column; /* Stack children vertically */
    height: 350px; /* Set a fixed height for all cards */
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Initial subtle shadow */
}

.card img {
    width: 100%;
    height: 200px; /* Set a fixed height for the image */
    object-fit: cover; /* Ensure the image covers the space */
    border-radius: 10px 10px 0 0; /* Rounded top corners */
}

.card-body {
    padding: 15px;
    display: flex;
    flex-direction: column; /* Stack text vertically */
    justify-content: space-between; /* Space between elements */
    background-color: #000; /* Background color of the card */
}

.card h6 {
    margin: 10px 0;
    font-size: 1.1em;
}

/* Hover effect to add glowing effect */
.card:hover {
    transform: scale(1.05); /* Slightly enlarge the card */
    box-shadow: 0 0 20px 5px rgba(255, 187, 0, 0.318); /* Glowing effect */
    z-index: 10; /* Ensure the card appears on top */
}

/* Ingredients Tooltip */
.ingredients {
    position: relative; /* Required for positioning the tooltip */
    cursor: pointer; /* Change cursor to pointer */
}

/* Pop-up card for ingredients */
.pop-up-card {
    display: none; /* Initially hidden */
    position: absolute;
    bottom: 100%; /* Position above the element */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(51, 51, 51, 0.9); /* Semi-transparent background */
    color: #ffffff;
    padding: 10px;
    border-radius: 4px;
    z-index: 10; /* Ensure the pop-up appears above other elements */
    width: 200px; /* Set a width for the pop-up card */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    opacity: 0; /* Initially hidden with 0 opacity */
    visibility: hidden; /* Initially hidden */
    transition: opacity 0.3s ease, visibility 0s 0.3s; /* Smooth fade-in effect */
}

.ingredients-preview {
    position: relative;
}

.ingredients-count {
    cursor: help;
    transition: color 0.3s ease;
}

.ingredients-count:hover {
    color: #e1bc05;
}

.ingredients-hover-preview {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.9);
    border: 1px solid #444;
    border-radius: 8px;
    z-index: 10;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ingredients-preview:hover .ingredients-hover-preview {
    display: block;
}

.ingredients-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.ingredients-list li {
    padding: 5px 0;
    border-bottom: 1px solid #333;
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.tippy-box[data-theme~="light-border"] {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9rem;
    padding: 10px;
    text-align: left;
}


.tippy-content {
    text-align: left;
}



#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    z-index: 9999; /* Increased z-index for maximum coverage */
    opacity: 1;
    transition: opacity 1s ease-out, 
               transform 1s ease-out, 
               visibility 1s;
    will-change: opacity, transform; /* Performance optimization */
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateZ(50px);
}

/* Optional: Add a subtle animation to make the fade-out more engaging */
@keyframes loaderPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#loader .loader-content {
    animation: loaderPulse 1.5s ease-in-out infinite;
}

        /* Center the surprise recipe content */
        #recipeContainer {
            display: none; /* Initially hidden */
            position: fixed;
            top: 50%;
            left: 100%;
            transform: translate(-50%, -50%);
            background-color: rgba(0, 0, 0, 0.7);
            padding: 20px;
            border-radius: 10px;
            color: white;
            text-align: center;
            z-index: 1000;
            width: 80%;
            max-width: 400px;
        }
        #recipeContainer h4 {
            margin-bottom: 15px;
        }
        #recipeContainer p {
            font-size: 1.2rem;
        }
        .hidden {
            display: none;
        }
        /* Style for the loader */
        #loader {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

