/* chart-toolbar.css — Shared draw/indicator toolbar styles for chart & console pages */

/* Touch targets */
.tv-draw-btn,
.tv-draw-tool-item,
.tv-draw-category-header,
.tv-tool-pill,
.tv-fav-star {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ── Draw Toolbar (floating, desktop) ───────────────────────────── */
.tv-draw-toolbar {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    padding: 6px;
    background: rgba(19, 23, 34, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    z-index: 20;
}
.tv-draw-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
}
.tv-draw-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.tv-draw-btn.active { background: #2962ff; color: #fff; border-color: rgba(41,98,255,0.6); box-shadow: 0 6px 18px rgba(41,98,255,0.45); }
.tv-draw-divider { width: 1px; background: rgba(255,255,255,0.08); margin: 0 4px; }

/* ── Mobile side toolbar ────────────────────────────────────────── */
.tv-side-toolbar {
    position: absolute;
    top: 50%;
    right: calc(10px + env(safe-area-inset-right, 0px));
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 35;
}
.tv-side-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(19, 23, 34, 0.9);
    border: 1px solid rgba(255,255,255,0.12);
    color: #d1d4dc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    cursor: pointer;
}
.tv-side-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: rgba(19, 23, 34, 0.88);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: all 0.18s ease;
}
.tv-side-toolbar.open .tv-side-actions {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.tv-side-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
    cursor: pointer;
}
.tv-side-btn.active {
    background: #2962ff;
    color: #ffffff;
    border-color: rgba(41,98,255,0.6);
    box-shadow: 0 6px 16px rgba(41,98,255,0.45);
}
.tv-side-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ── Draw / Indicator menu (dropdown panel) ─────────────────────── */
.tv-draw-menu {
    position: absolute;
    top: 56px;
    left: 12px;
    width: 300px;
    max-height: calc(100vh - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(19, 23, 34, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 14px 46px rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    z-index: 40;
}
.tv-draw-menu.hidden { display: none; }
.tv-draw-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}
.tv-draw-menu-header button {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(209, 212, 220, 0.92);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tv-draw-menu-header button:hover { background: rgba(255,255,255,0.10); color: #ffffff; }
.tv-draw-menu-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(148, 163, 184, 0.95);
}
.tv-draw-menu-search input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 12px;
    outline: none;
}
.tv-draw-menu-search input:focus { border-color: rgba(41,98,255,0.55); box-shadow: 0 0 0 3px rgba(41,98,255,0.18); }
.tv-draw-menu-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    max-height: calc(100vh - 180px);
    padding: 10px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* ── Category sections ──────────────────────────────────────────── */
.tv-draw-category {
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 10px;
}
.tv-draw-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    color: rgba(226, 232, 240, 0.92);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.tv-draw-category-header:hover { background: rgba(255,255,255,0.04); }
.tv-draw-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tv-draw-category-tools {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Tool items ─────────────────────────────────────────────────── */
.tv-draw-tool-item {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(209, 212, 220, 0.92);
    text-align: left;
    transition: all 0.12s;
    cursor: pointer;
}
.tv-draw-tool-item:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.10); color: #ffffff; }
.tv-draw-tool-item.active { background: rgba(41,98,255,0.18); border-color: rgba(41,98,255,0.45); color: #ffffff; }
.tv-draw-tool-icon {
    width: 26px;
    text-align: center;
    color: rgba(148, 163, 184, 0.95);
    flex: 0 0 auto;
}
.tv-draw-tool-item.active .tv-draw-tool-icon { color: #ffffff; }
.tv-draw-tool-meta { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; }
.tv-draw-tool-title { font-size: 12px; font-weight: 650; line-height: 1.1; }
.tv-draw-tool-desc { font-size: 11px; color: rgba(148, 163, 184, 0.95); line-height: 1.1; }
.tv-draw-tool-item:hover .tv-draw-tool-desc { color: rgba(226, 232, 240, 0.85); }
.tv-draw-tool-status { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: rgba(148, 163, 184, 0.92); }
.tv-draw-tool-item.active .tv-draw-tool-status { color: rgba(226, 232, 240, 0.95); }

/* ── Pills & stars ──────────────────────────────────────────────── */
.tv-tool-pill {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    color: rgba(226, 232, 240, 0.85);
    line-height: 1.1;
    white-space: nowrap;
}
.tv-tool-pill.on { border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.12); color: rgba(187,247,208,0.95); }
.tv-tool-pill.off { border-color: rgba(148,163,184,0.22); background: rgba(148,163,184,0.06); color: rgba(148,163,184,0.95); }
.tv-fav-star {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(148, 163, 184, 0.95);
    cursor: pointer;
    user-select: none;
}
.tv-fav-star:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.10); color: rgba(226, 232, 240, 0.95); }
.tv-fav-star.active { color: rgba(250,204,21,0.95); }

/* ── Form (config modal) ───────────────────────────────────────── */
.tv-form-group { margin-bottom: 1rem; }
.tv-form-group label { display: block; font-size: 0.8rem; color: #787b86; margin-bottom: 0.4rem; }
.tv-input {
    width: 100%;
    background: #2a2e39;
    border: 1px solid #363a45;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
}
