/* ОТМЕНЯЕМ ЛЮБОЕ скрытие иконки темой */
li.icon.search-icon,
li.icon.search-icon a,
li.icon.search-icon i {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    line-height: 54px;
    font-size: 30px;
}

/* ——— мобильная версия ——— */
@media (max-width:768px) {

    li.icon.search-icon {
        right: 8px;
    }

    li.icon.search-icon a {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        line-height: 32px;
        font-size: 15px;
    }
}

/* ======================= SEARCH POPUP CSS ======================= */

.custom-search-popup{
    position:fixed;top:0;left:0;width:100vw;height:100vh;
    background:rgba(0,0,0,0.4);
    backdrop-filter:blur(15px);
    -webkit-backdrop-filter:blur(15px);
    z-index:9999;
    display:none;
    align-items:flex-start;
    justify-content:center;
    margin:0;padding:0;
    box-sizing:border-box
}

.custom-search-container{margin-top: 7vh !important;}
.custom-search-popup.active{display:flex;animation:fadeIn .3s ease}

@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes slideDown{from{opacity:0;transform:translateY(-30px)}to{opacity:1;transform:translateY(0)}}
@keyframes scaleIn{from{opacity:0;transform:scale(0.9)}to{opacity:1;transform:scale(1)}}
@keyframes shimmer{0%{left:-100%}100%{left:100%}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes cardAppear{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}

.custom-search-container{
    width:90%;
    max-width:650px;
    animation:slideDown .4s ease
}

.custom-search-box{
    background:linear-gradient(135deg,#fff 0%,#f8f9fa 100%);
    border-radius:20px;
    padding:8px;
    box-shadow:0 25px 80px rgba(0,0,0,0.4),0 0 0 1px rgba(255,255,255,0.1);
    display:flex;
    align-items:center;
    position:relative;
    overflow:visible;
}

.custom-search-box::before{
    content:'';
    position:absolute;
    top:0;left:-100%;
    width:100%;height:100%;
    background:linear-gradient(90deg,transparent,rgba(42,141,163,0.1),transparent);
    animation:shimmer 2s infinite
}

.custom-search-icon{
    width:50px;height:50px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#2A8DA3;
    font-size:22px
}

.custom-search-input{
    flex:1;
    border:none;
    background:transparent;
    font-size:18px;
    padding:15px 10px;
    outline:none;
    color:#333
}

.custom-search-input::placeholder{color:#aaa}

.custom-search-close{
    width:50px;height:50px;
    border:none;
    background:#f1f1f1;
    border-radius:12px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
    color:#666;
    transition:all .3s ease
}

.custom-search-close:hover{
    background:#e74c3c;
    color:#fff;
    transform:rotate(90deg)
}

.custom-search-results{
    margin-top:20px;
    max-height:60vh;
    overflow-y:auto;
    animation:scaleIn .3s ease
}

.custom-search-results::-webkit-scrollbar{width:6px}
.custom-search-results::-webkit-scrollbar-track{background:rgba(255,255,255,0.1);border-radius:3px}
.custom-search-results::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.3);border-radius:3px}

.search-category{margin-bottom:20px}

.search-category-title{
    color:#2A8DA3;
    font-size:14px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:2px;
    margin-bottom:12px;
    padding-left:5px;
    display:flex;
    align-items:center;
    gap:8px;
    text-shadow:0 2px 8px #fff,0 0 2px #0056b3;
}
.search-category-title::before{
    content:'';
    width:4px;height:16px;
    background:linear-gradient(180deg,#2A8DA3,#1a5f6f);
    border-radius:2px
}

.search-result-card{
    background:rgba(255,255,255,0.95);
    border-radius:16px;
    padding:16px;
    margin-bottom:10px;
    display:flex;
    align-items:center;
    gap:15px;
    cursor:pointer;
    transition:all .3s cubic-bezier(0.4,0,0.2,1);
    border:1px solid rgba(0,0,0,0.05);
    text-decoration:none;
    animation:cardAppear .3s ease forwards;
    opacity:0
}

.search-result-card:hover{
    transform:translateX(10px);
    box-shadow:0 10px 40px rgba(42,141,163,0.2);
    border-color:#2A8DA3
}

.search-result-avatar{
    width:55px;height:55px;
    border-radius:14px;
    object-fit:cover;
    border:3px solid #f0f0f0;
    transition:all .3s ease
}

.search-result-card:hover .search-result-avatar{
    border-color:#2A8DA3;
    transform:scale(1.05)
}

.search-result-info{flex:1}

.search-result-name{
    font-size:16px;
    font-weight:600;
    color:#333;
    margin-bottom:4px
}

.search-result-meta{
    font-size:13px;
    color:#888
}

.search-result-arrow{
    width:35px;height:35px;
    background:#f5f5f5;
    border-radius:10px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#999;
    transition:all .3s ease
}

.search-result-card:hover .search-result-arrow{
    background:#2A8DA3;
    color:#fff;
    transform:translateX(5px)
}

.search-hint{
    text-align:center;
    color:rgba(255,255,255,0.5);
    font-size:14px;
    margin-top:30px
}

.search-hint kbd{
    background:rgba(255,255,255,0.1);
    padding:5px 10px;
    border-radius:6px;
    font-family:inherit
}

.no-results-message{
    text-align:center;
    padding:40px;
    color:rgba(255,255,255,0.7)
}

.no-results-message i{
    font-size:50px;
    margin-bottom:15px;
    opacity:0.5
}

.loading-spinner{
    display:flex;
    justify-content:center;
    padding:30px
}

.loading-spinner::after{
    content:'';
    width:40px;height:40px;
    border:3px solid rgba(255,255,255,0.1);
    border-top-color:#2A8DA3;
    border-radius:50%;
    animation:spin .8s linear infinite
}

/* ================= MOBILE ================= */

@media(max-width:768px){
    .custom-search-popup{padding-top:20px;padding-left:10px;padding-right:10px}
    .custom-search-container{width:100%;max-width:100%}
    .custom-search-box{border-radius:15px;padding:5px}
    .custom-search-icon{width:40px;height:40px;font-size:18px}
    .custom-search-input{font-size:16px;padding:12px 8px}
    .custom-search-close{width:40px;height:40px;border-radius:10px;font-size:16px}
    .custom-search-results{margin-top:15px;max-height:70vh}
    .search-category-title{font-size:11px;letter-spacing:1px;margin-bottom:10px}
    .search-result-card{padding:12px;border-radius:12px;gap:12px;margin-bottom:8px}
    .search-result-card:hover{transform:translateX(5px)}
    .search-result-avatar{width:45px;height:45px;border-radius:10px;border-width:2px}
    .search-result-name{font-size:14px}
    .search-result-meta{font-size:12px}
    .search-result-arrow{width:30px;height:30px;border-radius:8px}
    .search-hint{display:none}
    .no-results-message{padding:30px 20px}
    .no-results-message i{font-size:40px}
}

@media(max-width:480px){
    .custom-search-popup{padding-top:15px}
    .custom-search-box{border-radius:12px}
    .custom-search-icon{width:35px;height:35px;font-size:16px}
    .custom-search-input{font-size:15px;padding:10px 5px}
    .custom-search-close{width:35px;height:35px}
    .search-result-card{padding:10px;gap:10px}
    .search-result-avatar{width:40px;height:40px}
    .search-result-name{font-size:13px;line-height:1.3}
    .search-result-meta{font-size:11px}
    .search-result-arrow{width:28px;height:28px;font-size:12px}
}
