/* FAQ Search Plugin Styles style.css */
.faq-search-wrapper {
    width: 100% !important;
    max-width: none !important;
    margin: 0;
    padding: 20px 0;
    box-sizing: border-box;
}

.faq-search-input::placeholder {
    color: #666666 !important; /* Insert desired color here */
    opacity: 1; /* For Firefox */
}

/* For older browser compatibility */
.faq-search-input::-webkit-input-placeholder { color: #666666 !important; }
.faq-search-input::-moz-placeholder { color: #666666 !important; opacity: 1; }
.faq-search-input:-ms-input-placeholder { color: #666666 !important; }

.faq-search-header {
    text-align: center;
    margin-bottom: 40px;
}

.faq-search-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.faq-search-subtitle {
    font-size: 1.125rem;
    color: #666;
    margin: 0;
    font-weight: 400;
}

.faq-search-container {
    position: relative;
    width: 100%;
}

.faq-search-container .faq-search-input-wrapper .faq-search-input {
    border: 1px solid #ccc !important;
    padding: 16px 20px;
    border-radius: 8px;
    background-color:#fff;
}

.faq-search-input-wrapper {
    position: relative;
    margin-bottom: 8px;
    width: 100%;
    display: flex;
    align-items: center;
}

.faq-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 24px;
    height: 24px;
    color: #000;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.faq-search-icon svg {
    width: 100%;
    height: 100%;
}

.faq-search-input {
    width: 100% !important;
    flex: 1 !important;
    padding: 16px 50px 16px 20px;
    font-size: 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    box-sizing: border-box !important;
    min-width: 0;
}

.faq-search-input:focus {
    border-color: #000;
    box-shadow: 2px 2px 4px 1px rgba(0, 0, 0, 0.1);
}

.faq-search-input:focus + .faq-search-icon { color: #000; }

.faq-search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
    opacity: 0;
}

.faq-search-clear:hover {
    color: #333;
    background-color: #f5f5f5;
    transform: translateY(-50%) scale(1.1);
}

.faq-search-clear:active { transform: translateY(-50%) scale(0.95); }
.faq-search-clear.show { display: flex !important; opacity: 1; }
.faq-search-icon.hide { opacity: 0; pointer-events: none; display:none; }

/* DROPDOWN PORTALED TO BODY: use position: fixed, no top/left here (set via JS) */
.faq-search-dropdown {
    position: fixed;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 10000; /* sits above page chrome */
    max-height: 400px;
    overflow-y: auto;
    display: none;
    box-sizing: border-box;
    scroll-behavior: smooth;
    pointer-events: auto;
}

.faq-search-dropdown.show {
    display: block !important;
    animation: fadeInUp 0.2s ease-out;
    /* no margin-top; spacing handled in JS positioning */
}

.faq-search-results { padding: 8px 0; }

.faq-search-result-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    outline: none;
    position: relative;
}

.faq-search-result-item:hover,
.faq-search-result-item.selected { background-color: #f8f9fa; }

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

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

.faq-search-result-title {
    font-weight: 500;
    color: #333;
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* NEW: Global search result styling - simplified for global-only */
.faq-search-result-page {
    font-size: 16px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
    opacity: 0.8;
}

.faq-search-result-item.global {
    background-color: #fafbfc;
    padding-left: 17px;
}

.faq-search-result-item.global:hover,
.faq-search-result-item.global.selected {
    background-color: #f0f8ff;
}

.faq-search-arrow {
    width: 16px;
    height: 16px;
    color: #999;
    transform: rotate(45deg);
    transition: color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.faq-search-result-item:hover .faq-search-arrow,
.faq-search-result-item.selected .faq-search-arrow {
    color: #C43636;
    transform: rotate(45deg) translateX(2px);
}

.faq-search-result-item.global:hover .faq-search-arrow,
.faq-search-result-item.global.selected .faq-search-arrow {
    color: #C43636;
    transform: rotate(45deg) translateX(3px);
}

.faq-search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.faq-search-highlight {
    background-color: #C43636;
    color:#fff;
    font-weight: 500;
    padding: 0px 1px;
    border-radius: 3px;
}

/* Loading state for global search */
.faq-search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.faq-search-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #C43636;
    border-radius: 50%;
    animation: faq-search-spin 1s linear infinite;
}

@keyframes faq-search-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .faq-search-wrapper { padding: 15px 0; }
    .faq-search-title { font-size: 2rem; }
    .faq-search-subtitle { font-size: 1rem; }
    .faq-search-input { font-size: 16px !important; padding: 14px 45px 14px 16px; }
    .faq-search-dropdown { max-height: 300px; }
    .faq-search-result-item { padding: 12px 16px; }
    .faq-search-result-item.global { padding-left: 13px; }
    
    .faq-search-result-page {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .faq-search-input { padding: 12px 40px 12px 14px; font-size: 16px; }
    .faq-search-clear { right: 10px; width: 24px; height: 24px; font-size: 16px; }
    .faq-search-result-item { padding: 10px 14px; gap: 8px; }
    .faq-search-result-item.global { padding-left: 11px; }
    .faq-search-result-title { font-size: 16px; }
    
    .faq-search-result-page {
        font-size: 14px;
        margin-top: 2px;
    }-search-result-item.local::before {
        right: 40px;
        top: 4px;
        font-size: 9px;
    }
}

.faq-search-wrapper *,
.faq-search-wrapper *::before,
.faq-search-wrapper *::after { box-sizing: border-box; }

.faq-search-dropdown::-webkit-scrollbar { width: 6px; }
.faq-search-dropdown::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.faq-search-dropdown::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
.faq-search-dropdown::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
.faq-search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.faq-search-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #C43636;
    border-radius: 50%;
    animation: faq-search-spin 1s linear infinite;
}

@keyframes faq-search-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
