/* ============================================================
   جستجوی Ajax — dropdown
   ============================================================ */

/* ============================================
   Dropdown
   ============================================ */

.ajax-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 9999;
    overflow: hidden;
    animation: ajaxSearchFadeIn 0.25s ease;
}

.ajax-search-dropdown.active {
    display: block;
}

@keyframes ajaxSearchFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Loading
   ============================================ */

.ajax-search-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 24px;
}

.ajax-search-loading span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e94560;
    animation: ajaxSearchBounce 1s ease-in-out infinite;
}

.ajax-search-loading span:nth-child(1) { animation-delay: 0s; }
.ajax-search-loading span:nth-child(2) { animation-delay: 0.15s; }
.ajax-search-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ajaxSearchBounce {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50%      { transform: translateY(-8px); opacity: 1; }
}

/* ============================================
   لیست نتایج
   ============================================ */

.ajax-search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 6px;
}

.ajax-search-results::-webkit-scrollbar {
    width: 4px;
}

.ajax-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.ajax-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ============================================
   آیتم نتیجه
   ============================================ */

.ajax-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.25s ease, transform 0.25s ease;
    border: 1px solid transparent;
}

.ajax-search-item:hover {
    background: rgba(233, 69, 96, 0.08);
    border-color: rgba(233, 69, 96, 0.15);
    transform: translateX(-4px);
}

/* کاور */
.ajax-search-item-cover {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #0f0f1a;
    border: 2px solid rgba(233, 69, 96, 0.2);
    transition: border-color 0.3s ease;
}

.ajax-search-item:hover .ajax-search-item-cover {
    border-color: rgba(233, 69, 96, 0.5);
}

.ajax-search-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* اطلاعات */
.ajax-search-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ajax-search-item-title {
    display: block;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: "bakhb", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.ajax-search-item:hover .ajax-search-item-title {
    color: #ff8fa3;
}

.ajax-search-item-artist {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #8a8aa0;
    font-size: 0.72rem;
    font-family: "bakhn", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ajax-search-item-artist i {
    color: #e94560;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* آیکون فلش */
.ajax-search-item-arrow {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: color 0.3s ease, transform 0.3s ease;
}

.ajax-search-item:hover .ajax-search-item-arrow {
    color: #e94560;
    transform: translateX(-4px);
}

/* ============================================
   حالت خالی
   ============================================ */

.ajax-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
    color: #8a8aa0;
    font-family: "bakhn", sans-serif;
    font-size: 0.85rem;
}

.ajax-search-empty i {
    font-size: 2rem;
    opacity: 0.3;
    color: #e94560;
}

/* ============================================
   دکمه "نمایش همه نتایج"
   ============================================ */

.ajax-search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.12), rgba(233, 69, 96, 0.06));
    border-top: 1px solid rgba(233, 69, 96, 0.15);
    color: #e94560;
    text-decoration: none;
    font-family: "bakhb", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.ajax-search-view-all:hover {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.2), rgba(233, 69, 96, 0.1));
    color: #ff8fa3;
}

.ajax-search-view-all i:first-child {
    font-size: 0.85rem;
}

.ajax-search-view-all i:last-child {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.ajax-search-view-all:hover i:last-child {
    transform: translateX(-4px);
}

/* ============================================
   لایت مود
   ============================================ */

html.theme-mode-light .ajax-search-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html.theme-mode-light .ajax-search-item:hover {
    background: rgba(233, 69, 96, 0.06);
    border-color: rgba(233, 69, 96, 0.2);
}

html.theme-mode-light .ajax-search-item-cover {
    background: #f0f0f5;
    border-color: rgba(233, 69, 96, 0.3);
}

html.theme-mode-light .ajax-search-item:hover .ajax-search-item-cover {
    border-color: rgba(233, 69, 96, 0.6);
}

html.theme-mode-light .ajax-search-item-title {
    color: #c23152;
}

html.theme-mode-light .ajax-search-item:hover .ajax-search-item-title {
    color: #e94560;
}

html.theme-mode-light .ajax-search-item-artist {
    color: rgba(26, 26, 46, 0.7);
}

html.theme-mode-light .ajax-search-item-arrow {
    color: rgba(26, 26, 46, 0.2);
}

html.theme-mode-light .ajax-search-item:hover .ajax-search-item-arrow {
    color: #e94560;
}

html.theme-mode-light .ajax-search-empty {
    color: rgba(26, 26, 46, 0.6);
}

html.theme-mode-light .ajax-search-empty i {
    color: #e94560;
}

html.theme-mode-light .ajax-search-view-all {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.1), rgba(233, 69, 96, 0.05));
    border-top-color: rgba(233, 69, 96, 0.2);
    color: #c23152;
}

html.theme-mode-light .ajax-search-view-all:hover {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.18), rgba(233, 69, 96, 0.08));
    color: #e94560;
}

/* ============================================
   ریسپانسیو
   ============================================ */

@media (max-width: 768px) {
    .ajax-search-dropdown {
        max-width: none;
        left: 8px;
        right: 8px;
        border-radius: 14px;
    }
    
    .ajax-search-results {
        max-height: 320px;
    }
    
    .ajax-search-item {
        padding: 8px 10px;
        gap: 10px;
    }
    
    .ajax-search-item-cover {
        width: 44px;
        height: 44px;
    }
    
    .ajax-search-item-title {
        font-size: 0.8rem;
    }
    
    .ajax-search-item-artist {
        font-size: 0.68rem;
    }
    
    .ajax-search-view-all {
        font-size: 0.75rem;
        padding: 10px 14px;
    }
}

@media (max-width: 480px) {
    .ajax-search-item {
        padding: 8px;
        gap: 8px;
    }
    
    .ajax-search-item-cover {
        width: 40px;
        height: 40px;
    }
    
    .ajax-search-item-title {
        font-size: 0.75rem;
    }
    
    .ajax-search-item-artist {
        font-size: 0.62rem;
    }
    
    .ajax-search-item-arrow {
        display: none;
    }
}