/* ========================================
   Search Autocomplete Dropdown — Owni News
   ======================================== */

/* الـ dropdown يتلصق على document.body بـ position:fixed
   عشان يخرج من overflow:hidden في .search-panel */
.search-suggest-dropdown {
    position: fixed;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.20);
    max-height: 70vh;
    overflow-y: auto;
    z-index: 100001;
    display: none;
    direction: rtl;
    animation: ssDropIn 0.18s ease-out;
}

.search-suggest-dropdown.open { display: block; }

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

.ss-list { padding: 6px 0; }

.ss-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #0F172A;
    transition: background 0.15s;
    border-bottom: 1px solid #F1F5F9;
}
.ss-item:last-child { border-bottom: none; }
.ss-item:hover, .ss-item.active {
    background: #F8FAFC;
}
.ss-item.active {
    background: linear-gradient(90deg, rgba(13,124,61,0.05), transparent);
    border-right: 3px solid #0D7C3D;
}

.ss-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #F1F5F9 center/cover no-repeat;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.ss-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ss-thumb.no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    font-size: 22px;
}

.ss-body {
    flex: 1;
    min-width: 0;
}

.ss-title {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ss-title mark {
    background: #FEF3C7;
    color: #92400E;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

.ss-meta {
    font-size: 11px;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ss-meta .ss-cat {
    background: #E8F5EC;
    color: #10A854;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 10px;
}

.ss-footer {
    padding: 10px 14px;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    text-align: center;
    font-size: 12px;
    color: #64748B;
}
.ss-footer a {
    color: #0D7C3D;
    font-weight: 700;
    text-decoration: none;
}
.ss-footer a:hover { text-decoration: underline; }

/* States */
.ss-empty {
    padding: 30px 14px;
    text-align: center;
    color: #94A3B8;
    font-size: 14px;
}
.ss-empty i {
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
    color: #CBD5E1;
}

.ss-loading {
    padding: 14px;
}
.ss-skeleton-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}
.ss-skel {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: ssShimmer 1.2s infinite;
    border-radius: 6px;
}
.ss-skel-thumb { width: 56px; height: 56px; border-radius: 8px; flex-shrink: 0; }
.ss-skel-lines { flex: 1; }
.ss-skel-line { height: 12px; margin-bottom: 6px; }
.ss-skel-line.w70 { width: 70%; }
.ss-skel-line.w40 { width: 40%; }

@keyframes ssShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ss-error {
    padding: 16px;
    text-align: center;
    color: #DC2626;
    font-size: 13px;
}

/* Mobile: full-width dropdown sticky bottom */
@media (max-width: 768px) {
    .search-suggest-dropdown {
        max-height: 60vh;
    }
    .ss-thumb {
        width: 48px;
        height: 48px;
    }
    .ss-title {
        font-size: 13px;
    }
}

/* Scrollbar */
.search-suggest-dropdown::-webkit-scrollbar {
    width: 6px;
}
.search-suggest-dropdown::-webkit-scrollbar-track {
    background: #F8FAFC;
}
.search-suggest-dropdown::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 999px;
}

/* Highlight in search page results */
.art-list .art-row mark {
    background: #FEF3C7;
    color: #92400E;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}
