/* =====================================================================
   site-search.css – the site-wide search box + results dropdown (movies, live TV, Sawa)
   ===================================================================== */
.search { position: relative; flex: 1; max-width: 520px; margin: 0 24px; }
.search input {
    width: 100%; height: 42px; border: 2px solid transparent; border-radius: 999px; background: #fff; color: #1f2937;
    font-family: 'Cairo', sans-serif; font-size: 14px; padding: 0 18px 0 50px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: #9ca3af; }
.search input:focus { border-color: #0a1628; box-shadow: 0 0 0 4px rgba(10, 22, 40, .18); }
.search-btn {
    position: absolute; left: 4px; top: 4px; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
    background: linear-gradient(135deg, #ea580c, #f97316); color: #fff; display: flex; align-items: center; justify-content: center;
}
.search-btn svg { width: 17px; height: 17px; }

.search-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; left: 0; z-index: 2000; display: none;
    background: #111c2e; border: 1px solid rgba(249, 115, 22, .35); border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .5); max-height: min(70vh, 520px); overflow-y: auto; padding: 6px;
    font-family: 'Cairo', sans-serif; direction: rtl; text-align: right;
}
.search-dropdown.show { display: block; }
.search-dropdown.loading { opacity: .7; }
.sd-group { padding: 8px 8px 4px; font-size: 12px; font-weight: 800; color: #fb923c; letter-spacing: .3px; }
.sd-group:not(:first-child) { border-top: 1px solid rgba(148, 163, 184, .12); margin-top: 4px; }
.sd-item { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; color: #fff; text-decoration: none; transition: background .15s; }
.sd-item:hover, .sd-item.active { background: rgba(249, 115, 22, .15); }
.sd-thumb {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px; background: #1e293b center/contain no-repeat;
    display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fb923c; font-weight: 800;
}
.sd-item[href*="watch.php"] .sd-thumb { height: 56px; background-size: cover; border-radius: 6px; }
.sd-thumb.round { border-radius: 50%; background-size: cover; }
.sd-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sd-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f8fafc; }
.sd-meta { font-size: 12px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-meta em { font-style: normal; color: #fb923c; margin-right: 8px; }
.sd-user { direction: ltr; text-align: right; }
.sd-friend { font-size: 10px; font-weight: 700; color: #a5b4fc; background: rgba(99, 102, 241, .2); border-radius: 5px; padding: 0 6px; }
.sd-live { font-size: 10px; font-weight: 800; color: #fff; background: #ef4444; border-radius: 5px; padding: 1px 7px; }
.sd-all { justify-content: center; margin-top: 4px; padding: 10px; font-weight: 700; font-size: 13px; color: #fb923c; border-top: 1px solid rgba(148, 163, 184, .15); border-radius: 0 0 10px 10px; }
.sd-empty { padding: 16px; text-align: center; color: #94a3b8; font-size: 14px; }

/* Phones: search box on its own row under the logo and buttons */
@media (max-width: 768px) {
    .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
    .search input { height: 40px; font-size: 16px; } /* 16px: iPhone doesn't zoom in */
    .search-btn { width: 32px; height: 32px; }
    .search-dropdown { max-height: 62vh; }
}
