/* ==========================================================================
   Najibul Search 2.0 — Enterprise Dopamine UI & Headless Typeahead CSS
   ========================================================================== */

:root {
    --najibul-search-primary: #ad0bf2;
    --najibul-search-gradient: linear-gradient(135deg, #ad0bf2 0%, #6366f1 100%);
    --najibul-search-bg: #ffffff;
    --najibul-search-text: #0f172a;
    --najibul-search-muted: #64748b;
    --najibul-search-border: #e2e8f0;
    --najibul-btn-dark: #090d16;
}

/* Outer Portal Container */
.najibul-search-portal-wrap {
    position: relative;
    max-width: 640px;
    margin: 12px auto;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

/* Search Form */
.najibul-search-form {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Search Wrapper Pill */
.najibul-search-wrapper {
    display: flex;
    align-items: center;
    background: var(--najibul-search-bg);
    border: 2px solid var(--najibul-search-primary);
    border-radius: 50px;
    padding: 6px 10px 6px 14px;
    box-shadow: 0 4px 18px rgba(173, 11, 242, 0.15), 0 0 0 1px rgba(173, 11, 242, 0.05);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    gap: 8px;
    box-sizing: border-box;
}

.najibul-search-wrapper:focus-within {
    border-color: #9333ea;
    box-shadow: 0 8px 26px rgba(173, 11, 242, 0.28), 0 0 0 3px rgba(173, 11, 242, 0.18);
    transform: translateY(-1px);
}

/* Input Box */
.najibul-input-box {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 100px;
}

.najibul-search-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 15px;
    font-weight: 500;
    color: var(--najibul-search-text);
    padding: 8px 24px 8px 4px !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.najibul-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Clear Button */
.najibul-search-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: #cbd5e1;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.najibul-search-clear:hover {
    background: #94a3b8;
    color: #0f172a;
}

/* Search Submit Button */
.najibul-submit-btn {
    background: var(--najibul-btn-dark) !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 8px 16px !important;
    color: #ffffff !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.najibul-submit-btn:hover {
    background: #1e1b4b !important;
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.najibul-icon-search {
    stroke: #ffffff;
    display: block;
}

/* Voice Search Button 2.0 */
.najibul-voice-btn {
    position: relative;
    background: var(--najibul-btn-dark) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    min-height: 38px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    color: #ffffff !important;
}

.najibul-voice-btn:hover {
    background: #1e1b4b !important;
    transform: translateY(-1px) scale(1.05);
}

.najibul-icon-mic {
    stroke: #ffffff;
    display: block;
    transition: transform 0.2s ease;
}

/* Voice Active / Listening State */
.najibul-voice-btn.listening {
    background: linear-gradient(135deg, #ef4444 0%, #ec4899 100%) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
    animation: najibul-pulse-btn 1.4s infinite;
}

.najibul-voice-btn.listening .najibul-voice-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid #ef4444;
    animation: najibul-wave-pulse 1.4s cubic-bezier(0.24, 0, 0.38, 1) infinite;
    pointer-events: none;
}

@keyframes najibul-pulse-btn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes najibul-wave-pulse {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* Dynamic Language Switcher */
.najibul-lang-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 2px 8px;
    flex-shrink: 0;
    height: 34px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.najibul-lang-switcher:hover {
    background: #e2e8f0;
}

.najibul-lang-switcher select,
.najibul-lang-switcher .pll-switcher-select,
.najibul-lang-switcher-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 6px center !important;
    border: none !important;
    outline: none !important;
    padding: 2px 20px 2px 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

/* ==========================================================================
   Typeahead Live Search Dropdown & Mind-Reader UI
   ========================================================================== */
.najibul-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(173, 11, 242, 0.2);
    border-radius: 18px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(173, 11, 242, 0.08);
    z-index: 99999;
    overflow: hidden;
    animation: najibul-dropdown-fade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes najibul-dropdown-fade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.najibul-dropdown-inner {
    padding: 10px 0;
    max-height: 480px;
    overflow-y: auto;
}

/* Suggestion Item Row */
.najibul-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--najibul-search-text);
    transition: background 0.15s ease, transform 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

.najibul-result-item:last-child {
    border-bottom: none;
}

.najibul-result-item:hover,
.najibul-result-item.selected {
    background: #f8fafc;
}

.najibul-result-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}

.najibul-result-thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #6d28d9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.najibul-result-content {
    flex: 1;
    min-width: 0;
}

.najibul-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.najibul-result-title mark {
    background: rgba(173, 11, 242, 0.16);
    color: #ad0bf2;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 700;
}

.najibul-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
}

.najibul-type-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
}

/* AI Mind-Reader "Did You Mean?" Banner */
.najibul-mind-reader-banner {
    background: linear-gradient(135deg, #fdf4ff 0%, #ede9fe 100%);
    border-left: 4px solid #ad0bf2;
    padding: 10px 16px;
    margin: 4px 12px 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4c1d95;
}

.najibul-mind-reader-banner a {
    color: #ad0bf2;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

/* Trending Searches Section */
.najibul-trending-box {
    padding: 10px 16px;
}

.najibul-trending-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.najibul-trending-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.najibul-chip {
    background: #f1f5f9;
    color: #334155;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.najibul-chip:hover {
    background: #ad0bf2;
    color: #ffffff;
    transform: translateY(-1px);
}

/* View All Bar */
.najibul-dropdown-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.najibul-view-all-link {
    font-size: 13px;
    font-weight: 700;
    color: #ad0bf2;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.najibul-view-all-link:hover {
    text-decoration: underline;
}

/* Empty State */
.najibul-empty-state {
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

/* Voice Notification Toast */
.najibul-voice-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #090d16;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    animation: najibul-toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255,255,255,0.1);
}

@keyframes najibul-toast-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .najibul-search-wrapper {
        padding: 4px 8px 4px 12px;
        gap: 6px;
    }

    .najibul-search-input {
        font-size: 14px;
        padding: 6px 18px 6px 2px !important;
    }

    .najibul-submit-btn {
        padding: 6px 12px !important;
    }

    .najibul-voice-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px;
        min-height: 34px;
    }

    .najibul-lang-switcher {
        height: 30px;
        padding: 0 4px;
    }

    .najibul-lang-switcher select,
    .najibul-lang-switcher-select {
        font-size: 11px !important;
        padding: 2px 18px 2px 4px !important;
    }

    .najibul-voice-toast {
        top: 12px;
        right: 12px;
        left: 12px;
    }
}

/* Cross-Script Transliteration Badge */
.najibul-transliteration-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(173, 11, 242, 0.12) 100%);
    border-left: 3px solid var(--najibul-search-primary);
    padding: 8px 14px;
    margin: 4px 12px 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #1e1b4b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.najibul-transliteration-badge strong {
    color: var(--najibul-search-primary);
    font-weight: 700;
}

.najibul-roman-tag {
    color: #64748b;
    font-style: normal;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Smart Snippet Highlighting */
.najibul-result-snippet {
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
    margin: 3px 0 5px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.najibul-result-snippet mark {
    background: #fef08a;
    color: #854d0e;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.najibul-fire-icon {
    font-size: 14px;
    margin-right: 4px;
}
