/* ========== SEARCH ========== */
.search-box {
    margin: 0 auto 2rem auto;
    max-width: 900px;
    position: relative;
    z-index: 1002;
}

.search-input {
    width: 100%;
    font-family: var(--md-ref-typeface-plain, sans-serif);
    font-size: 0.875rem;
    padding: 1rem 4rem 1rem 1.5rem;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 32px;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: all 0.2s ease-in-out;
}

.search-input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.search-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}

.search-button {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    border: none;
    background-color: transparent;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, background-color 0.2s ease-in-out;
    -webkit-tap-highlight-color: transparent;
}

.search-button.visible {
    opacity: 1;
    visibility: visible;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1002;
    display: none;
}

.search-results.active {
    display: flex;
}

.search-result-item {
    background-color: var(--md-sys-color-surface-container-high);
    padding: 1rem 1.5rem;
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.search-result-item:first-child {
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.search-result-item:last-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
}

.search-result-item:only-child {
    border-radius: 28px;
}

.search-result-item:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.search-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-backdrop.active {
    opacity: 1;
    visibility: visible;
}