/* ---------- Icon Button ---------- */
.indomode-search-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    line-height: 0;
}

.indomode-search-toggle .search-icon {
    fill: currentColor;
    width: 24px;
    height: 24px;
}

/* ---------- Full‑screen Overlay ---------- */
.indomode-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.indomode-search-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

/* Account for the WordPress admin toolbar so the overlay (and the close
   button positioned against its corner) don't render underneath it. */
body.admin-bar .indomode-search-overlay {
    top: 32px; /* desktop admin bar height */
}

@media screen and (max-width: 782px) {
    body.admin-bar .indomode-search-overlay {
        top: 46px; /* mobile admin bar height */
    }
}

/* ---------- Modal Container ---------- */
.indomode-search-modal {
    width: 100%;
    max-width: 600px;
    position: relative;
    padding-right: var(--wp--style--root--padding-right);
    padding-left: var(--wp--style--root--padding-left);
    box-sizing: border-box;
}

/* ---------- Close Button ---------- */
.indomode-search-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    z-index: 10;
}

/* ---------- Search Form ---------- */
.indomode-search-container {
    width: 100%;
}

.indomode-search-form {
    margin: 0;
}

.indomode-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.indomode-search-input {
    width: 100%;
    padding: 16px 44px 16px 20px;
    font-size: 18px;
    border: none;
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
}

/* ---------- Clear Button ---------- */
.indomode-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.indomode-search-clear:hover,
.indomode-search-clear:focus-visible {
    background: rgba(0, 0, 0, 0.08);
    color: #333;
    outline: none;
}

.indomode-search-clear.is-visible {
    display: flex;
}

/* ---------- Live Results Dropdown ---------- */
.indomode-live-results {
    display: none;
    margin-top: 2px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    max-height: 60vh;
    overflow-y: auto;
}

.indomode-result-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.indomode-result-item:last-child {
    border-bottom: none;
}

.indomode-result-item:hover,
.indomode-result-item.active {
    background: #f7f7f7;
}

.indomode-result-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.indomode-result-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.indomode-result-title {
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.indomode-result-excerpt {
    font-size: 13px;
    color: #666;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.indomode-no-results {
    padding: 20px;
    color: #888;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

/* ---------- “Search for…” Button ---------- */
.indomode-search-for-button {
    border-top: 1px solid #eee;
    padding: 0;  /* padding inside the button */
}

.indomode-search-for-term {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    text-align: left;
    padding: 14px 20px;
    margin: 0;
    line-height: 1.4;
    transition: background 0.15s;
}

.indomode-search-for-term:hover,
.indomode-search-for-term:focus-visible {
    background: #f7f7f7;
    outline: none;
}

.indomode-search-for-arrow {
    display: flex;
    align-items: center;
    margin-left: 12px;
    flex-shrink: 0;
}