/* ================================
   TOPBETPREDICT SEARCH MODAL
================================ */

.tp-search-open {
    height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background:
        radial-gradient(circle at top left, rgba(34, 94, 191, 0.22), transparent 55%),
        rgba(255, 255, 255, 0.045);
    color: #dbe4f3;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.18s ease;
}

.tp-search-open:hover {
    background:
        radial-gradient(circle at top left, rgba(34, 94, 191, 0.34), transparent 55%),
        rgba(255, 255, 255, 0.07);
    border-color: rgba(64, 126, 230, 0.45);
    color: #ffffff;
}

.tp-search-icon {
    font-size: 15px;
    opacity: 0.95;
}

.tp-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(1, 6, 18, 0.78);
    backdrop-filter: blur(4px);
    z-index: 9990;
    display: none;
}

.tp-search-overlay.active {
    display: block;
}

.tp-search-modal {
    position: fixed;
    top: 78px;
    left: 50%;
    transform: translateX(-50%) scale(0.97);
    width: min(640px, calc(100% - 28px));
    max-height: calc(100vh - 115px);
    background:
        radial-gradient(circle at top left, rgba(32, 84, 180, 0.18), transparent 38%),
        linear-gradient(180deg, #101827 0%, #090f1b 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    z-index: 9991;
    display: none;
    overflow: hidden;
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.58),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tp-search-modal.active {
    display: block;
    transform: translateX(-50%) scale(1);
}

.tp-search-box {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 115px);
}

.tp-search-head {
    padding: 18px 22px 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.tp-search-head h3 {
    margin: 0;
    font-size: 21px;
    line-height: 1.2;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.tp-search-head p {
    margin: 5px 0 0;
    color: #93a4bd;
    font-size: 13px;
}

.tp-search-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 18px;
    cursor: pointer;
    color: #aebbd0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.18s ease;
}

.tp-search-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.tp-search-input-wrap {
    margin: 16px 22px 11px;
    position: relative;
}

.tp-search-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6f86ad;
    font-size: 15px;
}

.tp-search-input {
    width: 100%;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    padding: 0 15px 0 43px;
    font-size: 15px;
    outline: none;
    color: #eaf1ff;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.035));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.tp-search-input::placeholder {
    color: #71819a;
}

.tp-search-input:focus {
    border-color: rgba(56, 118, 230, 0.72);
    box-shadow:
        0 0 0 3px rgba(36, 102, 220, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tp-search-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 22px 13px;
    scrollbar-width: none;
}

.tp-search-tabs::-webkit-scrollbar {
    display: none;
}

.tp-search-tab {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.045);
    color: #aebbd0;
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.18s ease;
}

.tp-search-tab:hover {
    color: #ffffff;
    border-color: rgba(64, 126, 230, 0.36);
    background: rgba(64, 126, 230, 0.12);
}

.tp-search-tab.active {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #ffffff;
    border-color: rgba(96, 165, 250, 0.65);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.tp-search-hint {
    margin: 0 22px 18px;
    padding: 13px 14px;
    color: #91a3bd;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 13px;
}

.tp-search-results {
    overflow-y: auto;
    padding: 4px 14px 18px;
    max-height: 58vh;
}

.tp-search-results::-webkit-scrollbar {
    width: 8px;
}

.tp-search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
}

.tp-search-results::-webkit-scrollbar-thumb {
    background: rgba(64, 126, 230, 0.42);
    border-radius: 999px;
}

.tp-search-section-title {
    padding: 12px 8px 7px;
    font-size: 11px;
    font-weight: 900;
    color: #6f86ad;
    text-transform: uppercase;
    letter-spacing: 0.10em;
}

.tp-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 9px;
    border-radius: 14px;
    text-decoration: none;
    transition: 0.16s ease;
    border: 1px solid transparent;
}

.tp-search-result:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.08);
}

.tp-search-img-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.16), transparent 58%),
        rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    position: relative;
}

.tp-search-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.tp-search-double-img {
    flex-direction: row;
}

.tp-search-double-img img {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2px;
}

.tp-search-double-img img + img {
    margin-left: -9px;
}

.tp-search-placeholder {
    font-size: 18px;
}

.tp-search-info {
    min-width: 0;
    flex: 1;
}

.tp-search-title {
    color: #eef4ff;
    font-weight: 900;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-search-subtitle {
    margin-top: 4px;
    color: #7f91ab;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-search-badge {
    font-size: 10px;
    font-weight: 900;
    color: #7f91ab;
    text-transform: uppercase;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.tp-search-empty,
.tp-search-loading {
    margin: 8px;
    padding: 26px 12px;
    color: #91a3bd;
    text-align: center;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.035);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tp-mobile-search-btn {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 55%),
        rgba(255, 255, 255, 0.045);
    cursor: pointer;
}

body.tp-search-opened {
    overflow: hidden;
}

/* Mobile */
@media (max-width: 700px) {
    .tp-search-modal {
        top: 14px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 28px);
        border-radius: 17px;
    }

    .tp-search-box {
        max-height: calc(100vh - 28px);
    }

    .tp-search-head {
        padding: 16px 16px 12px;
    }

    .tp-search-head h3 {
        font-size: 20px;
    }

    .tp-search-head p {
        font-size: 12px;
    }

    .tp-search-input-wrap {
        margin: 14px 16px 10px;
    }

    .tp-search-tabs {
        padding: 0 16px 12px;
    }

    .tp-search-hint {
        margin: 0 16px 16px;
    }

    .tp-search-results {
        padding: 4px 10px 14px;
        max-height: 60vh;
    }

    .tp-search-text {
        display: none;
    }

    .tp-search-badge {
        display: none;
    }
}

.tp-search-section-title {
    margin-top: 4px;
}

.tp-search-result:first-of-type {
    margin-top: 2px;
}

.tp-search-overlay {
    z-index: 99990 !important;
}

.tp-search-modal {
    z-index: 99999 !important;
}