/* =========================================
   GOOGLE-STYLE SEARCH BAR
========================================= */

/* Wrapper */
.google-search-wrapper {
    position: relative;
    max-width: 584px;
    margin: 0 auto 20px;
}

/* Main Container */
.google-search-container {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    padding: 5px 8px 5px 14px;
    height: 46px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
}

.google-search-container:hover {
    box-shadow: 0 2px 8px rgba(32, 33, 36, 0.12);
    border-color: rgba(223, 225, 229, 0);
}

.google-search-container:focus-within {
    box-shadow: 0 2px 8px rgba(32, 33, 36, 0.16);
    border-color: transparent;
}

/* Search Icon (Left) */
.search-icon-left {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa0a6;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-icon-left svg {
    width: 20px;
    height: 20px;
}

/* Search Input */
.google-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #202124;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 24px;
}

.google-search-input::placeholder {
    color: #9aa0a6;
}

.google-search-input::-webkit-search-cancel-button {
    display: none;
}

/* Clear Button */
.google-clear-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: #70757a;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    margin: 0 4px;
}

.google-clear-btn:hover {
    background-color: #f1f3f4;
}

.google-clear-btn svg {
    width: 20px;
    height: 20px;
}

/* Voice Button */
.google-voice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: #4285f4;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    margin: 0 4px;
}

.google-voice-btn:hover {
    background-color: #f1f3f4;
}

.google-voice-btn svg {
    width: 20px;
    height: 20px;
}

/* Search Button */
.google-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #4285f4;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin: 0 2px;
}

.google-search-btn:hover {
    background: #1a73e8;
    box-shadow: 0 1px 3px rgba(66, 133, 244, 0.3);
}

.google-search-btn:active {
    background: #1765cc;
}

.google-search-btn svg {
    width: 18px;
    height: 18px;
}

/* Suggestions Dropdown */
.google-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(32, 33, 36, 0.16);
    overflow: hidden;
    z-index: 1000;
    animation: fadeInDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Suggestion Item */
.google-suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.1s ease;
    border-bottom: 1px solid #f1f3f4;
}

.google-suggestion-item:last-child {
    border-bottom: none;
}

.google-suggestion-item:hover,
.google-suggestion-item.active {
    background-color: #f1f3f4;
}

.google-suggestion-item .suggestion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 16px;
    color: #70757a;
    flex-shrink: 0;
}

.google-suggestion-item .suggestion-icon svg {
    width: 16px;
    height: 16px;
}

.google-suggestion-item .suggestion-text {
    flex: 1;
    font-size: 14px;
    color: #202124;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.google-suggestion-item .suggestion-text mark {
    background: transparent;
    font-weight: 600;
    color: #202124;
}

.google-suggestion-item .suggestion-type {
    font-size: 12px;
    color: #70757a;
    margin-left: 8px;
}

/* Recent/History Icon */
.suggestion-icon.history {
    color: #9aa0a6;
}

/* No Results */
.google-no-results {
    padding: 20px;
    text-align: center;
    color: #70757a;
    font-size: 14px;
}

/* =========================================
   FILTER BUTTON (GOOGLE STYLE)
========================================= */

.filter-button-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 12px;
}

.google-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    height: 46px;
    cursor: pointer;
    font-size: 14px;
    color: #202124;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.google-filter-btn:hover {
    box-shadow: 0 2px 8px rgba(32, 33, 36, 0.12);
    border-color: rgba(223, 225, 229, 0);
}

.google-filter-btn svg {
    flex-shrink: 0;
}

.google-filter-btn .dropdown-icon {
    transition: transform 0.2s ease;
}

.google-filter-btn.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Filter Dropdown */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(32, 33, 36, 0.16);
    overflow: hidden;
    z-index: 1000;
    animation: fadeInDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #202124;
    transition: background-color 0.1s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.filter-dropdown-item:hover {
    background-color: #f1f3f4;
}

.filter-dropdown-item.selected {
    background-color: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 768px) {
    .google-search-wrapper {
        max-width: 100%;
        margin: 0 0 16px;
    }
    
    .google-search-container {
        height: 44px;
    }
    
    .google-search-input {
        font-size: 15px;
    }
    
    .google-voice-btn {
        display: none; /* Hide voice on mobile to save space */
    }
    
    .filter-button-wrapper {
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
    }
    
    .google-filter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .filter-dropdown {
        left: 0;
        right: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .google-search-container {
        border-radius: 20px;
        height: 42px;
        padding: 4px 6px 4px 12px;
    }
    
    .search-icon-left {
        margin-right: 8px;
    }
    
    .google-search-btn,
    .google-clear-btn {
        width: 32px;
        height: 32px;
    }
    
    .google-suggestions {
        border-radius: 16px;
    }
    
    .google-suggestion-item {
        padding: 10px 16px;
    }
}

/* =========================================
   DARK MODE SUPPORT (Optional)
========================================= */

/*@media (prefers-color-scheme: dark) {
    .google-search-container {
        background: #303134;
        border-color: #5f6368;
    }
    
    .google-search-container:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .search-icon-left {
        color: #9aa0a6;
    }
    
    .google-search-input {
        color: #e8eaed;
    }
    
    .google-search-input::placeholder {
        color: #9aa0a6;
    }
    
    .google-clear-btn,
    .google-voice-btn {
        color: #9aa0a6;
    }
    
    .google-clear-btn:hover,
    .google-voice-btn:hover {
        background-color: #3c4043;
    }
    
    .google-suggestions,
    .filter-dropdown {
        background: #303134;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .google-suggestion-item,
    .filter-dropdown-item {
        color: #e8eaed;
        border-color: #3c4043;
    }
    
    .google-suggestion-item:hover,
    .filter-dropdown-item:hover {
        background-color: #3c4043;
    }
    
    .google-filter-btn {
        background: #303134;
        border-color: #5f6368;
        color: #e8eaed;
    }
}*/

/* =========================================
   ACCESSIBILITY
========================================= */

.google-search-container:focus-within .search-icon-left {
    color: #4285f4;
}

/* Keyboard navigation highlight */
.google-suggestion-item:focus,
.filter-dropdown-item:focus {
    outline: 2px solid #4285f4;
    outline-offset: -2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
