/**
 * Mini App: донастройка страницы ботов (отступы, тултипы «i», золотой CTA «Консервативно»).
 * База визуала — trading-bots-algo.css (копия trading-bots-ref).
 */

/* Плотнее к верху: меньше отступа под шапкой с «Назад» */
.page-tb-bots .header:has(.header-line-row) + .main {
    padding-top: 0.35rem;
}
.page-tb-bots .main {
    padding: 0.35rem 0 1.5rem;
}

/* ---- Тултипы: раскладка .tb-card-head (как на сайте) + показ/скрытие ---- */
.page-tb-algo .tb-card__top {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex: 0 0 auto;
}
.page-tb-algo .tb-card-head {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;
    min-height: 0;
}
.page-tb-algo .tb-card-titles {
    min-width: 0;
    flex: 1;
}
.page-tb-algo .tb-info-wrap {
    position: relative;
    flex: 0 0 auto;
    z-index: 4;
    align-self: flex-start;
    margin-top: 0;
    margin-left: 0.15rem;
}
.page-tb-algo .tb-card-head .tb-tooltip {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0.45rem;
    width: 100%;
    max-width: none;
    padding: 0.75rem 1rem;
    text-align: left;
    color: #b8c5d4;
    background: rgba(8, 12, 20, 0.97) !important;
    border: 1px solid rgba(148, 176, 204, 0.22) !important;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 20px 50px -12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 4px, 0);
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    flex: 1 0 100%;
    order: 3;
    box-sizing: border-box;
    font-size: 0.8125rem;
    line-height: 1.45;
}
@media (min-width: 900px) {
    .page-tb-algo .tb-card-head .tb-tooltip {
        left: auto;
        right: 0;
        top: 100%;
        width: min(300px, 92%);
        max-width: 300px;
        flex: none;
        order: 0;
        margin-top: 0.35rem;
    }
}
@media (hover: hover) and (pointer: fine) {
    .page-tb-algo .tb-info-wrap:hover + .tb-tooltip,
    .page-tb-algo .tb-info-wrap:focus-within + .tb-tooltip,
    .page-tb-algo .tb-card-head:has(.tb-info-btn:hover) .tb-tooltip,
    .page-tb-algo .tb-card-head:has(.tb-info-btn:focus-visible) .tb-tooltip {
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
    }
}
@media (hover: none) {
    .page-tb-algo .tb-info-wrap:not(.tb-tooltip-open) + .tb-tooltip {
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translate3d(0, 4px, 0) !important;
        pointer-events: none !important;
    }
    .page-tb-algo .tb-info-wrap.tb-tooltip-open + .tb-tooltip {
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
    }
}
.page-tb-algo .tb-tooltip .tb-tooltip-title {
    margin: 0 0 0.4rem 0;
}
.page-tb-algo .tb-tooltip-list {
    margin: 0.35rem 0 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.page-tb-algo .tb-tooltip-list li {
    position: relative;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #9eb0c2;
    padding: 0.4rem 0.5rem 0.4rem 0.65rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}
.page-tb-algo .tb-tooltip-list li::before {
    content: "";
    position: absolute;
    left: 0.3rem;
    top: 0.65rem;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #7aa7cc;
}

/* Золотой акцент на CTA «Консервативно» (поверх тёплого градиента в algo.css) */
.page-tb-algo .tb-card[data-tb-ref="conservative"] .tb-card-cta--warm,
.page-tb-algo .tb-card--recommended .tb-card-cta--warm {
    background: linear-gradient(180deg, #f0d78c 0%, #d4af37 48%, #b8860b 100%) !important;
    border: 1px solid rgba(255, 220, 160, 0.45) !important;
    color: #1a0f00 !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
    box-shadow:
        0 4px 22px rgba(212, 175, 55, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
}
.page-tb-algo .tb-card[data-tb-ref="conservative"] .tb-card-cta--warm:hover,
.page-tb-algo .tb-card[data-tb-ref="conservative"] .tb-card-cta--warm:focus-visible,
.page-tb-algo .tb-card--recommended .tb-card-cta--warm:hover,
.page-tb-algo .tb-card--recommended .tb-card-cta--warm:focus-visible {
    background: linear-gradient(180deg, #f5e0a0 0%, #e0b645 50%, #c9a02e 100%) !important;
    color: #130b00 !important;
    border-color: rgba(255, 230, 180, 0.55) !important;
    box-shadow:
        0 6px 28px rgba(212, 175, 55, 0.58),
        inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}
