/* ---------- Base ---------- */
.als-search-container {
    position: relative;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    z-index: 999;
}

/* ---------- Inline ---------- */
.als-inline .als-search-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.als-inline .als-search-wrapper:hover,
.als-inline .als-search-wrapper:focus-within {
    border-color: #0073aa;
    box-shadow: 0 4px 14px rgba(0,115,170,0.15);
}
.als-search-input {
    flex: 1;
    border: none;
    padding: 12px 18px;
    font-size: 15px;
    background: transparent;
    outline: none;
    min-width: 0;
}
.als-search-input::placeholder {
    color: #aaa;
}
.als-lucky-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    padding: 10px 15px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease, transform 0.2s ease;
}
.als-lucky-btn:hover {
    color: #10b981;
    transform: rotate(5deg) scale(1.15);
}

/* ---------- Dropdown (shared) ---------- */
.als-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    max-height: 360px;
    overflow-y: auto;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    animation: alsFadeIn 0.2s ease;
    padding: 8px 0;
    backdrop-filter: blur(8px);
}
@keyframes alsFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
.als-result-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}
.als-result-item:last-child { border-bottom: none; }
.als-result-item.highlighted,
.als-result-item:hover { background: #f8fafc; }
.als-result-title {
    font-weight: 600;
    color: #1e293b;
    margin-right: 10px;
    font-size: 14px;
    line-height: 1.4;
}
.als-result-badge {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.als-result-excerpt {
    width: 100%;
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.5;
}
.als-view-all {
    padding: 14px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #0073aa;
    background: #f0f9ff;
    border-top: 1px solid #e0f2fe;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 0 0 16px 16px;
}
.als-view-all:hover { background: #dbeafe; }
.als-suggestions-header {
    padding: 8px 20px;
    font-weight: 600;
    font-size: 12px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
    border-bottom: 1px solid #f1f5f9;
}
.als-no-results {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* Scrollbar */
.als-results-dropdown::-webkit-scrollbar { width: 6px; }
.als-results-dropdown::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 0 16px 16px 0; }
.als-results-dropdown::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ---------- Collapsible (Trigger button) ---------- */
.als-collapsible .als-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    padding: 10px 20px;
    color: #334155;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.als-collapsible .als-search-trigger:hover {
    background: #e2e8f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.als-trigger-text {
    font-weight: 500;
}

/* ---------- Overlay ---------- */
.als-overlay {
    display: none; /* hidden by default */
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
}
.als-overlay-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}
.als-overlay-content {
    position: relative;
    background: #fff;
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    animation: alsOverlayIn 0.3s ease;
}
@keyframes alsOverlayIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.als-overlay-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
    transition: color 0.2s;
}
.als-overlay-close:hover { color: #0f172a; }

/* Overlay search bar inside */
.als-overlay-content .als-search-wrapper {
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 30px;
}

/* Overlay dropdown */
.als-overlay-content .als-results-dropdown {
    position: static;
    box-shadow: none;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    max-height: 350px;
}