/**
 * Header Search Styles
 * Styles for search toggle button and overlay with inline search form
 */

/* Search Toggle Button */
.header-search-toggle {
    background: none;
    border: 1px solid #333;
    cursor: pointer;
    color: #333;
    transition: color 0.2s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    margin-left: 20px;
    width: 35px;
    height: 35px;
}

.header-search-toggle:hover {
    color: #0073aa;
    background-color: rgba(0, 115, 170, 0.1);
}

.header-search-toggle:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Search Overlay */
.header-search-overlay {
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    max-width: 350px;
    background: #fff;
    border: 0;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(-10px);
}

.header-search-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Search Container */
.header-search-container {
    position: relative;
    width: 100%;
    background: transparent;
    border-radius: 8px;
    padding: 0;
    transform: scale(1);
    border: 0;
}

.header-search-overlay.is-open .header-search-container {
    transform: scale(1);
}

/* Search Form */
.header-search-container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header-search-container label {
    position: absolute;
    left: -9999px;
}

/* Search Form Wrapper - Inline Style */
.search-form-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form-wrapper:focus-within {
    outline: none;
}

/* Search Input */
.search-form-wrapper input[type="search"] {
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 16px;
    font-family: inherit;
    width: 100%;
    outline: none;
    color: #333;
}

.search-form-wrapper input[type="search"]::placeholder {
    color: #999;
}

.search-form-wrapper input[type="search"]:focus {
    outline: none;
}

/* Search Submit Button */
.search-form-wrapper .header-search-submit {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.search-form-wrapper .header-search-submit:hover {
    color: #0073aa;
    background-color: rgba(0, 115, 170, 0.1);
}

.search-form-wrapper .header-search-submit:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Close Button */
.header-search-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.header-search-close:hover {
    color: #0073aa;
}

.header-search-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Screen reader text */
.screen-reader-text {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.search-form input.search-field {
    border: 1px solid #ddd;
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
    padding: 2px 10px;
}
.search-form input.search-submit{
    border: 1px solid #ddd;
    background: transparent;
    font-size: 14px;
    padding: 5px 10px;
    line-height: normal;
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
}

/* Responsive Design */
@media(max-width: 1024px) and (min-width: 991px){
    #navbar #menu-main-menu li:last-child a {
        padding: 10px 18px;
        border-radius: 10px;
    }
}
@media (max-width: 992px) {
    .header-search-toggle {
        padding: 4px;
        margin-left: 0;
        width: 26px;
        height: 26px;
        margin-right: 15px;
    }
    .search_reasult_section {
        padding: 0px 0 80px;
    }
    .search_reasult_section .page-header { padding: 0px 0 15px; }
    .header-search-overlay {
        width: 300px;
        right: 0;
    }
    .search-form-wrapper {
        padding: 0;
    }
}
@media (max-width: 768px) {
    .header-search-overlay {
        width: 300px;
        right: -20px;
    }
    
    .header-search-container {
        padding: 0;
    }
    
    .search-form-wrapper input[type="search"] {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .search-form-wrapper .header-search-submit {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .header-search-overlay {
        width: 230px;
        right: 23px;
        top: 37px;
    }
    
    .header-search-container {
        padding: 0;
    }
    
    .search-form-wrapper input[type="search"] {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .search-form-wrapper .header-search-submit {
        width: 33px;
        height: 33px;
    }
}

/* Animation for search icon */
.header-search-toggle svg {
    transition: transform 0.2s ease;
    width: 100%;
    height: 100%;
}

.header-search-toggle:hover svg {
    transform: scale(1.1);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .header-search-toggle:focus {
        outline: 3px solid #000;
        outline-offset: 2px;
    }
    .search-form-wrapper .header-search-submit:focus {
        outline: 3px solid #000;
        outline-offset: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .header-search-overlay,
    .header-search-container,
    .header-search-toggle,
    .header-search-toggle svg,
    .search-form-wrapper,
    .search-form-wrapper .header-search-submit,
    .header-search-close {
        transition: none;
    }
}
