/* 
 * Service Search Styles
 * Animated service search with suggestions
 */

/* Search Container */
.search-container {
    position: relative;
    margin: 25px 0;
    z-index: 101;
    max-width: 500px;
}

/* Service Search */
.service-search {
    display: flex;
    align-items: center;
    background-color: var(--white);
    padding: 5px 5px 5px 20px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.service-search:focus-within {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border: 1px solid rgba(128, 0, 128, 0.2);
}

.service-search i.fa-search {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 10px;
}

.service-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 1rem;
    color: var(--dark-color);
    font-family: var(--body-font);
}

.service-search input::placeholder {
    color: var(--grey);
    opacity: 0.7;
}

/* Search Button */
.search-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--white);
    transition: all 0.3s ease;
}

.search-btn:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

.search-btn i {
    font-size: 1rem;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background-color: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 0;
}

.search-suggestions.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: 300px;
    padding: 10px 0;
}

/* Suggestion Item */
.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background-color: rgba(128, 0, 128, 0.05);
}

.suggestion-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 10px;
    width: 30px;
    text-align: center;
}

.suggestion-item span {
    color: var(--dark-color);
}

.suggestion-item:hover span {
    color: var(--primary-color);
    font-weight: 500;
}

/* Loading Animation */
@keyframes typing {
    0% {
        width: 0;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}

.service-search.loading::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50px;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    animation: typing 1.5s ease infinite;
}

/* Highlight Matched Text */
.highlight {
    color: var(--primary-color);
    font-weight: 500;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .search-container {
        max-width: 100%;
    }
    
    .service-search {
        padding: 3px 3px 3px 15px;
    }
    
    .service-search input {
        padding: 10px 0;
        font-size: 0.9rem;
    }
    
    .search-btn {
        width: 36px;
        height: 36px;
    }
}
