/* SEARCH BAR STYLING START */

.search-container {
    padding: 10px;
    display: flex;
    align-items: center;
    position: absolute;
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Offset by 50% of its own width to truly center */
    z-index: 999;
}

#searchForm {
    display: flex;
    align-items: center;
    width: 250px;
    height: 42px;
    border-radius: 20px;
    overflow: hidden; /* Ensures the rounded corners are fully applied */
    border: 1px solid var(--lokala-green);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box; /* Border-box model */
    transition: width 0.5s cubic-bezier(.3,.97,.65,.98), transform 0.2s ease-in-out; /* Custom cubic-bezier transition */
}

#searchForm:focus-within {
    width: 500px;
}

#searchInput {
    flex: 1;
    box-sizing: border-box; /* Border-box model */
    padding: 12px; /* Adjust padding for better visual appearance */
    border: none; /* Remove default border */
    font-size: 14px;
    outline: none;
    margin-bottom: 0px;
}

#searchInput::placeholder {
    color: #999;
}

#searchButton {
    width: 37px;
    height: 37px;
    margin-right: 2px;
    background-color: var(--lokala-green-transparent-70);  /*Transparent lokala green */
    border: none; /* Remove default border */
    border-radius: 50%; /* Make the button round */
    cursor: pointer; /* Change cursor on hover */
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease; /* Smooth hover transition */
}

#searchButton:hover {
    background-color: var(--lokala-orange); /* Darker background color on hover */
}

#searchButton i.material-symbols-outlined {
    font-size: 19px; /* Icon size */
    color: var(--lokala-white) !important;
    width: 100%;
    height: auto;
}


/* SEARCH RESULTS STYLING START */

#searchResults {
    position: absolute;
    left: 25%;
    right: 25%;
    margin-top: 64px;
    width: 50%; /* Take up full width */
    max-height: 75vh; /* Limit the result height */
    overflow-y: auto; /*overflow content scrollable */
    background-color: var(--lokala-white);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Optional: Add shadow for depth */
    z-index: 1999; /* Ensure results appear above other content */
    border-radius: 0 0 var(--lokala-border-radius) var(--lokala-border-radius);
}

#searchResults div {
    padding: 10px;
    color: var(--lokala-text-color-dark) !important;
    cursor: pointer;
}

#searchResults div:hover {
    background-color: var(--lokala-gray);
}

.result-item {
    display: flex;
    align-items: center;
    text-decoration: none; /* Remove underline from link */
}

.result-image {
    width: 20%; /* Adjust size as needed */
    height: 70px; /* Adjust size as needed */
    object-fit: cover; /* Ensure image maintains aspect ratio */
    border-radius: var(--lokala-border-radius);
}

.result-content {
    width: 80%;
    display: flex;
    flex-direction: column;
    text-align: start !important;
    padding-left: 20px !important;
}

#searchResults h1 {
    font-size: 18px;
}

#searchResults h1, #searchResults h2, .search-result-p {
    margin: 0!important;
    padding: 0!important;
}

.search-result-p {
    line-height: 20px;
}


#searchResults h2 {
    color: var(--lokala-green-transparent-70);
    font-size: 16px;
    padding-top: 7px !important;
}


.no-results {
    padding: 15px !important;
    margin-block-start: 0;
    margin-block-end: 0;
    color: var(--lokala-text-color-dark);
}

.result-divider {
    display: block;
    height: 2px;
    background: var(--lokala-gray);
    margin: 2px 0;
}

@media (max-width: 800px) {
    #searchResults {
        position: absolute;
        left: 5%;
        right: 5%;
        justify-content: center;
        width: 90%; /* Take up full width */
    }
}

/* Change search bar focus-within width START*/
@media (max-width: 950px){
    #searchForm:focus-within {
        width: 400px;
    }
}

@media (max-width: 700px){
    #searchForm:focus-within {
        width: 350px;
    }
}

@media (max-width: 440px){
    #searchForm {
        width: 160px;
    }

    #searchForm:focus-within {
        width: 200px;
    }
}
/* Change search bar focus-within width END*/

@media (min-width: 1300px) {

    .result-image {
        width: 20%;
        height: 100px;
    }

    .result-content {
        width: 80%;
        display: flex;
        flex-direction: column;
    }

}


/* SEARCH RESULTS STYLING END */
