/**
 * Plugin: IPO Watch Auto-Suggest Search
 * File: ipo-autocomplete.css
 * * FINAL CSS: Purely for styling (JS handles tricky positioning).
 */

/* -------------------------------------------------------- */
/* 1. SHORTCODE SEARCH BAR STYLING (Google Look) */
/* -------------------------------------------------------- */

.ipo-autosuggest-wrapper {
    max-width: 650px; 
    margin: 30px auto; 
    position: relative; /* Keep relative for anchoring width */
    z-index: 10000;
}

.ipo-autosuggest-wrapper .search-form {
    display: flex;
    align-items: center;
    width: 100%;
    height: 56px; 
    border-radius: 28px; 
    background-color: #fff;
    box-shadow: 0 1px 6px 0 rgba(32,33,36,0.28); 
    transition: all 0.3s ease;
}

.ipo-autosuggest-wrapper .search-form:hover {
    box-shadow: 0 1px 6px 0 rgba(32,33,36,0.28), 0 3px 10px 0 rgba(32,33,36,0.18); 
}

/* Style the search input field */
.ipo-autosuggest-wrapper #shortcode-search-field {
    flex-grow: 1; 
    height: 100%;
    padding: 0 20px; 
    border: none !important;
    outline: none !important;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: var(--ast-global-color-2, #1e293b);
}

.ipo-autosuggest-wrapper .search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 100%;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

.ipo-autosuggest-wrapper .search-submit .ast-icon svg {
    fill: #4285f4; 
    width: 20px;
    height: 20px;
}

/* -------------------------------------------------------- */
/* 2. REFINED AUTO-SUGGEST DROPDOWN STYLING */
/* -------------------------------------------------------- */

/* The main dropdown container (UL element) */
.ipo-autosuggest-wrapper .ui-autocomplete {
    /* **CRITICAL**: Removed position/top/margin rules—they are now set by JavaScript. */
    left: 1px !important; 
    width: calc(100% - 2px) !important; 
    
    padding: 8px 0;
    list-style: none;
    background-color: #fff;
    border: none !important; 
    box-shadow: 0 4px 6px 0 rgba(32,33,36,0.1), 0 1px 3px 0 rgba(32,33,36,0.05); 
    max-height: 300px;
    overflow-y: auto;
    border-radius: 4px;
}

/* Individual item styles (for clean appearance) */
.ui-autocomplete .ui-menu-item {
    cursor: pointer;
    margin: 0 !important; 
    padding: 0 !important; 
    list-style-type: none !important; 
}

.ui-autocomplete .ui-menu-item div {
    display: block !important;
    padding: 10px 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px; 
    line-height: 1.4;
    color: var(--ast-global-color-2, #1e293b) !important; 
    background: transparent !important;
    border: none !important;
    white-space: normal !important; 
    overflow: hidden;
}

/* Refined Hover/Focus state */
.ui-autocomplete .ui-menu-item.ui-state-focus div,
.ui-autocomplete .ui-menu-item:hover div {
    background-color: #f5f5f5 !important; 
    color: var(--ast-global-color-2, #1e293b) !important; 
    text-decoration: none !important;
}

.ui-autocomplete-match {
    font-weight: 700 !important;
}