/* ========================================
  * Search Autocomplete Dropdown — Owni24
   ======================================== */

/* الـ dropdown يتلصق على document.body بـ position:fixed
   عشان يخرج من overflow:hidden في .search-panel */
.o24s-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;
}

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

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

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

.o24s-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;
}
.o24s-item:last-child { border-bottom: none; }
.o24s-item:hover, .o24s-item.o24s-active {
    background: #F8FAFC;
}
.o24s-item.o24s-active {
    background: linear-gradient(90deg, rgba(13,46,92,0.05), transparent);
    border-right: 3px solid #0D2E5C;
}

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

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

.o24s-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;
}
.o24s-title mark {
    background: #FEF3C7;
    color: #92400E;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

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

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

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

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

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

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

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

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

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