/* ---------------- SEARCH OVERLAY ---------------- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* ---------------- SEARCH OVERLAY ---------------- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.search-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.search-header {
    position: relative;
    display: flex;
    width: 100%;
    margin-bottom: 1rem;
}

.search-header input {
    flex: 1;
    padding: 0.6rem 2.5rem 0.6rem 0.75rem;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 12px;
    outline: none;
}

.search-header input:focus {
    border-color: #366199;
}

#close-search {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #888;
}

#close-search:hover {
    color: #366199;
}

#history-list li {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    color: #222;
    cursor: pointer;
    border-radius: 8px;
}

#history-list li:hover {
    background: #f5f5f5;
}

.search-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.search-header {
    position: relative;
    display: flex;
    width: 100%;
    margin-bottom: 1rem;
}

.search-header input {
    flex: 1;
    padding: 0.6rem 2.5rem 0.6rem 0.75rem;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 12px;
    outline: none;
}

.search-header input:focus {
    border-color: #366199;
}

.search-btn {
    background: transparent; /* no background */
    border: none; /* no border */
    padding: 0; /* no extra padding */
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn svg {
    width: 32px;
    height: 32px;
    pointer-events: none; /* lets the button itself handle clicks */
    transition: transform 0.2s, fill 0.2s;
}

.search-btn:hover svg {
    transform: scale(1.2);
}

#close-search {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #888;
}

#close-search:hover {
    color: #366199;
}

#history-list li {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    color: #222;
    cursor: pointer;
    border-radius: 8px;
}

#history-list li:hover {
    background: #f5f5f5;
}

/* ---------------- LIMIT SEARCH OVERLAY WIDTH ---------------- */
.search-overlay {
    width: 390px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}