/* assets/search.css */

.search-container {
    width:100%;
    max-width: 480px;
    margin: 32px auto 0 auto;
    background: var(--tg-theme-bg-color, #222);
    border-radius: 16px;
    box-shadow: 0 4px 16px #0002;
    padding: 24px 18px;
    box-sizing:border-box;
    overflow-x:hidden;
}

.search-title {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: var(--tg-theme-link-color, #a773d2);
}

.search-help {
    font-size: 0.96em;
    color: #aaa;
    margin-bottom: 18px;
}

.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #353842;
    border-radius: 8px;
    background: var(--tg-theme-secondary-bg-color, #16171c);
    color: var(--tg-theme-text-color, #fff);
    outline: none;
    box-shadow: none;
    transition: border 0.15s;
}
.search-form input[type="text"]:focus {
    border-color: var(--tg-theme-link-color, #a773d2);
}

.search-results {
    margin-top: 20px;
    padding:20px;
}
.search-widget-title {
    color: #888;
    margin: 8px 0 4px;
    font-size: 1.08em;
}

.search-skeleton {
    background: linear-gradient(90deg,#2e2f36 25%,#353842 37%,#2e2f36 63%);
    background-size: 400% 100%;
    animation: skeleton 1.2s ease-in-out infinite;
    border-radius: 14px;
    height: 120px;
    margin-bottom: 8px;
}

@keyframes skeleton {
    0% {background-position:100% 50%;}
    100% {background-position:0 50%;}
}
.search-preloader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    margin-bottom: 14px;
}
.search-preloader:after {
    content: "";
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 4px solid #a773d2;
    border-top-color: #e1d6f7;
    animation: spin 1.1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.theme-log {
    background: rgba(130,110,220,0.04);
    padding: 6px 9px;
    border-radius: 8px;
    margin-bottom: 8px;
    word-break: break-all;
}

.telegram-widgets {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.tg-post-widget {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/*placeholder-animated*/
.search-input-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}
.search-real-input {
    background: transparent;
    color: inherit;
    width: 100%;
    position: relative;
    z-index: 1;
    font-size: 1em;
    line-height: 1.15;
    padding: 13px 14px;
}
.placeholder-animate {
    position: absolute;
    left: 14px;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
    color: var(--tg-theme-hint-color, #a773d2);
    width: calc(100% - 28px);
    display: flex;
    align-items: center;
    font-size: 1em;
    font-family: inherit;
    opacity: 1;
    background: transparent;
    transition: opacity .2s;
    height: 100%;
    line-height: 1.15;
    min-height: 38px;
}
.placeholder-animate .active-char {
    color: var(--tg-theme-button-color, #a773d2);
    font-weight: bold;
    font-size: 1.14em;
    filter: drop-shadow(0 2px 5px rgba(130,110,220,0.15));
    transition: font-size .18s cubic-bezier(.6,2.1,.5,1);
}
.search-btn-animate {
    animation: btn-shake 0.36s cubic-bezier(.57,2.3,.52,.89);
}
@keyframes btn-shake {
    10% { transform: translateX(-2px) rotate(-4deg);}
    20% { transform: translateX(2px) rotate(4deg);}
    30% { transform: translateX(-3px) rotate(-6deg);}
    40% { transform: translateX(2px) rotate(2deg);}
    50% { transform: translateY(-2px) rotate(-1deg);}
    60% { transform: translateY(2px) rotate(1deg);}
    70% { transform: translateX(-1px) rotate(-2deg);}
    80% { transform: translateX(1px) rotate(2deg);}
    100% { transform: none;}
}

.search-tooltip {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 7px;
    background: var(--tg-theme-bg-color, #f6f6f9);
    color: var(--tg-theme-button-color, #a773d2);
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 1em;
    font-family: inherit;
    text-align: center;
    box-shadow: 0 6px 18px 0 rgba(70,40,120,0.13);
    opacity: 0;
    pointer-events: none;
    transition: opacity .23s cubic-bezier(.58,1.2,.6,1);
    z-index: 100;
}
.search-tooltip.show {
    opacity: 1;
    pointer-events: auto;
}

.search-image-outer {
    width: 100%;
    max-width: 420px;
    margin: 24px auto 18px auto;
    transition: opacity 0.32s cubic-bezier(.64,0,.32,1), height 0.35s cubic-bezier(.85,0,.25,1);
    will-change: opacity, height;
    overflow: hidden;
    opacity: 1;
    height: auto;
}
.search-image-outer.hide {
    opacity: 0;
    height: 0 !important;
    pointer-events: none;
    transition: opacity 0.32s, height 0.35s;
}
.search-image-outer > img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit:cover;
    border-radius: 17px;
    user-select: none;
    
}
