/* Overall body and background styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0 0 100px; /* Ensure bottom padding for visibility */
    background-color: #f4f7f6;
}

/* Styling for the lab search section */
.labmaster-search-container {
    max-width: 1200px;
    padding: 20px;
    margin: 40px auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Search heading */
.search-heading {
    font-size: 24px;
    font-weight: 600;
    color: #00448A;
    margin-bottom: 20px;
    position: relative;
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically center the icon and text */
    gap: 10px; /* Add spacing between icon and text */
}

/* Style the FontAwesome icon */
.search-heading .fa-flask-vial {
    font-size: 20px; /* Slightly larger than the text */
    color: #00448A; /* Match the heading color */
}


/* Search input and buttons wrapper */
.search-input-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}


/* Search input container */
#labmaster-search-input {
    position: relative;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping for mobile layout */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin-bottom: 20px;
    gap: 10px; /* Add gap between elements */
}

/* Styling for the input field */
.search-input input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    width: 100%; /* Full width on mobile */
    margin-bottom: 0;
}

/* Styling for the search button */
.search-input .search-button {
    background-color: #00448A; 
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 24px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    flex: 1; /* Allow buttons to share space equally */
}

.search-input .search-button:hover {
    background-color: #0056b3;
}

/* Styling for the All Tests button */
.search-input #all-tests-button {
    background-color: #2e0150; /* Purple color for All Tests button */
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 24px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    flex: 1; /* Allow buttons to share space equally */
}

.search-input #all-tests-button:hover {
    background-color: #0d0017; /* Darker purple on hover */
}

/* Styling for the search dropdown */
.ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    list-style-type: none;
    padding: 0;
    margin: 0;
    width: 100%; /* Match the width of the search input */
    max-width: 1100px; /* Limit the maximum width */
    box-sizing: border-box;
    position: absolute;
    top: 100%;
    left: 0;
}

.ui-autocomplete .ui-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Prevent text from wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for overflow text */
}

.ui-autocomplete .ui-menu-item:hover {
    background-color: #f9f9f9;
}

/* 3-column layout for search results */
.labmaster-results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Space between cards */
    margin-top: 20px;
}

/* Styling for each result item */
.labmaster-result-item {
    flex: 1 1 calc(33.33% - 20px); /* Three cards per row with gap */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column; /* Ensure content stretches vertically */
}

.labmaster-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Styling for the table inside each result item */
.labmaster-result-item table {
    flex-grow: 1; /* Make the table take up remaining space */
    width: 100%;
    border-collapse: collapse;
}

.labmaster-result-item th,
.labmaster-result-item td {
    border: 1px solid #eee;
    padding: 12px;
    text-align: left;
}

.labmaster-result-item th {
    background-color: #f9f9f9;
    font-weight: bold;
}

.labmaster-result-item td i {
    margin-right: 8px;
    color: #00448A;
}

/* Buy button styling */
.buy-button {
    display: inline-block;
    margin-top: 15px;
    padding: 6px 24px;
    background-color: #00448A;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.buy-button:hover {
    background-color: #00448A;
}

/* Show More button styling */
.show-more-container {
    text-align: center;
    margin-top: 30px;
}

#show-more-button {
    background-color: #2e0150;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

#show-more-button:hover {
    background-color: #0d0017;
}






.labmaster-result-item button {
    background-color: #00448A;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.labmaster-result-item button:hover {
    background-color: #0056b3;
}




/* Single column layout for search results */
.labmaster-results-grid.single-column {
    display: block; /* Change from flex to block */
}

.labmaster-results-grid.single-column .labmaster-result-item {
    flex: 1 1 100%; /* Full width for single column */
    margin-bottom: 20px; /* Add spacing between items */
}



/* Default 3-column layout */
.labmaster-results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.labmaster-result-item {
    flex: 1 1 calc(33.33% - 20px); /* Three cards per row with gap */
}


/* Search button */
#labmaster-search-btn {
    background-color: #00448A;
    color: #fff;
    margin-top: 5px;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
}

#labmaster-search-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* All Tests button */
#all-tests-button {
    background-color: #2e0150;
    color: #fff;
    margin-top: 5px;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
}

#all-tests-button:hover {
    background-color: #0d0017;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}





/* Responsive design adjustments */
@media screen and (max-width: 768px) {
    .labmaster-results-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .labmaster-search {
        padding: 20px;
    }

    .labmaster-result-item {
        flex: 1 1 100%; /* Full width for mobile */
    }

    .search-input {
        flex-direction: column; /* Stack elements vertically on mobile */
        gap: 10px; /* Add space between elements */
    }

    .search-input input {
        width: 100%; /* Full width for mobile */
        margin-bottom: 0; /* Remove margin */
        border-radius: 8px; /* Reset border radius */
    }

    .search-input .search-button,
    .search-input #all-tests-button {
        width: 100%; /* Full width for buttons on mobile */
        padding: 12px 24px; /* Adjust padding for smaller screens */
        margin-left: 0; /* Remove margin between buttons */
        border-radius: 8px; /* Reset border radius */
    }

    /* Show More button adjustments for mobile */
    #show-more-button {
        width: 100%; /* Full width for mobile */
        padding: 12px 24px; /* Adjust padding for smaller screens */
    }

    .ui-autocomplete {
        max-width: 85%; /* Full width on mobile */
        left: 0; /* Align with the input */
        right: 0; /* Ensure it doesn't overflow */
    }
}