/* ========================================== */
/* یوٹیوب اسٹائل سرچ بار */
/* ========================================== */

.search-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
}

/* ===== میگنیفائر بٹن ===== */
.search-toggle-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.search-toggle-btn:hover {
    background: rgba(45, 106, 79, 0.08);
    color: #2d6a4f;
}

/* ===== سلائیڈ ڈاؤن سرچ بار ===== */
.search-slide-wrapper {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-width: 85vw;
    background: transparent;
    overflow: hidden;
    display: none;
    animation: slideDown 0.25s ease;
    z-index: 9999;
}

.search-slide-wrapper.active {
    display: block;
}

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

.search-slide-inner {
    padding: 0;
}

/* ===== سرچ انپٹ ===== */
.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 30px;
    padding: 1px 6px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: #2d6a4f;
    background: white;
    box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.08);
}

.search-input-wrapper .search-icon {
    color: #94a3b8;
    font-size: 18px;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #1a2a3a;
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: #94a3b8;
}

.search-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.search-close-btn:hover {
    color: #ef4444;
}

/* ===== نتائج ===== */
.search-results {
    max-height: 340px;
    overflow-y: auto;
    margin-top: 8px;
    display: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 4px 0;
}

.search-results.active {
    display: block;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #1a2a3a;
    transition: all 0.2s ease;
    background: white;
}

.result-item:hover {
    background: #f1f5f9;
}

.result-name {
    font-size: 14px;
    font-weight: 500;
}

.result-category {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 12px;
    border-radius: 30px;
}

/* ===== خالی نتائج ===== */
.search-no-result {
    text-align: center;
    padding: 30px 20px;
    color: #94a3b8;
    background: white;
    border-radius: 12px;
}

.search-no-result i {
    font-size: 28px;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.search-no-result p {
    margin: 0;
    color: #1a2a3a;
}

/* ===== ڈارک موڈ ===== */
body.dark .search-slide-wrapper {
    background: transparent;
}

body.dark .search-input-wrapper {
    background: #0f172a;
}

body.dark .search-input-wrapper input {
    color: #f1f5f9;
}

body.dark .search-input-wrapper input::placeholder {
    color: #64748b;
}

body.dark .search-results {
    background: #1e293b;
}

body.dark .result-item {
    background: #1e293b;
    color: #f1f5f9;
}

body.dark .result-item:hover {
    background: #334155;
}

body.dark .result-category {
    background: #334155;
    color: #94a3b8;
}

body.dark .search-no-result {
    background: #1e293b;
}

body.dark .search-no-result p {
    color: #f1f5f9;
}

/* ===== موبائل ===== */
@media (max-width: 768px) {
    .search-slide-wrapper {
        width: 100vw;
        right: -12px;
        border-radius: 0 0 16px 16px;
        top: calc(100% + 4px);
    }
    
    .search-slide-inner {
        padding: 12px;
    }
    
    .search-input-wrapper input {
        font-size: 14px;
        padding: 10px 8px;
    }
}